From 60a826f0cd7d346b2ad4a555161384d9a90fb8a5 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 3 Jul 2017 20:55:22 +0300 Subject: [PATCH] Separate help commands for server and client --- .../BarotraumaClient/Source/DebugConsole.cs | 51 +++++++++++++++++++ .../BarotraumaServer/Source/DebugConsole.cs | 47 ++++++++++++++++- .../BarotraumaShared/Source/DebugConsole.cs | 51 ------------------- 3 files changed, 97 insertions(+), 52 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs index 11e2858c6..5e47612f0 100644 --- a/Barotrauma/BarotraumaClient/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaClient/Source/DebugConsole.cs @@ -198,6 +198,57 @@ namespace Barotrauma { switch (commands[0].ToLowerInvariant()) { + case "help": + NewMessage("menu: go to main menu", Color.Cyan); + NewMessage("game: enter the \"game screen\"", Color.Cyan); + NewMessage("edit: switch to submarine editor", Color.Cyan); + NewMessage("edit [submarine name]: load a submarine and switch to submarine editor", Color.Cyan); + NewMessage("load [submarine name]: load a submarine", Color.Cyan); + NewMessage("save [submarine name]: save the current submarine using the specified name", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("spawn [creaturename] [near/inside/outside]: spawn a creature at a random spawnpoint (use the second parameter to only select spawnpoints near/inside/outside the submarine)", Color.Cyan); + NewMessage("spawnitem [itemname] [cursor/inventory]: spawn an item at the position of the cursor, in the inventory of the controlled character or at a random spawnpoint if the last parameter is omitted", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("lights: disable lighting", Color.Cyan); + NewMessage("los: disable the line of sight effect", Color.Cyan); + NewMessage("freecam: detach the camera from the controlled character", Color.Cyan); + NewMessage("control [character name]: start controlling the specified character", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("water: allows adding water into rooms or removing it by holding the left/right mouse buttons", Color.Cyan); + NewMessage("fire: allows putting up fires by left clicking", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("teleport: teleport the controlled character to the position of the cursor", Color.Cyan); + NewMessage("teleport [character name]: teleport the specified character to the position of the cursor", Color.Cyan); + NewMessage("heal: restore the controlled character to full health", Color.Cyan); + NewMessage("heal [character name]: restore the specified character to full health", Color.Cyan); + NewMessage("revive: bring the controlled character back from the dead", Color.Cyan); + NewMessage("revive [character name]: bring the specified character back from the dead", Color.Cyan); + NewMessage("killmonsters: immediately kills all AI-controlled enemies in the level", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("fixwalls: fixes all the walls", Color.Cyan); + NewMessage("fixitems: fixes every item/device in the sub", Color.Cyan); + NewMessage("oxygen: replenishes the oxygen in every room to 100%", Color.Cyan); + NewMessage("power [amount]: immediately sets the temperature of the reactor to the specified value", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("kick [name]: kick a player out from the server", Color.Cyan); + NewMessage("ban [name]: kick and ban the player from the server", Color.Cyan); + NewMessage("banip [IP address]: ban the IP address from the server", Color.Cyan); + NewMessage("debugdraw: toggles the \"debug draw mode\"", Color.Cyan); + NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan); + + break; case "startclient": if (commands.Length == 1) return true; if (GameMain.Client == null) diff --git a/Barotrauma/BarotraumaServer/Source/DebugConsole.cs b/Barotrauma/BarotraumaServer/Source/DebugConsole.cs index 902a012af..f6b68b517 100644 --- a/Barotrauma/BarotraumaServer/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaServer/Source/DebugConsole.cs @@ -26,6 +26,51 @@ namespace Barotrauma { switch (commands[0].ToLower()) { + case "help": + + NewMessage("start: start a new round", Color.Cyan); + NewMessage("end: end the current round", Color.Cyan); + NewMessage("restart: restart the server", Color.Cyan); + NewMessage("quit: exit the game", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("say [chat message]: send a chat message", Color.Cyan); + NewMessage("clientlist: list the names and IPs of the connected clients", Color.Cyan); + NewMessage("kick [name]: kick a player out from the server", Color.Cyan); + NewMessage("ban [name]: kick and ban the player from the server", Color.Cyan); + NewMessage("banip [IP address]: ban the IP address from the server", Color.Cyan); + NewMessage("debugdraw: toggles the \"debug draw mode\"", Color.Cyan); + NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("servername [name]: change the name of the server", Color.Cyan); + NewMessage("servermsg [message]: change the message in the server lobby", Color.Cyan); + NewMessage("seed [seed]: changes the level seed for the next round", Color.Cyan); + NewMessage("gamemode [name]: select the specified game mode for the next round", Color.Cyan); + NewMessage("gamemode [index]: select the specified game mode (0 = sandbox, 1 = mission, etc)", Color.Cyan); + NewMessage("submarine [name]: select the specified game mode for the next round", Color.Cyan); + NewMessage("shuttle [name]: select the specified submarine as the respawn shuttle for the next round", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("spawn [creaturename] [near/inside/outside]: spawn a creature at a random spawnpoint (use the second parameter to only select spawnpoints near/inside/outside the submarine)", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("heal [character name]: restore the specified character to full health", Color.Cyan); + NewMessage("revive [character name]: bring the specified character back from the dead", Color.Cyan); + NewMessage("killmonsters: immediately kills all AI-controlled enemies in the level", Color.Cyan); + + NewMessage(" ", Color.Cyan); + + NewMessage("fixwalls: fixes all the walls", Color.Cyan); + NewMessage("fixitems: fixes every item/device in the sub", Color.Cyan); + NewMessage("oxygen: replenishes the oxygen in every room to 100%", Color.Cyan); + NewMessage("power [amount]: immediately sets the temperature of the reactor to the specified value", Color.Cyan); + + break; case "restart": case "reset": NewMessage("*****************", Color.Lime); @@ -112,7 +157,7 @@ namespace Barotrauma case "startround": case "start": if (Screen.Selected == GameMain.GameScreen) break; - if (!GameMain.Server.StartGame()) NewMessage("Failed to start server",Color.Yellow); + if (!GameMain.Server.StartGame()) NewMessage("Failed to start a new round", Color.Yellow); break; case "endgame": case "endround": diff --git a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs index 105cc6482..37171a526 100644 --- a/Barotrauma/BarotraumaShared/Source/DebugConsole.cs +++ b/Barotrauma/BarotraumaShared/Source/DebugConsole.cs @@ -116,57 +116,6 @@ namespace Barotrauma NewMessage("- " + c.ID.ToString() + ": " + c.name + ", " + c.Connection.RemoteEndPoint.Address.ToString(), Color.Cyan); } NewMessage("***************", Color.Cyan); - break; - case "help": - NewMessage("menu: go to main menu", Color.Cyan); - NewMessage("game: enter the \"game screen\"", Color.Cyan); - NewMessage("edit: switch to submarine editor", Color.Cyan); - NewMessage("edit [submarine name]: load a submarine and switch to submarine editor", Color.Cyan); - NewMessage("load [submarine name]: load a submarine", Color.Cyan); - NewMessage("save [submarine name]: save the current submarine using the specified name", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("spawn [creaturename] [near/inside/outside]: spawn a creature at a random spawnpoint (use the second parameter to only select spawnpoints near/inside/outside the submarine)", Color.Cyan); - NewMessage("spawnitem [itemname] [cursor/inventory]: spawn an item at the position of the cursor, in the inventory of the controlled character or at a random spawnpoint if the last parameter is omitted", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("lights: disable lighting", Color.Cyan); - NewMessage("los: disable the line of sight effect", Color.Cyan); - NewMessage("freecam: detach the camera from the controlled character", Color.Cyan); - NewMessage("control [character name]: start controlling the specified character", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("water: allows adding water into rooms or removing it by holding the left/right mouse buttons", Color.Cyan); - NewMessage("fire: allows putting up fires by left clicking", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("teleport: teleport the controlled character to the position of the cursor", Color.Cyan); - NewMessage("teleport [character name]: teleport the specified character to the position of the cursor", Color.Cyan); - NewMessage("heal: restore the controlled character to full health", Color.Cyan); - NewMessage("heal [character name]: restore the specified character to full health", Color.Cyan); - NewMessage("revive: bring the controlled character back from the dead", Color.Cyan); - NewMessage("revive [character name]: bring the specified character back from the dead", Color.Cyan); - NewMessage("killmonsters: immediately kills all AI-controlled enemies in the level", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("fixwalls: fixes all the walls", Color.Cyan); - NewMessage("fixitems: fixes every item/device in the sub", Color.Cyan); - NewMessage("oxygen: replenishes the oxygen in every room to 100%", Color.Cyan); - NewMessage("power [amount]: immediately sets the temperature of the reactor to the specified value", Color.Cyan); - - NewMessage(" ", Color.Cyan); - - NewMessage("kick [name]: kick a player out from the server", Color.Cyan); - NewMessage("ban [name]: kick and ban the player from the server", Color.Cyan); - NewMessage("banip [IP address]: ban the IP address from the server", Color.Cyan); - NewMessage("debugdraw: toggles the \"debug draw mode\"", Color.Cyan); - NewMessage("netstats: toggles the visibility of the network statistics panel", Color.Cyan); - break; case "createfilelist": UpdaterUtil.SaveFileList("filelist.xml");