diff --git a/rsc/scripts/door_utility.lua b/rsc/scripts/door_utility.lua index 8c9447e..49f272d 100644 --- a/rsc/scripts/door_utility.lua +++ b/rsc/scripts/door_utility.lua @@ -22,6 +22,8 @@ */ --]] +--DOCS: a placeholder door utility + local doorUtility = {} roomAPI = require("room") diff --git a/rsc/scripts/map_maker.lua b/rsc/scripts/map_maker.lua index 69ed519..596570f 100644 --- a/rsc/scripts/map_maker.lua +++ b/rsc/scripts/map_maker.lua @@ -22,6 +22,8 @@ */ --]] +--DOCS: a placeholder map generator + local regionAPI = require("region") local mapMaker = {} diff --git a/rsc/scripts/setup_server.lua b/rsc/scripts/setup_server.lua index afe6690..4cb4972 100644 --- a/rsc/scripts/setup_server.lua +++ b/rsc/scripts/setup_server.lua @@ -22,13 +22,13 @@ */ --]] +--DOCS: This script is run by the server on startup + print("Lua script check") --requirements roomManagerAPI = require("room_manager") roomAPI = require("room") -monsterManagerAPI = require("monster_manager") -monsterAPI = require("monster") mapMaker = require("map_maker") mapSaver = require("map_saver") @@ -43,10 +43,6 @@ roomManagerAPI.SetOnCreate(function(room, index) roomAPI.ForEachCharacter(room, function(character) -- end) - - roomAPI.ForEachMonster(room, function(monster) - --TODO: move ForEachMonster to the monster manager API - end) end) end) @@ -63,16 +59,3 @@ roomAPI.Initialize(underworld, mapSaver.Load, mapSaver.Save, mapMaker.DebugGrass --call the monstrosity doorUtility.createDoorPair("pair 1", overworld, -64, -64, underworld, 64, 64) - ---testing the monster creation -print("testing monsters") -local monsterMgr = roomAPI.GetMonsterMgr(overworld) - -local monster, mIndex = monsterManagerAPI.Create(monsterMgr, "skume.bmp", 0) - -print("Monster count: ", monsterManagerAPI.GetLoadedCount(monsterMgr)) -print("Monster avatar: ", monsterAPI.GetAvatar(monster), mIndex) - -monsterManagerAPI.UnloadAll(monsterMgr) - -print("Finished the lua script") diff --git a/rsc/scripts/updates.sql b/rsc/scripts/updates.sql deleted file mode 100644 index 2f0f817..0000000 --- a/rsc/scripts/updates.sql +++ /dev/null @@ -1,54 +0,0 @@ -/* 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. -*/ - ---TODO: might need a version number for database structures - ---An example of a database update script. ---This is only rough right now, until I get some more eyes onto it - ---moving old to new -CREATE TABLE tempCharacters ( - uid INTEGER PRIMARY KEY AUTOINCREMENT, - - --metadata - owner INTEGER REFERENCES Accounts(uid), - handle varchar(100) UNIQUE, - avatar varchar(100), - birth timestamp NOT NULL DEFAULT (datetime()), - - --physically exists in the world - roomIndex INTEGER DEFAULT 0, - originX INTEGER DEFAULT 0, - originY INTEGER DEFAULT 0, - boundsX INTEGER DEFAULT 0, - boundsY INTEGER DEFAULT 0, - boundsW INTEGER DEFAULT 0, - boundsH INTEGER DEFAULT 0 -); - -INSERT INTO tempCharacters (uid, owner, handle, avatar, birth, roomIndex, originX, originY, boundsX, boundsY, boundsW, boundsH) - SELECT uid, owner, handle, avatar, birth, roomIndex, originX, originY, boundsX, boundsY, boundsW, boundsH - FROM LiveCharacters; - -DROP TABLE LiveCharacters; - -ALTER TABLE tempCharacters RENAME TO LiveCharacters; diff --git a/server/linit.cpp b/server/linit.cpp index c0552ea..f1c05bb 100644 --- a/server/linit.cpp +++ b/server/linit.cpp @@ -41,8 +41,8 @@ #include "character_manager_api.hpp" #include "region_api.hpp" #include "region_pager_api.hpp" -#include "monster_api.hpp" -#include "monster_manager_api.hpp" +//#include "monster_api.hpp" +//#include "monster_manager_api.hpp" #include "network_api.hpp" #include "room_api.hpp" #include "room_manager_api.hpp" @@ -70,8 +70,8 @@ static const luaL_Reg preloadedlibs[] = { {TORTUGA_ENTITY_API, openEntityAPI}, //required by derived classes {TORTUGA_CHARACTER_API, openCharacterAPI}, {TORTUGA_CHARACTER_MANAGER_API, openCharacterManagerAPI}, - {TORTUGA_MONSTER_API, openMonsterAPI}, - {TORTUGA_MONSTER_MANAGER_API, openMonsterManagerAPI}, +// {TORTUGA_MONSTER_API, openMonsterAPI}, +// {TORTUGA_MONSTER_MANAGER_API, openMonsterManagerAPI}, {TORTUGA_NETWORK_API, openNetworkAPI}, {TORTUGA_REGION_API, openRegionAPI}, {TORTUGA_REGION_PAGER_API, openRegionPagerAPI}, diff --git a/server/makefile b/server/makefile index cd4b993..2f8de96 100644 --- a/server/makefile +++ b/server/makefile @@ -1,5 +1,5 @@ #include directories -INCLUDES+=SDL . accounts characters clients entities monsters rooms server_utilities triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities +INCLUDES+=SDL . accounts characters clients entities rooms server_utilities triggers ../common/debugging ../common/gameplay ../common/map ../common/network ../common/network/packet_types ../common/utilities #libraries #the order of the $(LIBS) is important, at least for MinGW @@ -33,7 +33,7 @@ all: $(OBJ) $(OUT) $(MAKE) -C characters $(MAKE) -C clients $(MAKE) -C entities - $(MAKE) -C monsters +# $(MAKE) -C monsters $(MAKE) -C rooms $(MAKE) -C server_utilities $(MAKE) -C triggers diff --git a/server/rooms/room_api.cpp b/server/rooms/room_api.cpp index 438675f..9aad030 100644 --- a/server/rooms/room_api.cpp +++ b/server/rooms/room_api.cpp @@ -56,11 +56,13 @@ static int getPager(lua_State* L) { return 1; } +/* static int getMonsterMgr(lua_State* L) { RoomData* room = reinterpret_cast(lua_touserdata(L, 1)); lua_pushlightuserdata(L, reinterpret_cast(room->GetMonsterMgr()) ); return 1; } +*/ static int getTriggerMgr(lua_State* L) { RoomData* room = reinterpret_cast(lua_touserdata(L, 1)); @@ -85,6 +87,7 @@ static int forEachCharacter(lua_State* L) { return 0; } +/* static int forEachMonster(lua_State* L) { RoomData* room = reinterpret_cast(lua_touserdata(L, 1)); MonsterManager* monsterMgr = room->GetMonsterMgr(); @@ -102,6 +105,7 @@ static int forEachMonster(lua_State* L) { } return 0; } +*/ static int setOnTick(lua_State* L) { RoomData* room = reinterpret_cast(lua_touserdata(L, 1)); @@ -136,11 +140,11 @@ static const luaL_Reg roomLib[] = { {"GetTileset", getTilesetName}, {"GetPager",getPager}, - {"GetMonsterMgr",getMonsterMgr}, +// {"GetMonsterMgr",getMonsterMgr}, {"GetTriggerMgr",getTriggerMgr}, {"ForEachCharacter", forEachCharacter}, - {"ForEachMonster", forEachMonster}, +// {"ForEachMonster", forEachMonster}, {"SetOnTick", setOnTick}, {"GetOnTick", getOnTick}, diff --git a/server/rooms/room_data.cpp b/server/rooms/room_data.cpp index dcb544c..cb6e8e0 100644 --- a/server/rooms/room_data.cpp +++ b/server/rooms/room_data.cpp @@ -122,10 +122,6 @@ RegionPagerLua* RoomData::GetPager() { return &pager; } -MonsterManager* RoomData::GetMonsterMgr() { - return &monsterMgr; -} - TriggerManager* RoomData::GetTriggerMgr() { return &triggerMgr; } @@ -137,7 +133,6 @@ std::list* RoomData::GetCharacterList() { lua_State* RoomData::SetLuaState(lua_State* L) { lua = L; pager.SetLuaState(lua); - monsterMgr.SetLuaState(lua); triggerMgr.SetLuaState(lua); return lua; } @@ -148,7 +143,6 @@ lua_State* RoomData::GetLuaState() { sqlite3* RoomData::SetDatabase(sqlite3* db) { database = db; - monsterMgr.SetDatabase(database); return database; } diff --git a/server/rooms/room_data.hpp b/server/rooms/room_data.hpp index dabe81d..ac4331f 100644 --- a/server/rooms/room_data.hpp +++ b/server/rooms/room_data.hpp @@ -23,11 +23,11 @@ #define ROOMDATA_HPP_ #include "character_data.hpp" -#include "monster_manager.hpp" #include "region_pager_lua.hpp" #include "trigger_manager.hpp" #include "lua.hpp" +#include "sqlite3.h" #include #include @@ -47,7 +47,6 @@ public: std::string GetTileset(); RegionPagerLua* GetPager(); - MonsterManager* GetMonsterMgr(); TriggerManager* GetTriggerMgr(); std::list* GetCharacterList(); @@ -69,7 +68,6 @@ private: //members RegionPagerLua pager; - MonsterManager monsterMgr; TriggerManager triggerMgr; std::list characterList; diff --git a/server/server_application.hpp b/server/server_application.hpp index 3ba2b39..b3effbf 100644 --- a/server/server_application.hpp +++ b/server/server_application.hpp @@ -26,7 +26,6 @@ #include "account_manager.hpp" #include "character_manager.hpp" #include "client_manager.hpp" -#include "monster_manager.hpp" #include "room_manager.hpp" //utilities @@ -105,9 +104,6 @@ private: void hCharacterAttack(CharacterPacket* const); void hCharacterDamage(CharacterPacket* const); - //character management - void hMonsterDamage(MonsterPacket* const); - //chat void hTextBroadcast(TextPacket* const); void hTextSpeech(TextPacket* const); diff --git a/server/server_logic.cpp b/server/server_logic.cpp index d0a4283..ed31f6f 100644 --- a/server/server_logic.cpp +++ b/server/server_logic.cpp @@ -327,11 +327,6 @@ void ServerApplication::HandlePacket(SerialPacket* const argPacket) { hCharacterDamage(static_cast(argPacket)); break; - //monster management - case SerialPacketType::MONSTER_DAMAGE: - hMonsterDamage(static_cast(argPacket)); - break; - //chat case SerialPacketType::TEXT_BROADCAST: hTextBroadcast(static_cast(argPacket)); diff --git a/server/server_monster_methods.cpp b/server/server_monster_methods.cpp deleted file mode 100644 index 662c255..0000000 --- a/server/server_monster_methods.cpp +++ /dev/null @@ -1,26 +0,0 @@ -/* 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 "server_application.hpp" - -void ServerApplication::hMonsterDamage(MonsterPacket* const argPacket) { - //TODO: (9) ServerApplication::hMonsterDamage() -} \ No newline at end of file