add $sc and $ss commands
This commit is contained in:
@@ -219,10 +219,12 @@ Some commands only work on the game server and not on the proxy server. The chat
|
||||
* `$li`: Shows basic information about the lobby or game you're in. If you're on the proxy server, shows information about your connection instead (remote Guild Card number, client ID, etc.).
|
||||
* `$what` (game server only): Shows the type, name, and stats of the nearest item on the ground.
|
||||
|
||||
* Debugging commands (game server only)
|
||||
* `$dbgid`: Enable or disable high ID preference. When enabled, you'll be placed into the latest available slot in lobbies and games instead of the earliest. Can be useful for finding commands for which newserv doesn't handle client IDs properly.
|
||||
* `$gc`: Send your own Guild Card to yourself.
|
||||
* `$persist`: Enable or disable persistence for the current lobby or game. This determines whether the lobby/game is deleted when the last player leaves. You need the DEBUG permission in your user license to use this command because there are no game state checks when you do this. For example, if you make a game persistent, start a quest, then leave the game, the game can't be joined by anyone but also can't be deleted.
|
||||
* Debugging commands
|
||||
* `$dbgid` (game server only): Enable or disable high ID preference. When enabled, you'll be placed into the latest available slot in lobbies and games instead of the earliest. Can be useful for finding commands for which newserv doesn't handle client IDs properly.
|
||||
* `$gc` (game server only): Send your own Guild Card to yourself.
|
||||
* `$persist` (game server only): Enable or disable persistence for the current lobby or game. This determines whether the lobby/game is deleted when the last player leaves. You need the DEBUG permission in your user license to use this command because there are no game state checks when you do this. For example, if you make a game persistent, start a quest, then leave the game, the game can't be joined by anyone but also can't be deleted.
|
||||
* `$sc <data>`: Send a command to yourself.
|
||||
* `$ss <data>` (proxy server only): Send a command to the remote server.
|
||||
|
||||
* Personal state commands
|
||||
* `$arrow <color-id>`: Changes your lobby arrow color.
|
||||
|
||||
@@ -334,6 +334,24 @@ static void proxy_command_get_player_card(shared_ptr<ServerState>,
|
||||
}
|
||||
}
|
||||
|
||||
static void server_command_send_client(shared_ptr<ServerState>, shared_ptr<Lobby>,
|
||||
shared_ptr<Client> c, const std::u16string& args) {
|
||||
string data = parse_data_string(encode_sjis(args));
|
||||
c->channel.send(data);
|
||||
}
|
||||
|
||||
static void proxy_command_send_client(shared_ptr<ServerState>,
|
||||
ProxyServer::LinkedSession& session, const std::u16string& args) {
|
||||
string data = parse_data_string(encode_sjis(args));
|
||||
session.client_channel.send(data);
|
||||
}
|
||||
|
||||
static void proxy_command_send_server(shared_ptr<ServerState>,
|
||||
ProxyServer::LinkedSession& session, const std::u16string& args) {
|
||||
string data = parse_data_string(encode_sjis(args));
|
||||
session.server_channel.send(data);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Lobby commands
|
||||
|
||||
@@ -1153,11 +1171,13 @@ static const unordered_map<u16string, ChatCommandDefinition> chat_commands({
|
||||
{u"$playrec", {server_command_playrec, nullptr, u"Usage:\nplayrec <filename>"}},
|
||||
{u"$rand", {server_command_rand, proxy_command_rand, u"Usage:\nrand [hex seed]\nomit seed to revert\nto default"}},
|
||||
{u"$saverec", {server_command_saverec, nullptr, u"Usage:\nsaverec <filename>"}},
|
||||
{u"$sc", {server_command_send_client, proxy_command_send_client, u"Usage:\nsc <data>"}},
|
||||
{u"$secid", {server_command_secid, proxy_command_secid, u"Usage:\nsecid [section ID]\nomit section ID to\nrevert to normal"}},
|
||||
{u"$silence", {server_command_silence, nullptr, u"Usage:\nsilence <name-or-number>"}},
|
||||
// TODO: implement this on proxy server
|
||||
{u"$song", {server_command_song, nullptr, u"Usage:\nsong <song-number>"}},
|
||||
{u"$spec", {server_command_spec, nullptr, u"Usage:\nspec"}},
|
||||
{u"$ss", {nullptr, proxy_command_send_server, u"Usage:\nss <data>"}},
|
||||
{u"$swa", {server_command_switch_assist, proxy_command_switch_assist, u"Usage:\nswa"}},
|
||||
{u"$type", {server_command_lobby_type, nullptr, u"Usage:\ntype <name>"}},
|
||||
{u"$warp", {server_command_warp, proxy_command_warp, u"Usage:\nwarp <area-number>"}},
|
||||
|
||||
Reference in New Issue
Block a user