From: Christian Heller Date: Wed, 27 Jan 2016 22:21:53 +0000 (+0100) Subject: Change path of server run data directory from server/ to server_run/. X-Git-Tag: tce~211 X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/balance?a=commitdiff_plain;h=7ee8d801cf446845504674ccd804905180bfb35b;p=plomrogue Change path of server run data directory from server/ to server_run/. --- diff --git a/README b/README index ad0dee1..b0daed4 100644 --- a/README +++ b/README @@ -69,16 +69,16 @@ Hacking / server internals and configuration The game world is set up and made subject to player commands by ./roguelike-server. It's controlled by commands explained in the file -./SERVER_COMMANDS. The server usually reads these from the files ./server/in +./SERVER_COMMANDS. The server usually reads these from the files ./server_run/in (written to by ./roguelike-client), ./confserver/world, ./record_save and ./save. The ./roguelike-server executable can be run with a -v option for possibly helpful debugging info (mostly: what messages the client sends to the server). -Server and client communicate via files in the ./server/ directory (generated -when the server is first run). The ./server/in file is read by the server for -newline-delimited commands. The ./server/out file contains server messages to be -read by clients. The ./server/worldstate file contains a serialized -representation of the game world's data as it is to be visible to the player / -the player's client. +Server and client communicate via files in the ./server_run/ directory +(generated when the server is first run). The ./server_run/in file is read by +the server for newline-delimited commands. The ./server_run/out file contains +server messages to be read by clients. The ./server/worldstate file contains a +serialized representation of the game world's data as it is to be visible to the +player / the player's client. diff --git a/SERVER_COMMANDS b/SERVER_COMMANDS index bc69c2a..156cd43 100644 --- a/SERVER_COMMANDS +++ b/SERVER_COMMANDS @@ -10,15 +10,15 @@ on success, reads all commands from it. If no save file exists, commands from Afterwards, the command "MAKE_WORLD" with the current Unix time as argument is interpreted (and also written to ./record_save). -In any case, from then on, further commands are read in from ./server/in. New -commands must be appended to the file – which is what the client does. All -commands from ./server/in except meta commands are also written to +In any case, from then on, further commands are read in from ./server_run/in. +New commands must be appended to the file – which is what the client does. All +commands from ./server_run/in except meta commands are also written to ./record_save. Every fifteen seconds, if any turns have passed, ./savefile is written – with a list of all god commands necessary to recreate the current world state. On each -world state change, ./server/worldstate is updated and a message "WORLD_UPDATED" -written to ./server/out. +world state change, ./server_run/worldstate is updated and a message +"WORLD_UPDATED" written to ./server_run/out. Replay mode ----------- @@ -29,7 +29,7 @@ turn number is higher than the last turn of the recorded play, the last turn. If no turn number is given as argument, the record file is replayed until turn 1 is reached. Meta commands in ./record_save are not understood. -From then on, ./server/in is also read. Meta commands sent by the client are +From then on, ./server_run/in is also read. Meta commands sent by the client are interpreted normally, but any player and god command merely furthers reading of ./record_save by one line and is otherwise ignored. @@ -56,7 +56,7 @@ Run plugin code in ./plugins/[argument], with argument only consisting of alphanumeric characters and underscores. PING -Write "PONG" line to ./server/out file. +Write "PONG" line to ./server_run/out file. QUIT Shut down server. @@ -64,7 +64,7 @@ Shut down server. THINGS_HERE [0 to 255] [0 to 255] If world exists, write line-by-line list of things visible or in memory at y position of first argument, x position of second argument of map into -./server/out file, enclosed by two lines "THINGS_HERE START" and +./server_run/out file, enclosed by two lines "THINGS_HERE START" and "THINGS_HERE END". Player commands @@ -109,17 +109,17 @@ Set map seed and randomness seed to argument. Remove all things. (Re-)generate map. Add to map things specified in thing types table in quantity defined there by START_NUMBER command, with first thing (of thing ID of 0) of type defined as player type by PLAYER_TYPE command. Set world turn to 1. Activate world. Answer -with 'NEW_WORLD' message in ./server/out file. +with 'NEW_WORLD' message in ./server_run/out file. MAP_LENGTH [1 to 256] -Deactivate world. Remove ./server/worldstate file. Remove all things. Remove +Deactivate world. Remove ./server_run/worldstate file. Remove all things. Remove map. Set map edge length to argument. (Initial value: 64.) MAP [0 to 255] [string] Set part of game map to string argument: the line of the argument's number. WORLD_ACTIVE [0|1] -Set world activity state to argument. If 0, remove ./server/worldstate file. +Set world activity state to argument. If 0, remove ./server_run/worldstate file. Else, if world was so far inactive, a map exists, at least one "wait" thing action is defined, and a thing of ID 0 (= a player character) that is not part of any other thing's inventory, (re-)build all animate things' fields of view, @@ -137,7 +137,7 @@ TA_NAME [wait|move|use|drop|pick_up] Set selected thing action's name (and thereby function, equal to player command). Legal worlds need at least one action of name "wait", so if this unsets the world's only "wait" action, the world is deactivated, and the -./server/worldstate file removed. +./server_run/worldstate file removed. T_ID [-1 to infinity] Select thing to manipulate by argument as ID. If argument is <0, change it to diff --git a/client/config/io.py b/client/config/io.py index ecf283d..f0ec29c 100644 --- a/client/config/io.py +++ b/client/config/io.py @@ -1,7 +1,7 @@ io = { - "path_out": "server/in", - "path_in": "server/out", - "path_worldstate": "server/worldstate", + "path_out": "server_run/in", + "path_in": "server_run/out", + "path_worldstate": "server_run/worldstate", "worldstate_read_order": [ ["lifepoints", "int"], ["satiation", "int"], diff --git a/roguelike-server b/roguelike-server index f7b2896..4ab7287 100755 --- a/roguelike-server +++ b/roguelike-server @@ -1733,10 +1733,10 @@ io_db = { "path_save": "save", "path_record": "record_save", "path_worldconf": "confserver/world", - "path_server": "server/", - "path_in": "server/in", - "path_out": "server/out", - "path_worldstate": "server/worldstate", + "path_server": "server_run/", + "path_in": "server_run/in", + "path_out": "server_run/out", + "path_worldstate": "server_run/worldstate", "tmp_suffix": "_tmp", "kicked_by_rival": False, "worldstate_updateable": False diff --git a/start_server_client_union.sh b/start_server_client_union.sh index 676e674..f6c194f 100755 --- a/start_server_client_union.sh +++ b/start_server_client_union.sh @@ -39,12 +39,12 @@ kill -0 $! 2> /dev/null # Give server some time (max. 10 seconds) to generate its worldstate file. i=0 -while [ ! -e server/worldstate ] && [ $i -le 1000 ] +while [ ! -e server_run/worldstate ] && [ $i -le 1000 ] do sleep 0.01 i=`expr $i + 1` done -if [ ! -e server/worldstate ] +if [ ! -e server_run/worldstate ] then echo "Server failed generating worldstate file within given time limit." false