diff options
| author | Alexander <alex@cogarr.net> | 2019-02-10 18:16:04 -0500 |
|---|---|---|
| committer | Alexander <alex@cogarr.net> | 2019-02-10 18:16:04 -0500 |
| commit | 83a85531ae789e2f30da2379990899f815f53ff1 (patch) | |
| tree | 81140ea86f6e3d7808b218597874ea927555ef0d /src/server/lua_api/load_game.cpp | |
| parent | 1482e03dd238643ff47278e207e6450f14011acf (diff) | |
| download | brokengine-83a85531ae789e2f30da2379990899f815f53ff1.tar.gz brokengine-83a85531ae789e2f30da2379990899f815f53ff1.tar.bz2 brokengine-83a85531ae789e2f30da2379990899f815f53ff1.zip | |
Added new element, added server-specific code for networking
Added a new element for client gui: iguicombobox
Added a part of the engine specifically for the server
so server is no longer just a stripped down client
Diffstat (limited to 'src/server/lua_api/load_game.cpp')
| -rw-r--r-- | src/server/lua_api/load_game.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/server/lua_api/load_game.cpp b/src/server/lua_api/load_game.cpp new file mode 100644 index 0000000..4464dd7 --- /dev/null +++ b/src/server/lua_api/load_game.cpp @@ -0,0 +1,27 @@ +#include <stdio.h> +#include <stdlib.h> +#include <vector> +#include <map> +extern "C" { + #include <lua.h> + #include <lauxlib.h> + #include <lualib.h> +} + +extern bool game_active; + +//exit() +int exit_game(lua_State *L){ + game_active = false; + return 0; +} + +void load_gamefuncs(lua_State* L){ + lua_newtable(L); + lua_setglobal(L,"GAME"); + + lua_getglobal(L,"GAME"); + lua_pushcfunction(L,exit_game); + lua_setfield(L,-2,"exit"); + lua_pop(L,1); +} |
