diff --git a/common/gameplay/statistics.hpp b/common/gameplay/statistics.hpp deleted file mode 100644 index 71020ae..0000000 --- a/common/gameplay/statistics.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2014 - * - * 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 STATISTICS_HPP_ -#define STATISTICS_HPP_ - -struct Statistics { - int level = 0; - int exp = 0; - int maxHP = 0; - int health = 0; - int maxMP = 0; - int mana = 0; - int attack = 0; - int defence = 0; - int intelligence = 0; - int resistance = 0; - int speed = 0; - float accuracy = 0.0; - float evasion = 0.0; - float luck = 0.0; -}; - -#endif \ No newline at end of file diff --git a/common/network/packet_types/character_packet.cpp b/common/network/packet_types/character_packet.cpp index 7f6620c..c18d1bf 100644 --- a/common/network/packet_types/character_packet.cpp +++ b/common/network/packet_types/character_packet.cpp @@ -23,8 +23,6 @@ #include "serial_utility.hpp" -#include "serial_statistics.hpp" - void serializeCharacter(void* buffer, CharacterPacket* packet) { serialCopy(&buffer, &packet->type, sizeof(SerialPacketType)); @@ -43,9 +41,6 @@ void serializeCharacter(void* buffer, CharacterPacket* packet) { serialCopy(&buffer, &packet->motion.x, sizeof(double)); serialCopy(&buffer, &packet->motion.y, sizeof(double)); - //stats structure - serializeStatistics(&buffer, &packet->stats); - //gameplay components: equipment, items, buffs, debuffs... } @@ -67,8 +62,5 @@ void deserializeCharacter(void* buffer, CharacterPacket* packet) { deserialCopy(&buffer, &packet->motion.x, sizeof(double)); deserialCopy(&buffer, &packet->motion.y, sizeof(double)); - //stats structure - deserializeStatistics(&buffer, &packet->stats); - //gameplay components: equipment, items, buffs, debuffs... } diff --git a/common/network/packet_types/character_packet.hpp b/common/network/packet_types/character_packet.hpp index e743589..98d2c31 100644 --- a/common/network/packet_types/character_packet.hpp +++ b/common/network/packet_types/character_packet.hpp @@ -25,7 +25,6 @@ #include "serial_packet_base.hpp" #include "vector2.hpp" -#include "statistics.hpp" struct CharacterPacket : SerialPacketBase { //identify the character @@ -42,9 +41,6 @@ struct CharacterPacket : SerialPacketBase { Vector2 origin; Vector2 motion; - //gameplay - Statistics stats; - //gameplay components: equipment, items, buffs, debuffs... }; diff --git a/common/network/packet_types/serial_statistics.cpp b/common/network/packet_types/serial_statistics.cpp deleted file mode 100644 index fae799e..0000000 --- a/common/network/packet_types/serial_statistics.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2014 - * - * 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 "serial_statistics.hpp" - -#include "serial_utility.hpp" - -void serializeStatistics(void** buffer, Statistics* stats) { - //integers - serialCopy(buffer, &stats->level, sizeof(int)); - serialCopy(buffer, &stats->exp, sizeof(int)); - serialCopy(buffer, &stats->maxHP, sizeof(int)); - serialCopy(buffer, &stats->health, sizeof(int)); - serialCopy(buffer, &stats->maxMP, sizeof(int)); - serialCopy(buffer, &stats->mana, sizeof(int)); - serialCopy(buffer, &stats->attack, sizeof(int)); - serialCopy(buffer, &stats->defence, sizeof(int)); - serialCopy(buffer, &stats->intelligence, sizeof(int)); - serialCopy(buffer, &stats->resistance, sizeof(int)); - serialCopy(buffer, &stats->speed, sizeof(int)); - - //floats - serialCopy(buffer, &stats->accuracy, sizeof(float)); - serialCopy(buffer, &stats->evasion, sizeof(float)); - serialCopy(buffer, &stats->luck, sizeof(float)); -} - -void deserializeStatistics(void** buffer, Statistics* stats) { - //integers - deserialCopy(buffer, &stats->level, sizeof(int)); - deserialCopy(buffer, &stats->exp, sizeof(int)); - deserialCopy(buffer, &stats->maxHP, sizeof(int)); - deserialCopy(buffer, &stats->health, sizeof(int)); - deserialCopy(buffer, &stats->maxMP, sizeof(int)); - deserialCopy(buffer, &stats->mana, sizeof(int)); - deserialCopy(buffer, &stats->attack, sizeof(int)); - deserialCopy(buffer, &stats->defence, sizeof(int)); - deserialCopy(buffer, &stats->intelligence, sizeof(int)); - deserialCopy(buffer, &stats->resistance, sizeof(int)); - deserialCopy(buffer, &stats->speed, sizeof(int)); - - //floats - deserialCopy(buffer, &stats->accuracy, sizeof(float)); - deserialCopy(buffer, &stats->evasion, sizeof(float)); - deserialCopy(buffer, &stats->luck, sizeof(float)); -} diff --git a/common/network/packet_types/serial_statistics.hpp b/common/network/packet_types/serial_statistics.hpp deleted file mode 100644 index 2f4243f..0000000 --- a/common/network/packet_types/serial_statistics.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/* Copyright: (c) Kayne Ruse 2014 - * - * 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 SERIALSTATISTICS_HPP_ -#define SERIALSTATISTICS_HPP_ - -#include "statistics.hpp" - -void serializeStatistics(void** buffer, Statistics* stats); -void deserializeStatistics(void** buffer, Statistics* stats); - -#endif \ No newline at end of file diff --git a/server/characters/character_data.cpp b/server/characters/character_data.cpp index 359812c..2e4fa25 100644 --- a/server/characters/character_data.cpp +++ b/server/characters/character_data.cpp @@ -21,10 +21,6 @@ */ #include "character_data.hpp" -Statistics* CharacterData::GetBaseStats() { - return &baseStats; -} - int CharacterData::GetOwner() { return owner; } diff --git a/server/characters/character_data.hpp b/server/characters/character_data.hpp index 400f4cb..2e94a7c 100644 --- a/server/characters/character_data.hpp +++ b/server/characters/character_data.hpp @@ -25,7 +25,6 @@ //components #include "character_defines.hpp" #include "entity.hpp" -#include "statistics.hpp" //std namespace #include @@ -37,7 +36,7 @@ public: ~CharacterData() = default; //accessors and mutators - Statistics* GetBaseStats(); + //... //database stuff int GetOwner(); @@ -47,8 +46,6 @@ public: private: friend class CharacterManager; - Statistics baseStats; - int owner; std::string handle; std::string avatar; diff --git a/server/monsters/monster_data.cpp b/server/monsters/monster_data.cpp index 2298c06..2e7560d 100644 --- a/server/monsters/monster_data.cpp +++ b/server/monsters/monster_data.cpp @@ -21,10 +21,6 @@ */ #include "monster_data.hpp" -Statistics* MonsterData::GetBaseStats() { - return &baseStats; -} - std::string MonsterData::SetAvatar(std::string s) { return avatar = s; } diff --git a/server/monsters/monster_data.hpp b/server/monsters/monster_data.hpp index a98daa7..bd45699 100644 --- a/server/monsters/monster_data.hpp +++ b/server/monsters/monster_data.hpp @@ -23,7 +23,6 @@ #define MONSTERDATA_HPP_ #include "entity.hpp" -#include "statistics.hpp" #include @@ -32,8 +31,6 @@ public: MonsterData() = default; ~MonsterData() = default; - Statistics* GetBaseStats(); - std::string SetAvatar(std::string); int SetScriptReference(int); @@ -43,7 +40,6 @@ public: private: friend class MonsterManager; - Statistics baseStats; std::string avatar; int scriptRef; }; diff --git a/server/server_methods.cpp b/server/server_methods.cpp index d73d899..7e84f8e 100644 --- a/server/server_methods.cpp +++ b/server/server_methods.cpp @@ -240,8 +240,6 @@ void ServerApplication::HandleCharacterUpdate(CharacterPacket* const argPacket) character->SetOrigin(argPacket->origin); character->SetMotion(argPacket->motion); - *character->GetBaseStats() = argPacket->stats; - //TODO: gameplay components: equipment, items, buffs, debuffs PumpPacket(argPacket); @@ -353,5 +351,4 @@ void ServerApplication::CopyCharacterToPacket(CharacterPacket* const packet, int packet->roomIndex = character->GetRoomIndex(); packet->origin = character->GetOrigin(); packet->motion = character->GetMotion(); - packet->stats = *character->GetBaseStats(); } \ No newline at end of file