| 129 | } |
| 130 | |
| 131 | void DebugConsole::HandleCommand(std::string const& cmd) |
| 132 | { |
| 133 | if (cmd.empty()) { |
| 134 | } else if (cmd == "server") { |
| 135 | DEBUG("Switching to server context."); |
| 136 | serverContext_ = true; |
| 137 | } else if (cmd == "client") { |
| 138 | DEBUG("Switching to client context."); |
| 139 | serverContext_ = false; |
| 140 | #if defined(_DEBUG) |
| 141 | } else if (cmd == "debugbreak") { |
| 142 | gCoreLibPlatformInterface.EnableDebugBreak = !gCoreLibPlatformInterface.EnableDebugBreak; |
| 143 | if (gCoreLibPlatformInterface.EnableDebugBreak) { |
| 144 | DEBUG("Debug breaks ON"); |
| 145 | } else { |
| 146 | DEBUG("Debug breaks OFF"); |
| 147 | } |
| 148 | #endif |
| 149 | } else if (cmd == "reset") { |
| 150 | ResetLua(); |
| 151 | } else if (cmd == "reset server") { |
| 152 | ResetLuaServer(); |
| 153 | } else if (cmd == "reset client") { |
| 154 | ResetLuaClient(); |
| 155 | } else if (cmd == "silence on") { |
| 156 | DEBUG("Silent mode ON"); |
| 157 | silence_ = true; |
| 158 | } else if (cmd == "silence off") { |
| 159 | DEBUG("Silent mode OFF"); |
| 160 | silence_ = false; |
| 161 | } else if (cmd == "clear") { |
| 162 | Clear(); |
| 163 | } else if (cmd == "help") { |
| 164 | PrintHelp(); |
| 165 | } else { |
| 166 | ExecLuaCommand(cmd); |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | void DebugConsole::Print(DebugMessageType type, char const* msg) |
| 171 | { |