mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-22 23:26:34 +00:00
(svn r2318) - Feature: added console command 'part' to leave a currently running game and 'join' which is an alias to 'connect' to join a multiplayer server.
This commit is contained in:
parent
0ddf93956e
commit
5501f25084
@ -843,6 +843,19 @@ DEF_CONSOLE_CMD(ConExit)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEF_CONSOLE_CMD(ConPart)
|
||||||
|
{
|
||||||
|
if (argc == 0) {
|
||||||
|
IConsoleHelp("Leave the currently joined/running game (only ingame). Usage: 'part'");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_game_mode != GM_NORMAL) return false;
|
||||||
|
|
||||||
|
_switch_mode = SM_MENU;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
DEF_CONSOLE_CMD(ConHelp)
|
DEF_CONSOLE_CMD(ConHelp)
|
||||||
{
|
{
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
@ -1184,6 +1197,7 @@ void IConsoleStdLibRegister(void)
|
|||||||
IConsoleCmdRegister("echoc", ConEchoC);
|
IConsoleCmdRegister("echoc", ConEchoC);
|
||||||
IConsoleCmdRegister("exec", ConExec);
|
IConsoleCmdRegister("exec", ConExec);
|
||||||
IConsoleCmdRegister("exit", ConExit);
|
IConsoleCmdRegister("exit", ConExit);
|
||||||
|
IConsoleCmdRegister("part", ConPart);
|
||||||
IConsoleCmdRegister("help", ConHelp);
|
IConsoleCmdRegister("help", ConHelp);
|
||||||
IConsoleCmdRegister("info_cmd", ConInfoCmd);
|
IConsoleCmdRegister("info_cmd", ConInfoCmd);
|
||||||
IConsoleCmdRegister("info_var", ConInfoVar);
|
IConsoleCmdRegister("info_var", ConInfoVar);
|
||||||
@ -1227,6 +1241,7 @@ void IConsoleStdLibRegister(void)
|
|||||||
IConsoleCmdHookAdd("reset_company", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
IConsoleCmdHookAdd("reset_company", ICONSOLE_HOOK_ACCESS, ConHookServerOnly);
|
||||||
IConsoleAliasRegister("clean_company", "reset_company %A");
|
IConsoleAliasRegister("clean_company", "reset_company %A");
|
||||||
IConsoleCmdRegister("connect", ConNetworkConnect);
|
IConsoleCmdRegister("connect", ConNetworkConnect);
|
||||||
|
IConsoleAliasRegister("join", "connect %A");
|
||||||
IConsoleCmdHookAdd("connect", ICONSOLE_HOOK_ACCESS, ConHookClientOnly);
|
IConsoleCmdHookAdd("connect", ICONSOLE_HOOK_ACCESS, ConHookClientOnly);
|
||||||
IConsoleCmdRegister("clients", ConNetworkClients);
|
IConsoleCmdRegister("clients", ConNetworkClients);
|
||||||
IConsoleCmdHookAdd("clients", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
IConsoleCmdHookAdd("clients", ICONSOLE_HOOK_ACCESS, ConHookNeedNetwork);
|
||||||
|
Loading…
Reference in New Issue
Block a user