Merge branch 'develop'
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
local mapSaver = {}
|
local mapSaver = {}
|
||||||
function mapSaver.Load(region)
|
function mapSaver.Load(region)
|
||||||
--empty
|
--empty
|
||||||
|
print("map_saver.lua:mapSaver.Load(region)")
|
||||||
end
|
end
|
||||||
function mapSaver.Save(region)
|
function mapSaver.Save(region)
|
||||||
--empty
|
--empty
|
||||||
|
print("map_saver.lua:mapSaver.Save(region)")
|
||||||
end
|
end
|
||||||
--TODO: create a flexible saving & loading system
|
--TODO: create a flexible saving & loading system
|
||||||
return mapSaver
|
return mapSaver
|
||||||
@@ -4,27 +4,6 @@ mapMaker = require "map_maker"
|
|||||||
mapSaver = require "map_saver"
|
mapSaver = require "map_saver"
|
||||||
roomSystem = require "room_system"
|
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
|
--NOTE: room 0 is the first that the client asks for, therefore it must exist
|
||||||
local overworld, uid = roomSystem.RoomManager.CreateRoom("overworld")
|
local overworld, uid = roomSystem.RoomManager.CreateRoom("overworld")
|
||||||
roomSystem.Room.Initialize(overworld, "overworld.bmp", mapSaver.Load, mapSaver.Save, mapMaker.debugIsland, mapSaver.Save)
|
roomSystem.Room.Initialize(overworld, "overworld.bmp", mapSaver.Load, mapSaver.Save, mapMaker.debugIsland, mapSaver.Save)
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -19,31 +19,15 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#ifndef DOORDATA_HPP_
|
#include "entity_api.hpp"
|
||||||
#define DOORDATA_HPP_
|
|
||||||
|
|
||||||
#include "entity.hpp"
|
#include "entity.hpp"
|
||||||
#include "vector2.hpp"
|
|
||||||
|
|
||||||
#include <string>
|
static const luaL_Reg entityLib[] = {
|
||||||
|
{nullptr, nullptr}
|
||||||
class DoorData: public Entity {
|
|
||||||
public:
|
|
||||||
DoorData() = default;
|
|
||||||
~DoorData() = default;
|
|
||||||
|
|
||||||
//accessors & mutators
|
|
||||||
std::string SetRoomName(std::string);
|
|
||||||
Vector2 SetDestPosition(Vector2);
|
|
||||||
|
|
||||||
std::string GetRoomName();
|
|
||||||
Vector2 GetDestPosition();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class DoorManager;
|
|
||||||
|
|
||||||
std::string roomName;
|
|
||||||
Vector2 destPosition;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
LUAMOD_API int openEntityAPI(lua_State* L) {
|
||||||
|
luaL_newlib(L, entityLib);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
+3
-3
@@ -26,10 +26,10 @@
|
|||||||
#include "character_manager.hpp"
|
#include "character_manager.hpp"
|
||||||
#include "client_manager.hpp"
|
#include "client_manager.hpp"
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
#include "door_manager.hpp"
|
|
||||||
#include "monster_manager.hpp"
|
#include "monster_manager.hpp"
|
||||||
#include "room_manager.hpp"
|
#include "room_manager.hpp"
|
||||||
#include "udp_network_utility.hpp"
|
#include "udp_network_utility.hpp"
|
||||||
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -43,10 +43,10 @@ int main(int argc, char* argv[]) {
|
|||||||
CharacterManager::CreateSingleton();
|
CharacterManager::CreateSingleton();
|
||||||
ClientManager::CreateSingleton();
|
ClientManager::CreateSingleton();
|
||||||
ConfigUtility::CreateSingleton();
|
ConfigUtility::CreateSingleton();
|
||||||
DoorManager::CreateSingleton();
|
|
||||||
MonsterManager::CreateSingleton();
|
MonsterManager::CreateSingleton();
|
||||||
RoomManager::CreateSingleton();
|
RoomManager::CreateSingleton();
|
||||||
UDPNetworkUtility::CreateSingleton();
|
UDPNetworkUtility::CreateSingleton();
|
||||||
|
WaypointManager::CreateSingleton();
|
||||||
|
|
||||||
//call the server's routines
|
//call the server's routines
|
||||||
ServerApplication::CreateSingleton();
|
ServerApplication::CreateSingleton();
|
||||||
@@ -63,10 +63,10 @@ int main(int argc, char* argv[]) {
|
|||||||
CharacterManager::DeleteSingleton();
|
CharacterManager::DeleteSingleton();
|
||||||
ClientManager::DeleteSingleton();
|
ClientManager::DeleteSingleton();
|
||||||
ConfigUtility::DeleteSingleton();
|
ConfigUtility::DeleteSingleton();
|
||||||
DoorManager::DeleteSingleton();
|
|
||||||
MonsterManager::DeleteSingleton();
|
MonsterManager::DeleteSingleton();
|
||||||
RoomManager::DeleteSingleton();
|
RoomManager::DeleteSingleton();
|
||||||
UDPNetworkUtility::DeleteSingleton();
|
UDPNetworkUtility::DeleteSingleton();
|
||||||
|
WaypointManager::DeleteSingleton();
|
||||||
}
|
}
|
||||||
catch(exception& e) {
|
catch(exception& e) {
|
||||||
cerr << "Fatal exception thrown: " << e.what() << endl;
|
cerr << "Fatal exception thrown: " << e.what() << endl;
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
#include directories
|
#include directories
|
||||||
INCLUDES+=. accounts characters clients doors entities monsters rooms server_utilities ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
INCLUDES+=. accounts characters clients entities monsters rooms server_utilities waypoints ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities
|
||||||
|
|
||||||
#libraries
|
#libraries
|
||||||
#the order of the $(LIBS) is important, at least for MinGW
|
#the order of the $(LIBS) is important, at least for MinGW
|
||||||
@@ -28,11 +28,11 @@ all: $(OBJ) $(OUT)
|
|||||||
$(MAKE) -C accounts
|
$(MAKE) -C accounts
|
||||||
$(MAKE) -C characters
|
$(MAKE) -C characters
|
||||||
$(MAKE) -C clients
|
$(MAKE) -C clients
|
||||||
$(MAKE) -C doors
|
|
||||||
$(MAKE) -C entities
|
$(MAKE) -C entities
|
||||||
$(MAKE) -C monsters
|
$(MAKE) -C monsters
|
||||||
$(MAKE) -C rooms
|
$(MAKE) -C rooms
|
||||||
$(MAKE) -C server_utilities
|
$(MAKE) -C server_utilities
|
||||||
|
$(MAKE) -C waypoints
|
||||||
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
$(CXX) $(CXXFLAGS) -o $(OUT) $(OBJ) $(LIBS)
|
||||||
|
|
||||||
$(OBJ): | $(OBJDIR)
|
$(OBJ): | $(OBJDIR)
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -26,9 +26,9 @@
|
|||||||
#include "account_manager.hpp"
|
#include "account_manager.hpp"
|
||||||
#include "character_manager.hpp"
|
#include "character_manager.hpp"
|
||||||
#include "client_manager.hpp"
|
#include "client_manager.hpp"
|
||||||
#include "door_manager.hpp"
|
|
||||||
#include "monster_manager.hpp"
|
#include "monster_manager.hpp"
|
||||||
#include "room_manager.hpp"
|
#include "room_manager.hpp"
|
||||||
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
//utilities
|
//utilities
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
@@ -123,9 +123,9 @@ private:
|
|||||||
AccountManager& accountMgr = AccountManager::GetSingleton();
|
AccountManager& accountMgr = AccountManager::GetSingleton();
|
||||||
CharacterManager& characterMgr = CharacterManager::GetSingleton();
|
CharacterManager& characterMgr = CharacterManager::GetSingleton();
|
||||||
ClientManager& clientMgr = ClientManager::GetSingleton();
|
ClientManager& clientMgr = ClientManager::GetSingleton();
|
||||||
DoorManager& doorMgr = DoorManager::GetSingleton();
|
|
||||||
MonsterManager& monsterMgr = MonsterManager::GetSingleton();
|
MonsterManager& monsterMgr = MonsterManager::GetSingleton();
|
||||||
RoomManager& roomMgr = RoomManager::GetSingleton();
|
RoomManager& roomMgr = RoomManager::GetSingleton();
|
||||||
|
WaypointManager& waypointMgr = WaypointManager::GetSingleton();
|
||||||
|
|
||||||
ConfigUtility& config = ConfigUtility::GetSingleton();
|
ConfigUtility& config = ConfigUtility::GetSingleton();
|
||||||
UDPNetworkUtility& network = UDPNetworkUtility::GetSingleton();
|
UDPNetworkUtility& network = UDPNetworkUtility::GetSingleton();
|
||||||
|
|||||||
@@ -201,9 +201,9 @@ void ServerApplication::Quit() {
|
|||||||
accountMgr.UnloadAll();
|
accountMgr.UnloadAll();
|
||||||
characterMgr.UnloadAll();
|
characterMgr.UnloadAll();
|
||||||
clientMgr.UnloadAll();
|
clientMgr.UnloadAll();
|
||||||
doorMgr.UnloadAll();
|
|
||||||
monsterMgr.UnloadAll();
|
monsterMgr.UnloadAll();
|
||||||
roomMgr.UnloadAll();
|
roomMgr.UnloadAll();
|
||||||
|
waypointMgr.UnloadAll();
|
||||||
|
|
||||||
//APIs
|
//APIs
|
||||||
lua_close(luaState);
|
lua_close(luaState);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#config
|
#config
|
||||||
INCLUDES+=. ../entities ../server_utilities ../../common/utilities
|
INCLUDES+=. ../server_utilities ../../common/utilities
|
||||||
LIBS+=
|
LIBS+=
|
||||||
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
CXXFLAGS+=-std=c++11 $(addprefix -I,$(INCLUDES))
|
||||||
|
|
||||||
@@ -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 "waypoint_api.hpp"
|
||||||
|
|
||||||
|
#include "waypoint_data.hpp"
|
||||||
|
|
||||||
|
static const luaL_Reg waypointLib[] = {
|
||||||
|
{nullptr, nullptr}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUAMOD_API int openWaypointAPI(lua_State* L) {
|
||||||
|
luaL_newlib(L, waypointLib);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
@@ -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 WAYPOINTAPI_HPP_
|
||||||
|
#define WAYPOINTAPI_HPP_
|
||||||
|
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
#include "lua/lua.hpp"
|
||||||
|
#else
|
||||||
|
#include "lua.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TORTUGA_WAYPOINT_API "waypoint"
|
||||||
|
LUAMOD_API int openWaypointAPI(lua_State* L);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
/* 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 "waypoint_data.hpp"
|
||||||
|
|
||||||
@@ -19,20 +19,18 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#include "door_data.hpp"
|
#ifndef WAYPOINTDATA_HPP_
|
||||||
|
#define WAYPOINTDATA_HPP_
|
||||||
|
|
||||||
std::string DoorData::SetRoomName(std::string s) {
|
#include <string>
|
||||||
return roomName = s;
|
|
||||||
}
|
|
||||||
|
|
||||||
Vector2 DoorData::SetDestPosition(Vector2 v) {
|
class WaypointData {
|
||||||
return destPosition = v;
|
public:
|
||||||
}
|
WaypointData() = default;
|
||||||
|
~WaypointData() = default;
|
||||||
|
|
||||||
std::string DoorData::GetRoomName() {
|
private:
|
||||||
return roomName;
|
friend class WaypointManager;
|
||||||
}
|
};
|
||||||
|
|
||||||
Vector2 DoorData::GetDestPosition() {
|
#endif
|
||||||
return destPosition;
|
|
||||||
}
|
|
||||||
@@ -19,48 +19,48 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#include "door_manager.hpp"
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
int DoorManager::Create(std::string, Vector2) {
|
int WaypointManager::Create() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::Load(std::string, Vector2) {
|
int WaypointManager::Load() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::Save(int uid) {
|
int WaypointManager::Save(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::Unload(int uid) {
|
void WaypointManager::Unload(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::Delete(int uid) {
|
void WaypointManager::Delete(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::UnloadAll() {
|
void WaypointManager::UnloadAll() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoorManager::UnloadIf(std::function<bool(std::pair<const int, DoorData>)> fn) {
|
void WaypointManager::UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
DoorData* DoorManager::Get(int uid) {
|
WaypointData* WaypointManager::Get(int uid) {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::GetLoadedCount() {
|
int WaypointManager::GetLoadedCount() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
int DoorManager::GetTotalCount() {
|
int WaypointManager::GetTotalCount() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<int, DoorData>* DoorManager::GetContainer() {
|
std::map<int, WaypointData>* WaypointManager::GetContainer() {
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
@@ -19,10 +19,10 @@
|
|||||||
* 3. This notice may not be removed or altered from any source
|
* 3. This notice may not be removed or altered from any source
|
||||||
* distribution.
|
* distribution.
|
||||||
*/
|
*/
|
||||||
#ifndef DOORMANAGER_HPP_
|
#ifndef WAYPOINTMANAGER_HPP_
|
||||||
#define DOORMANAGER_HPP_
|
#define WAYPOINTMANAGER_HPP_
|
||||||
|
|
||||||
#include "door_data.hpp"
|
#include "waypoint_data.hpp"
|
||||||
#include "manager_interface.hpp"
|
#include "manager_interface.hpp"
|
||||||
#include "singleton.hpp"
|
#include "singleton.hpp"
|
||||||
#include "vector2.hpp"
|
#include "vector2.hpp"
|
||||||
@@ -30,32 +30,32 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class DoorManager:
|
class WaypointManager:
|
||||||
public Singleton<DoorManager>,
|
public Singleton<WaypointManager>,
|
||||||
public ManagerInterface<DoorData, std::string, Vector2>
|
public ManagerInterface<WaypointData>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//common public methods
|
//common public methods
|
||||||
int Create(std::string, Vector2) override;
|
int Create() override;
|
||||||
int Load(std::string, Vector2) override;
|
int Load() override;
|
||||||
int Save(int uid) override;
|
int Save(int uid) override;
|
||||||
void Unload(int uid) override;
|
void Unload(int uid) override;
|
||||||
void Delete(int uid) override;
|
void Delete(int uid) override;
|
||||||
|
|
||||||
void UnloadAll() override;
|
void UnloadAll() override;
|
||||||
void UnloadIf(std::function<bool(std::pair<const int, DoorData>)> fn) override;
|
void UnloadIf(std::function<bool(std::pair<const int, WaypointData>)> fn) override;
|
||||||
|
|
||||||
//accessors & mutators
|
//accessors & mutators
|
||||||
DoorData* Get(int uid) override;
|
WaypointData* Get(int uid) override;
|
||||||
int GetLoadedCount() override;
|
int GetLoadedCount() override;
|
||||||
int GetTotalCount() override;
|
int GetTotalCount() override;
|
||||||
std::map<int, DoorData>* GetContainer() override;
|
std::map<int, WaypointData>* GetContainer() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend Singleton<DoorManager>;
|
friend Singleton<WaypointManager>;
|
||||||
|
|
||||||
DoorManager() = default;
|
WaypointManager() = default;
|
||||||
~DoorManager() = default;
|
~WaypointManager() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -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 "waypoint_manager_api.hpp"
|
||||||
|
|
||||||
|
#include "waypoint_manager.hpp"
|
||||||
|
|
||||||
|
static const luaL_Reg waypointManagerLib[] = {
|
||||||
|
{nullptr, nullptr}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUAMOD_API int openWaypointManagerAPI(lua_State* L) {
|
||||||
|
luaL_newlib(L, waypointManagerLib);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
@@ -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 WAYPOINTMANAGERAPI_HPP_
|
||||||
|
#define WAYPOINTMANAGERAPI_HPP_
|
||||||
|
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
#include "lua/lua.hpp"
|
||||||
|
#else
|
||||||
|
#include "lua.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define TORTUGA_WAYPOINT_MANAGER_API "waypoint_manager"
|
||||||
|
LUAMOD_API int openWaypointManagerAPI(lua_State* L);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
TODO: In need of script APIs (list)
|
||||||
|
* Characters
|
||||||
|
* Monsters
|
||||||
|
* Doors
|
||||||
|
* Waypoints
|
||||||
|
|
||||||
|
TODO: Account passwords (list)
|
||||||
|
* backbone account server OR
|
||||||
|
* social network login OR
|
||||||
|
* ...
|
||||||
|
* salts & hashes
|
||||||
|
|
||||||
|
TODO: Waypoints, with positions and trigger zones (collision areas) for doors, monster spawns, etc.
|
||||||
|
TODO: Fix shoddy movement
|
||||||
|
TODO: Periodic mass server saves
|
||||||
|
TODO: Remove the big "Shut Down" button
|
||||||
|
TODO: Make a way for the server owner to control the server directly
|
||||||
|
TODO: The TileSheet class should implement the surface itself
|
||||||
|
TODO: Time delay for requesting region packets
|
||||||
|
TODO: A proper logging system
|
||||||
Reference in New Issue
Block a user