A multiplayer gameserver for the PC videogame SimCity 4. Uses python 3.8.10 and py2exe. Built to work with the SC4MP Client.
Download the latest release and follow the instructions included in the Readme.html
file.
Alternatively, use the SC4MP Server Dockerizer by andreRBarata and deploy your server as a Docker container.
To compile the source code, run the setup.py
script.
This section is meant for developers using the SC4MP protocol. Here you can find examples of requests and responses from the server, useful for creating a server scanner or client appplication for the SC4MP network.
Adds the requesting server to the requested server's server list queue.
add_server <port>
none
Returns "y" if the password provided is correct, otherwise "n".
check_password <password>
y
or
n
Returns server info in a JSON dictionary.
info
{
"server_id": <server_id>,
"server_name": <server_name>,
"server_description": <server_description>,
"server_url": <server_url>,
"server_version": <server_version>,
"private": <private>,
"password_enabled": <password_enabled>,
"user_plugins_enabled": <user_plugins_enabled>
}
Returns "y" if the server requires a password, otherwise "n".
password_enabled
y
or
n
Returns "pong".
ping
pong
Requests plugins from the server.
plugins
or
plugins <version> <user_id> <password>
[
[<file_1_md5>, <file_1_size>, <file_1_relpath>],
[<file_2_md5>, <file_2_size>, <file_2_relpath>],
...
[<file_n_md5>, <file_n_size>, <file_n_relpath>]
]
[
[<file_1_md5>, <file_1_size>, <file_1_relpath>],
[<file_2_md5>, <file_2_size>, <file_2_relpath>],
...
[<file_n_md5>, <file_n_size>, <file_n_relpath>]
]
<file_1_data>
<file_2_data>
...
<file_n_data>
Returns "y" if the server's plugins and regions require a request header, otherwise "n".
private
y
or
n
Requests regions from the server.
regions
or
regions <version> <user_id> <password>
[
[<file_1_md5>, <file_1_size>, <file_1_relpath>],
[<file_2_md5>, <file_2_size>, <file_2_relpath>],
...
[<file_n_md5>, <file_n_size>, <file_n_relpath>]
]
[
[<file_1_md5>, <file_1_size>, <file_1_relpath>],
[<file_2_md5>, <file_2_size>, <file_2_relpath>],
...
[<file_n_md5>, <file_n_size>, <file_n_relpath>]
]
<file_1_data>
<file_2_data>
...
<file_n_data>
Pushes a save to the server.
save <version> <user_id> <password>
ok
[
<region_name>,
[
<file_1_size>,
<file_2_size>,
...
<file_n_size>
]
]
ok
<data>
<message>
Returns the server description.
server_description
<server_description>
Returns the server ID.
server_id
<server_id>
Returns the server list in a 2d JSON array.
server_list
[
[<server_1_host>, <server_1_port>],
[<server_2_host>, <server_2_port>],
...
[<server_n_host>, <server_n_port>]
]
Returns the server name.
server_name
<server_name>
Returns the server URL.
server_url
<server_url>
Returns the version of the SC4MP Server that the server is running on.
server_version
<server_version as major.minor.patch>
Returns the time in the server's timezone.
time
<time as Y-m-d H:M:S>
Returns a radomized token that is used for server verification.
token <version> <user_id> <password>
<token>
Returns a user_id from an SHA-256 hash of a concatenation of the user_id and client-side token. Used to verify that the server has the user ID on record.
user_id <hash>
<user_id>
Returns "y" if user plugins are permitted, otherwise "n".
user_plugins_enabled
y
or
n