move patch server message to config file
This commit is contained in:
+6
-17
@@ -2372,7 +2372,7 @@ void process_encryption_ok_patch(shared_ptr<ServerState>, shared_ptr<Client> c,
|
||||
send_command(c, 0x04, 0x00); // This requests the user's login information
|
||||
}
|
||||
|
||||
void process_login_patch(shared_ptr<ServerState>, shared_ptr<Client> c,
|
||||
void process_login_patch(shared_ptr<ServerState> s, shared_ptr<Client> c,
|
||||
uint16_t, uint32_t, const string& data) {
|
||||
const auto& cmd = check_size_t<C_Login_Patch_04>(data);
|
||||
|
||||
@@ -2382,24 +2382,13 @@ void process_login_patch(shared_ptr<ServerState>, shared_ptr<Client> c,
|
||||
|
||||
// On BB we can use colors and newlines should be \n; on PC we can't use
|
||||
// colors, the text is auto-word-wrapped, and newlines should be \r\n.
|
||||
u16string message;
|
||||
if (c->flags & Client::Flag::BB_PATCH) {
|
||||
message = u"\
|
||||
$C7newserv patch server\n\
|
||||
\n\
|
||||
This server is not affiliated with, sponsored by, or in any\n\
|
||||
other way connected to SEGA or Sonic Team, and is owned\n\
|
||||
and operated completely independently.";
|
||||
} else {
|
||||
message = u"\
|
||||
newserv patch server\r\n\
|
||||
\r\n\
|
||||
This server is not affiliated with, sponsored by, or in any other way \
|
||||
connected to SEGA or Sonic Team, and is owned and operated completely \
|
||||
independently.";
|
||||
const u16string& message = (c->flags & Client::Flag::BB_PATCH)
|
||||
? s->bb_patch_server_message : s->pc_patch_server_message;
|
||||
if (!message.empty()) {
|
||||
send_message_box(c, message.c_str());
|
||||
}
|
||||
|
||||
send_message_box(c, message.c_str());
|
||||
// TODO: Implement patch serving for realz.
|
||||
send_enter_directory_patch(c, ".");
|
||||
send_enter_directory_patch(c, "data");
|
||||
send_enter_directory_patch(c, "scene");
|
||||
|
||||
@@ -389,4 +389,10 @@ void ServerState::create_menus(shared_ptr<const JSONObject> config_json) {
|
||||
try {
|
||||
this->welcome_message = decode_sjis(d.at("WelcomeMessage")->as_string());
|
||||
} catch (const out_of_range&) { }
|
||||
try {
|
||||
this->pc_patch_server_message = decode_sjis(d.at("PCPatchServerMessage")->as_string());
|
||||
} catch (const out_of_range&) { }
|
||||
try {
|
||||
this->bb_patch_server_message = decode_sjis(d.at("BBPatchServerMessage")->as_string());
|
||||
} catch (const out_of_range&) { }
|
||||
}
|
||||
|
||||
+3
-1
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
|
||||
// Forwawrd declarations due to reference cycles
|
||||
// Forward declarations due to reference cycles
|
||||
class ProxyServer;
|
||||
class Server;
|
||||
|
||||
@@ -73,6 +73,8 @@ struct ServerState {
|
||||
std::pair<std::string, uint16_t> proxy_destination_patch;
|
||||
std::pair<std::string, uint16_t> proxy_destination_bb;
|
||||
std::u16string welcome_message;
|
||||
std::u16string pc_patch_server_message;
|
||||
std::u16string bb_patch_server_message;
|
||||
|
||||
std::map<int64_t, std::shared_ptr<Lobby>> id_to_lobby;
|
||||
std::vector<std::shared_ptr<Lobby>> public_lobby_search_order;
|
||||
|
||||
@@ -189,9 +189,18 @@
|
||||
// Welcome message. If not blank, this message will be shown to PSO GC users
|
||||
// upon first connecting. (If this is blank, they will be taken directly to
|
||||
// the main menu instead.) The welcome message is never shown to PSO PC or PSO
|
||||
// BB users.
|
||||
// BB users, though the patch server message (below) can be used for a similar
|
||||
// purpose.
|
||||
"WelcomeMessage": "",
|
||||
|
||||
// Patch server message. If not blank, these messages will be shown to PSO PC
|
||||
// and PSO BB users (respectively) when they connect to the patch server. Note
|
||||
// that PSO PC displays the text in a Windows edit control instead of using
|
||||
// PSO's normal text renderer, so linebreaks must be \r\n and color escapes
|
||||
// (e.g. $C6) do not work in PCPatchServerMessage.
|
||||
"PCPatchServerMessage": "$C7newserv patch server\n\nThis server is not affiliated with, sponsored by, or in any\nother way connected to SEGA or Sonic Team, and is owned\nand operated completely independently.",
|
||||
"BBPatchServerMessage": "newserv patch server\r\n\r\nThis server is not affiliated with, sponsored by, or in any other way connected to SEGA or Sonic Team, and is owned and operated completely independently.",
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user