Unofficial CardLife revival project, pronounced like "celery"
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NGnius (Graham) 175a569ea4 Fix some more float parsing bugs 3 years ago
CLre Fix some more float parsing bugs 3 years ago
CLre_server Minor improvements to chat commands 3 years ago
.gitignore Initial commit 4 years ago
CLre.sln Create CLre_server mod and port CLre basic functionality 3 years ago
LICENSE Remove placeholders in license 3 years ago
README.md Update installation process 3 years ago

README.md

CLre

Always eat your celery, so you'll grow up to be big and strong like me. Work-in-progress mod for Cardlife.

Cardlife has stopped receiving updates, but that doesn't mean it's free from bugs. CLre is a mod to rejuvenate Cardlife by fixing old bugs and adding some modding sprinkles.

Development

Setup

This project requires most of Cardlife's .dll files to function correctly. Most, but not all, of these files are stored in Cardlife's Cardlife_Data\Managed folder. The project is pre-configured to look in a folder called cl in the solution's main directory or one level up from that.

You can make sure CLre can find all of .dll files it needs by copying your Cardlife folder beside this repo's folder and renaming it to cl, but that's a bit of a waste of disk space. You can also create a symbolic link to your Cardlife install folder named cl in the same spot to avoid having to re-copy files. For example, if you cloned the repo into a folder called CLre_repo, this is what your folder structure would look like.

If you decide to change the cl folder configuration, do not commit changes to your CLre.csproj or CLre_server.csproj files otherwise your changes will be rejected.

CLre_repo/ <- CLre git project files
  CLre/ <- Code files
  README.md <- This file
  etc.

cl/ <- Cardlife files
  Cardlife_Data/
    Managed/ <- Cardlife C# Assemblies
  CardlifeGameServer_Data/
    Managed/ <- Cardlife Server C# Assemblies (optional)

For any game mod to work, you will have to patch your game with the Cardlife adaptation of CLIPA. For a server mod to work, you will have to patch the server (CardlifeGameServer.exe). The installation process is below, or you can follow the instructions for Gamecraft: GCIPA Gamecraft install guide.

Building

After you've completed the setup, open the solution file CLre.sln in your prefered C# .NET/Mono development environment. I'd recommend Visual Studio Community Edition or JetBrains Rider.

If you've successfully completed setup, you should be able to build the CLre project without errors. If it doesn't work and you can't figure out why, ask for help on the Exmods Discord server.

Installation

To patch Cardlife to load mods, download the latest version of CLIPA, extract the contents into the game folder, then drag Cardlife.exe (or CardlifeServer.exe to patch the server) onto IPA.exe. If you haven't turned on “Show file extensions” in Windows, those files may appear to be named Cardlife and IPA. Some antivirus software may (wrongly) claim that IPA is a virus, but those warnings can be dismissed. If you don't believe me, read the CLIPA source code.

To install the CLre mod, copy CLre.dll and 0Harmony.dll (from the release zip) into the Plugins folder in the Cardlife install directory. To install the CLre_server mod, copy CLre_server.dll and 0Harmony.dll (from the release zip) into the Plugins folder where Cardlife is installed.

A Note on CLre and CLre_server mods’ (lack of) cooperation

CLre is designed for the Cardlife client, and cannot be used with the Cardlife server. Similarly, CLre_server is designed for the Cardlife server, and cannot be used with the Cardlife client. DO NOT install CLre and CLre_server in the same Plugins folder, because both mods will be loaded -- guaranteeing one will break. To install CLre and CLre_server on the same computer, create a copy of the game installation and use one copy for CLre and one for CLre_server.

Functionality

CLre

CLre provides a minimal modding API and useful bugfixes for the Cardlife client.

Fixes

As of v0.0.3, ten (10) bugfixes are implemented.

Technically, that's eleven (11) but AntiStupidFloats is disabled unless you add --float-fix to the launch parameters.

API

Basic engine registration and some events are exposed for modders to use. Documentation WIP... (read the code files in the CLre/API directory for now)

CLre_server

CLre_server provides a minimal modding API, admin HTTP server, and bugfixes for the Cardlife server.

Fixes

As of v0.0.3, one (1) bugfix is implemented.

  • InitLogSooner: Start the logger slightly sooner than Cardlife does [TARGET: CustomLoggerThread] [ID: 0] (0M/2P/1I/0W/0A/0D/3T)

API

Basic engine registration and some events are exposed for modders to use. Documentation WIP... (read the code files in the CLre_server/API directory for now)

Tweaks

CLre_server also offers a few improvements for the Cardlife server. These are not bugfixes, but are quality-of-life additions to bring server functionality up to par with other game servers. Improvements can be enabled and customized by modifying the CLre_server.json configuration file in Cardlife's install directory.

HTTP Server

The HTTP server is enabled by the -web command line argument, or in CLre_server.json. It is disabled by default to reduce resource usage. When enabled, the server will listen on http://localhost:5030 and provide basic server status information. This can be accessed through any standard web browser on the same computer. If you wish to make this publicly accessible, it is recommended to use Nginx or another web proxy system to proxy traffic to that port securely.

Useful endpoints

GET / HTML landing page with some basic server info
GET /l/current Server output log, up-to-date as of last webpage refresh
GET /d/version Cardlife, Unity and CLre version information
GET /status.json Useful status information about players and server state in JSON format
GET /c/game.json Basically GameServerSettings.json for the running Cardlife server

Server Commands

CLre_server can accept chat commands from connected players. Chat commands can be enabled in CLre_server.json. For this functionality to work, valid user credentials must also be configured.

Commands

/echo <msg> - say <msg>
/help - show a list of commands
/list - display online users
/version - display version information

/ban <user> - permanently remove <user> from this server
/deop <user> - revoke <user> moderator permissions
/kick <user> - disconnect <user> from this server
/op <user> - grant <user> moderator permissions

Terrain Modification Exclusion Zone

This exclusion zone improvement can be enabled in CLre_server.json. This prevents players from digging under a building that they do not own. This improves on the existing exclusion zone functionality which already prevents a player from placing materials and building structures too close to another player's building.

CLre-only Mode

To prevent vanilla clients from connecting to this server, enable this restriction in CLre_server.json. Enabling this functionality is not recommended. This functionality should only be used when other code mods are installed which break compatibility with unmodded Cardlife clients.