allow event and ep3 menu song to be specified in config.json
This commit is contained in:
+14
@@ -20,6 +20,7 @@
|
|||||||
#include "Server.hh"
|
#include "Server.hh"
|
||||||
#include "ServerShell.hh"
|
#include "ServerShell.hh"
|
||||||
#include "ServerState.hh"
|
#include "ServerState.hh"
|
||||||
|
#include "StaticGameData.hh"
|
||||||
#include "Text.hh"
|
#include "Text.hh"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
@@ -160,6 +161,19 @@ void populate_state_from_config(shared_ptr<ServerState> s,
|
|||||||
ServerState::RunShellBehavior::ALWAYS :
|
ServerState::RunShellBehavior::ALWAYS :
|
||||||
ServerState::RunShellBehavior::NEVER;
|
ServerState::RunShellBehavior::NEVER;
|
||||||
} catch (const out_of_range&) { }
|
} catch (const out_of_range&) { }
|
||||||
|
|
||||||
|
try {
|
||||||
|
auto v = d.at("LobbyEvent");
|
||||||
|
uint8_t event = v->is_int() ? v->as_int() : event_for_name(v->as_string());
|
||||||
|
s->pre_lobby_event = event;
|
||||||
|
for (const auto& l : s->all_lobbies()) {
|
||||||
|
l->event = event;
|
||||||
|
}
|
||||||
|
} catch (const out_of_range&) { }
|
||||||
|
|
||||||
|
try {
|
||||||
|
s->ep3_menu_song = d.at("Episode3MenuSong")->as_int();
|
||||||
|
} catch (const out_of_range&) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -186,6 +186,18 @@
|
|||||||
// BB users.
|
// BB users.
|
||||||
"WelcomeMessage": "",
|
"WelcomeMessage": "",
|
||||||
|
|
||||||
|
// Default lobby event. If set, this sets the holiday event in all lobbies at
|
||||||
|
// server start time, as well as the pre-lobby holiday event. The event can be
|
||||||
|
// changed in each lobby independently with the $event command, or in all
|
||||||
|
// lobbies with the $allevent command. When a game is created, it inherits the
|
||||||
|
// holiday event from the lobby from which it was created.
|
||||||
|
// The value for this field can be a string like "xmas" (the values have the
|
||||||
|
// same meanings as the $event command), or an integer.
|
||||||
|
// "LobbyEvent": "xmas",
|
||||||
|
// Episode 3 menu song. If set, Episode 3 clients will hear this song when
|
||||||
|
// they are at the newserv main menu. If set, this value must be an integer.
|
||||||
|
// "Episode3MenuSong": 0,
|
||||||
|
|
||||||
// By default, the server keeps track of items in all games, even for versions
|
// By default, the server keeps track of items in all games, even for versions
|
||||||
// other than Blue Burst. This enables use of the $what command, as well as
|
// other than Blue Burst. This enables use of the $what command, as well as
|
||||||
// protection against item duplication cheats (the cheater is disconnected
|
// protection against item duplication cheats (the cheater is disconnected
|
||||||
|
|||||||
Reference in New Issue
Block a user