add set-ep3-menu-song

This commit is contained in:
Martin Michelsen
2022-03-08 16:45:07 -08:00
parent b8ab8551b6
commit 1b663aed58
4 changed files with 17 additions and 2 deletions
+4
View File
@@ -371,6 +371,10 @@ void process_login_d_e_pc_gc(shared_ptr<ServerState> s, shared_ptr<Client> c,
c->bb_player_index = 0;
}
if ((c->flags & ClientFlag::Episode3Games) && (s->ep3_menu_song >= 0)) {
send_ep3_change_music(c, s->ep3_menu_song);
}
send_update_client_config(c);
process_login_complete(s, c);
+10 -1
View File
@@ -57,7 +57,13 @@ Commands:\n\
Enable or disable allowing unregistered users on the server. Disabling this\n\
does not disconnect unregistered users who are already connected.\n\
set-event <event>\n\
Set the event in all lobbies.\n\
Set the event in all lobbies, and in the main menu before joining a lobby.\n\
<event> can be none, xmas, val, easter, hallo, sonic, newyear, summer,\n\
white, wedding, fall, s-spring, s-summer, or spring.\n\
set-ep3-menu-song <song-num>\n\
Set the song that plays in the main menu for Episode III clients. If an\n\
event is also set, the event's visuals appear but this song still plays.\n\
Song IDs are 0 through 51; the default song is -1.\n\
announce <message>\n\
Send an announcement message to all players.\n\
");
@@ -176,6 +182,9 @@ Commands:\n\
}
send_change_event(this->state, event_id);
} else if (command_name == "set-ep3-menu-song") {
this->state->ep3_menu_song = stoul(command_args, nullptr, 0);
} else if (command_name == "announce") {
u16string message16 = decode_sjis(command_args);
send_text_message(this->state, message16.c_str());
+2 -1
View File
@@ -18,7 +18,8 @@ ServerState::ServerState()
ip_stack_debug(false),
allow_unregistered_users(false),
run_shell_behavior(RunShellBehavior::Default), next_lobby_id(1),
pre_lobby_event(0) {
pre_lobby_event(0),
ep3_menu_song(-1) {
memset(&this->default_key_file, 0, sizeof(this->default_key_file));
this->main_menu.emplace_back(MAIN_MENU_GO_TO_LOBBY, u"Go to lobby",
+1
View File
@@ -56,6 +56,7 @@ struct ServerState {
std::map<int64_t, std::shared_ptr<Lobby>> id_to_lobby;
std::atomic<int32_t> next_lobby_id;
uint8_t pre_lobby_event;
int32_t ep3_menu_song;
std::map<std::string, uint32_t> all_addresses;
uint32_t local_address;