exits application * Terminates the game application and reports the specified code to the OS. * * @name sys.exit * @param code [type:number] exit code to report to the OS, 0 means clean exit * @examples * * This examples demonstrates how to exit the application when some kind of quit messages is received (maybe from gui or similar): * * ```lua *
| 1240 | * ``` |
| 1241 | */ |
| 1242 | static int Sys_Exit(lua_State* L) |
| 1243 | { |
| 1244 | DM_LUA_STACK_CHECK(L, 0); |
| 1245 | |
| 1246 | dmSystemDDF::Exit msg; |
| 1247 | msg.m_Code = luaL_checkinteger(L, 1); |
| 1248 | |
| 1249 | dmMessage::URL url; |
| 1250 | GetSystemURL(&url); |
| 1251 | |
| 1252 | dmMessage::Result result = dmMessage::Post(0, &url, dmSystemDDF::Exit::m_DDFDescriptor->m_NameHash, 0, (uintptr_t) dmSystemDDF::Exit::m_DDFDescriptor, &msg, sizeof(msg), 0); |
| 1253 | assert(result == dmMessage::RESULT_OK); |
| 1254 | |
| 1255 | return 0; |
| 1256 | } |
| 1257 | |
| 1258 | /*# reboot engine with arguments |
| 1259 | * Reboots the game engine with a specified set of arguments. |
nothing calls this directly
no test coverage detected