diff --git a/rsc/scripts/map_saver.lua b/rsc/scripts/map_saver.lua index 0d7431f..7454081 100644 --- a/rsc/scripts/map_saver.lua +++ b/rsc/scripts/map_saver.lua @@ -1,9 +1,11 @@ local mapSaver = {} function mapSaver.Load(region) --empty + print("map_saver.lua:mapSaver.Load(region)") end function mapSaver.Save(region) --empty + print("map_saver.lua:mapSaver.Save(region)") end --TODO: create a flexible saving & loading system return mapSaver \ No newline at end of file diff --git a/rsc/scripts/setup_server.lua b/rsc/scripts/setup_server.lua index 7ac5afc..d39656f 100644 --- a/rsc/scripts/setup_server.lua +++ b/rsc/scripts/setup_server.lua @@ -4,27 +4,6 @@ mapMaker = require "map_maker" mapSaver = require "map_saver" roomSystem = require "room_system" -local function dumpTable(t) - print(t) - for k, v in pairs(t) do - print("",k, v) - end -end - ---create the overworld, set it's generator, loader & saver ---[[ -local t = { - "overworld.bmp", --tileset name - mapSaver.load, --load function - mapSaver.save, --save function - mapMaker.debugIsland, --create function - mapSaver.save --unload function -}]] - -dumpTable(roomSystem) -dumpTable(roomSystem.RoomManager) -dumpTable(roomSystem.Room) - --NOTE: room 0 is the first that the client asks for, therefore it must exist local overworld, uid = roomSystem.RoomManager.CreateRoom("overworld") roomSystem.Room.Initialize(overworld, "overworld.bmp", mapSaver.Load, mapSaver.Save, mapMaker.debugIsland, mapSaver.Save) diff --git a/server/characters/character_api.cpp b/server/characters/character_api.cpp new file mode 100644 index 0000000..bf8b6f0 --- /dev/null +++ b/server/characters/character_api.cpp @@ -0,0 +1,33 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "character_api.hpp" + +#include "character_data.hpp" + +static const luaL_Reg characterLib[] = { + {nullptr, nullptr} +}; + +LUAMOD_API int openCharacterAPI(lua_State* L) { + luaL_newlib(L, characterLib); + return 1; +} \ No newline at end of file diff --git a/server/characters/character_api.hpp b/server/characters/character_api.hpp new file mode 100644 index 0000000..5ceda91 --- /dev/null +++ b/server/characters/character_api.hpp @@ -0,0 +1,34 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef CHARACTERAPI_HPP_ +#define CHARACTERAPI_HPP_ + +#if defined(__MINGW32__) + #include "lua/lua.hpp" +#else + #include "lua.hpp" +#endif + +#define TORTUGA_CHARACTER_API "character" +LUAMOD_API int openCharacterAPI(lua_State* L); + +#endif \ No newline at end of file diff --git a/server/characters/character_manager_api.cpp b/server/characters/character_manager_api.cpp new file mode 100644 index 0000000..b249ba9 --- /dev/null +++ b/server/characters/character_manager_api.cpp @@ -0,0 +1,33 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "character_manager_api.hpp" + +#include "character_manager.hpp" + +static const luaL_Reg characterManagerLib[] = { + {nullptr, nullptr} +}; + +LUAMOD_API int openCharacterManagerAPI(lua_State* L) { + luaL_newlib(L, characterManagerLib); + return 1; +} \ No newline at end of file diff --git a/server/characters/character_manager_api.hpp b/server/characters/character_manager_api.hpp new file mode 100644 index 0000000..f4e52ed --- /dev/null +++ b/server/characters/character_manager_api.hpp @@ -0,0 +1,34 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef CHARACTERMANAGERAPI_HPP_ +#define CHARACTERMANAGERAPI_HPP_ + +#if defined(__MINGW32__) + #include "lua/lua.hpp" +#else + #include "lua.hpp" +#endif + +#define TORTUGA_CHARACTER_MANAGER_API "character_manager" +LUAMOD_API int openCharacterManagerAPI(lua_State* L); + +#endif \ No newline at end of file diff --git a/server/entities/entity_api.cpp b/server/entities/entity_api.cpp new file mode 100644 index 0000000..84c1a63 --- /dev/null +++ b/server/entities/entity_api.cpp @@ -0,0 +1,33 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "entity_api.hpp" + +#include "entity.hpp" + +static const luaL_Reg entityLib[] = { + {nullptr, nullptr} +}; + +LUAMOD_API int openEntityAPI(lua_State* L) { + luaL_newlib(L, entityLib); + return 1; +} \ No newline at end of file diff --git a/server/entities/entity_api.hpp b/server/entities/entity_api.hpp new file mode 100644 index 0000000..1e20cff --- /dev/null +++ b/server/entities/entity_api.hpp @@ -0,0 +1,34 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef ENTITYAPI_HPP_ +#define ENTITYAPI_HPP_ + +#if defined(__MINGW32__) + #include "lua/lua.hpp" +#else + #include "lua.hpp" +#endif + +#define TORTUGA_ENTITY_API "entity" +LUAMOD_API int openEntityAPI(lua_State* L); + +#endif \ No newline at end of file diff --git a/server/monsters/monster_api.cpp b/server/monsters/monster_api.cpp new file mode 100644 index 0000000..3baec56 --- /dev/null +++ b/server/monsters/monster_api.cpp @@ -0,0 +1,33 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "monster_api.hpp" + +#include "monster_data.hpp" + +static const luaL_Reg monsterLib[] = { + {nullptr, nullptr} +}; + +LUAMOD_API int openMonsterAPI(lua_State* L) { + luaL_newlib(L, monsterLib); + return 1; +} \ No newline at end of file diff --git a/server/monsters/monster_api.hpp b/server/monsters/monster_api.hpp new file mode 100644 index 0000000..d0c52ef --- /dev/null +++ b/server/monsters/monster_api.hpp @@ -0,0 +1,34 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef MONSTERAPI_HPP_ +#define MONSTERAPI_HPP_ + +#if defined(__MINGW32__) + #include "lua/lua.hpp" +#else + #include "lua.hpp" +#endif + +#define TORTUGA_MONSTER_API "monster" +LUAMOD_API int openMonsterAPI(lua_State* L); + +#endif \ No newline at end of file diff --git a/server/monsters/monster_manager_api.cpp b/server/monsters/monster_manager_api.cpp new file mode 100644 index 0000000..6fc6a81 --- /dev/null +++ b/server/monsters/monster_manager_api.cpp @@ -0,0 +1,33 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#include "monster_manager_api.hpp" + +#include "monster_manager.hpp" + +static const luaL_Reg monsterManagerLib[] = { + {nullptr, nullptr} +}; + +LUAMOD_API int openMonsterManagerAPI(lua_State* L) { + luaL_newlib(L, monsterManagerLib); + return 1; +} \ No newline at end of file diff --git a/server/monsters/monster_manager_api.hpp b/server/monsters/monster_manager_api.hpp new file mode 100644 index 0000000..d9eac7e --- /dev/null +++ b/server/monsters/monster_manager_api.hpp @@ -0,0 +1,34 @@ +/* Copyright: (c) Kayne Ruse 2013-2015 + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source + * distribution. +*/ +#ifndef MONSTERMANAGERAPI_HPP_ +#define MONSTERMANAGERAPI_HPP_ + +#if defined(__MINGW32__) + #include "lua/lua.hpp" +#else + #include "lua.hpp" +#endif + +#define TORTUGA_MONSTER_MANAGER_API "monster_manager" +LUAMOD_API int openMonsterManagerAPI(lua_State* L); + +#endif \ No newline at end of file