Removed the shared parameters structure (read more)
I've also stopped using a separate branch for sharing the CharacterData structre. This commit won't build, mostly because I need to refactor InWorld to handle the loss of the PlayerCharacter class. I should probably rename SQL's tables too.
This commit is contained in:
@@ -119,13 +119,13 @@ void ClientApplication::LoadScene(SceneList sceneIndex) {
|
|||||||
activeScene = new OptionsMenu(&config);
|
activeScene = new OptionsMenu(&config);
|
||||||
break;
|
break;
|
||||||
case SceneList::LOBBYMENU:
|
case SceneList::LOBBYMENU:
|
||||||
activeScene = new LobbyMenu(&config, &network, ¶ms);
|
activeScene = new LobbyMenu(&config, &network, &clientIndex, &accountIndex, &characterIndex);
|
||||||
break;
|
break;
|
||||||
case SceneList::INWORLD:
|
case SceneList::INWORLD:
|
||||||
activeScene = new InWorld(&config, &network, ¶ms);
|
activeScene = new InWorld(&config, &network, &clientIndex, &accountIndex, &characterIndex);
|
||||||
break;
|
break;
|
||||||
case SceneList::INCOMBAT:
|
case SceneList::INCOMBAT:
|
||||||
activeScene = new InCombat(&config, &network, ¶ms);
|
activeScene = new InCombat(&config, &network, &clientIndex, &accountIndex, &characterIndex);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw(std::logic_error("Failed to recognize the scene index"));
|
throw(std::logic_error("Failed to recognize the scene index"));
|
||||||
|
|||||||
@@ -25,9 +25,13 @@
|
|||||||
#include "scene_list.hpp"
|
#include "scene_list.hpp"
|
||||||
#include "base_scene.hpp"
|
#include "base_scene.hpp"
|
||||||
|
|
||||||
#include "shared_parameters.hpp"
|
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
#include "udp_network_utility.hpp"
|
#include "udp_network_utility.hpp"
|
||||||
|
#include "character_data.hpp"
|
||||||
|
#include "combat_data.hpp"
|
||||||
|
#include "enemy_data.hpp"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
|
||||||
class ClientApplication {
|
class ClientApplication {
|
||||||
public:
|
public:
|
||||||
@@ -48,7 +52,13 @@ private:
|
|||||||
//shared parameters
|
//shared parameters
|
||||||
ConfigUtility config;
|
ConfigUtility config;
|
||||||
UDPNetworkUtility network;
|
UDPNetworkUtility network;
|
||||||
SharedParameters params;
|
int clientIndex = -1;
|
||||||
|
int accountIndex = -1;
|
||||||
|
int characterIndex = -1;
|
||||||
|
|
||||||
|
std::map<int, CharacterData> characterMap;
|
||||||
|
std::map<int, CombatData> combatMap;
|
||||||
|
std::map<int, EnemyData> enemyMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -25,10 +25,18 @@
|
|||||||
//Public access members
|
//Public access members
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
InCombat::InCombat(ConfigUtility* const argConfig, UDPNetworkUtility* const argNetwork, SharedParameters* const argParams):
|
InCombat::InCombat(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
):
|
||||||
config(*argConfig),
|
config(*argConfig),
|
||||||
network(*argNetwork),
|
network(*argNetwork),
|
||||||
params(*argParams)
|
clientIndex(*argClientIndex),
|
||||||
|
accountIndex(*argAccountIndex),
|
||||||
|
characterIndex(*argCharacterIndex)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -53,6 +61,13 @@ void InCombat::FrameEnd() {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InCombat::RenderFrame() {
|
||||||
|
SDL_FillRect(GetScreen(), 0, 0);
|
||||||
|
Render(GetScreen());
|
||||||
|
SDL_Flip(GetScreen());
|
||||||
|
fps.Calculate();
|
||||||
|
}
|
||||||
|
|
||||||
void InCombat::Render(SDL_Surface* const screen) {
|
void InCombat::Render(SDL_Surface* const screen) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
@@ -62,7 +77,9 @@ void InCombat::Render(SDL_Surface* const screen) {
|
|||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
void InCombat::QuitEvent() {
|
void InCombat::QuitEvent() {
|
||||||
//
|
//exit the game AND the server
|
||||||
|
RequestDisconnect();
|
||||||
|
SetNextScene(SceneList::MAINMENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InCombat::MouseMotion(SDL_MouseMotionEvent const& motion) {
|
void InCombat::MouseMotion(SDL_MouseMotionEvent const& motion) {
|
||||||
@@ -89,6 +106,14 @@ void InCombat::KeyUp(SDL_KeyboardEvent const& key) {
|
|||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
void InCombat::HandlePacket(SerialPacket& packet) {
|
//-------------------------
|
||||||
//
|
//Network handlers
|
||||||
}
|
//-------------------------
|
||||||
|
|
||||||
|
//TODO: network handlers
|
||||||
|
|
||||||
|
//-------------------------
|
||||||
|
//Server control
|
||||||
|
//-------------------------
|
||||||
|
|
||||||
|
//TODO: server control
|
||||||
|
|||||||
+36
-10
@@ -22,25 +22,33 @@
|
|||||||
#ifndef INCOMBAT_HPP_
|
#ifndef INCOMBAT_HPP_
|
||||||
#define INCOMBAT_HPP_
|
#define INCOMBAT_HPP_
|
||||||
|
|
||||||
//graphics & utilities
|
|
||||||
#include "image.hpp"
|
|
||||||
#include "raster_font.hpp"
|
|
||||||
#include "button.hpp"
|
|
||||||
#include "config_utility.hpp"
|
|
||||||
#include "shared_parameters.hpp"
|
|
||||||
|
|
||||||
//network
|
//network
|
||||||
#include "udp_network_utility.hpp"
|
#include "udp_network_utility.hpp"
|
||||||
#include "serial_packet.hpp"
|
#include "serial_packet.hpp"
|
||||||
#include "serial.hpp"
|
#include "serial.hpp"
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
#include "image.hpp"
|
||||||
|
#include "raster_font.hpp"
|
||||||
|
#include "button.hpp"
|
||||||
|
|
||||||
|
//common
|
||||||
|
#include "config_utility.hpp"
|
||||||
|
#include "frame_rate.hpp"
|
||||||
|
|
||||||
//client
|
//client
|
||||||
#include "base_scene.hpp"
|
#include "base_scene.hpp"
|
||||||
|
|
||||||
class InCombat : public BaseScene {
|
class InCombat : public BaseScene {
|
||||||
public:
|
public:
|
||||||
//Public access members
|
//Public access members
|
||||||
InCombat(ConfigUtility* const, UDPNetworkUtility* const, SharedParameters* const);
|
InCombat(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
);
|
||||||
~InCombat();
|
~InCombat();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -48,6 +56,7 @@ protected:
|
|||||||
void FrameStart();
|
void FrameStart();
|
||||||
void Update(double delta);
|
void Update(double delta);
|
||||||
void FrameEnd();
|
void FrameEnd();
|
||||||
|
void RenderFrame();
|
||||||
void Render(SDL_Surface* const);
|
void Render(SDL_Surface* const);
|
||||||
|
|
||||||
//Event handlers
|
//Event handlers
|
||||||
@@ -59,12 +68,29 @@ protected:
|
|||||||
void KeyUp(SDL_KeyboardEvent const&);
|
void KeyUp(SDL_KeyboardEvent const&);
|
||||||
|
|
||||||
//Network handlers
|
//Network handlers
|
||||||
void HandlePacket(SerialPacket&);
|
void HandlePacket(SerialPacket);
|
||||||
|
void HandleDisconnect(SerialPacket);
|
||||||
|
//TODO: more
|
||||||
|
|
||||||
|
//Server control
|
||||||
|
void SendPlayerUpdate();
|
||||||
|
void RequestDisconnect();
|
||||||
|
void RequestShutdown();
|
||||||
|
//TOOD: more
|
||||||
|
|
||||||
//shared parameters
|
//shared parameters
|
||||||
ConfigUtility& config;
|
ConfigUtility& config;
|
||||||
UDPNetworkUtility& network;
|
UDPNetworkUtility& network;
|
||||||
SharedParameters& params;
|
int& clientIndex;
|
||||||
|
int& accountIndex;
|
||||||
|
int& characterIndex;
|
||||||
|
|
||||||
|
//graphics
|
||||||
|
//TODO: graphics
|
||||||
|
|
||||||
|
//UI
|
||||||
|
//TODO: UI
|
||||||
|
FrameRate fps;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+30
-22
@@ -31,10 +31,18 @@
|
|||||||
//Public access members
|
//Public access members
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
InWorld::InWorld(ConfigUtility* const argConfig, UDPNetworkUtility* const argNetwork, SharedParameters* const argParams):
|
InWorld::InWorld(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
):
|
||||||
config(*argConfig),
|
config(*argConfig),
|
||||||
network(*argNetwork),
|
network(*argNetwork),
|
||||||
params(*argParams)
|
clientIndex(*argClientIndex),
|
||||||
|
accountIndex(*argAccountIndex),
|
||||||
|
characterIndex(*argCharacterIndex)
|
||||||
{
|
{
|
||||||
//setup the utility objects
|
//setup the utility objects
|
||||||
buttonImage.LoadSurface(config["dir.interface"] + "button_menu.bmp");
|
buttonImage.LoadSurface(config["dir.interface"] + "button_menu.bmp");
|
||||||
@@ -66,9 +74,9 @@ InWorld::InWorld(ConfigUtility* const argConfig, UDPNetworkUtility* const argNet
|
|||||||
SerialPacket packet;
|
SerialPacket packet;
|
||||||
char buffer[PACKET_STRING_SIZE];
|
char buffer[PACKET_STRING_SIZE];
|
||||||
packet.meta.type = SerialPacket::Type::SYNCHRONIZE;
|
packet.meta.type = SerialPacket::Type::SYNCHRONIZE;
|
||||||
packet.clientInfo.clientIndex = params.clientIndex;
|
packet.clientInfo.clientIndex = clientIndex;
|
||||||
packet.clientInfo.accountIndex = params.accountIndex;
|
packet.clientInfo.accountIndex = accountIndex;
|
||||||
packet.clientInfo.characterIndex = params.characterIndex;
|
packet.clientInfo.characterIndex = characterIndex;
|
||||||
serialize(&packet, buffer);
|
serialize(&packet, buffer);
|
||||||
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
||||||
|
|
||||||
@@ -272,9 +280,9 @@ void InWorld::HandlePacket(SerialPacket packet) {
|
|||||||
|
|
||||||
void InWorld::HandleDisconnect(SerialPacket packet) {
|
void InWorld::HandleDisconnect(SerialPacket packet) {
|
||||||
network.Unbind(Channels::SERVER);
|
network.Unbind(Channels::SERVER);
|
||||||
params.clientIndex = -1;
|
clientIndex = -1;
|
||||||
params.accountIndex = -1;
|
accountIndex = -1;
|
||||||
params.characterIndex = -1;
|
characterIndex = -1;
|
||||||
SetNextScene(SceneList::MAINMENU);
|
SetNextScene(SceneList::MAINMENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +300,7 @@ void InWorld::HandleCharacterUpdate(SerialPacket packet) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//update only if the message didn't originate from here
|
//update only if the message didn't originate from here
|
||||||
if (packet.characterInfo.clientIndex != params.clientIndex) {
|
if (packet.characterInfo.clientIndex != clientIndex) {
|
||||||
playerCharacters[packet.characterInfo.characterIndex].SetPosition(packet.characterInfo.position);
|
playerCharacters[packet.characterInfo.characterIndex].SetPosition(packet.characterInfo.position);
|
||||||
playerCharacters[packet.characterInfo.characterIndex].SetMotion(packet.characterInfo.motion);
|
playerCharacters[packet.characterInfo.characterIndex].SetMotion(packet.characterInfo.motion);
|
||||||
}
|
}
|
||||||
@@ -312,8 +320,8 @@ void InWorld::HandleCharacterNew(SerialPacket packet) {
|
|||||||
playerCharacters[packet.characterInfo.characterIndex].ResetDirection();
|
playerCharacters[packet.characterInfo.characterIndex].ResetDirection();
|
||||||
|
|
||||||
//catch this client's player object
|
//catch this client's player object
|
||||||
if (packet.characterInfo.characterIndex == params.characterIndex && !localCharacter) {
|
if (packet.characterInfo.characterIndex == characterIndex && !localCharacter) {
|
||||||
localCharacter = &playerCharacters[params.characterIndex];
|
localCharacter = &playerCharacters[characterIndex];
|
||||||
|
|
||||||
//setup the camera
|
//setup the camera
|
||||||
camera.width = GetScreen()->w;
|
camera.width = GetScreen()->w;
|
||||||
@@ -330,8 +338,8 @@ void InWorld::HandleCharacterDelete(SerialPacket packet) {
|
|||||||
playerCharacters.erase(packet.characterInfo.characterIndex);
|
playerCharacters.erase(packet.characterInfo.characterIndex);
|
||||||
|
|
||||||
//catch this client's player object
|
//catch this client's player object
|
||||||
if (packet.characterInfo.characterIndex == params.characterIndex) {
|
if (packet.characterInfo.characterIndex == characterIndex) {
|
||||||
params.characterIndex = -1;
|
characterIndex = -1;
|
||||||
localCharacter = nullptr;
|
localCharacter = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,9 +354,9 @@ void InWorld::SendPlayerUpdate() {
|
|||||||
|
|
||||||
//pack the packet
|
//pack the packet
|
||||||
packet.meta.type = SerialPacket::Type::CHARACTER_UPDATE;
|
packet.meta.type = SerialPacket::Type::CHARACTER_UPDATE;
|
||||||
packet.characterInfo.clientIndex = params.clientIndex;
|
packet.characterInfo.clientIndex = clientIndex;
|
||||||
packet.characterInfo.accountIndex = params.accountIndex;
|
packet.characterInfo.accountIndex = accountIndex;
|
||||||
packet.characterInfo.characterIndex = params.characterIndex;
|
packet.characterInfo.characterIndex = characterIndex;
|
||||||
packet.characterInfo.position = localCharacter->GetPosition();
|
packet.characterInfo.position = localCharacter->GetPosition();
|
||||||
packet.characterInfo.motion = localCharacter->GetMotion();
|
packet.characterInfo.motion = localCharacter->GetMotion();
|
||||||
|
|
||||||
@@ -362,9 +370,9 @@ void InWorld::RequestDisconnect() {
|
|||||||
|
|
||||||
//send a disconnect request
|
//send a disconnect request
|
||||||
packet.meta.type = SerialPacket::Type::DISCONNECT;
|
packet.meta.type = SerialPacket::Type::DISCONNECT;
|
||||||
packet.clientInfo.clientIndex = params.clientIndex;
|
packet.clientInfo.clientIndex = clientIndex;
|
||||||
packet.clientInfo.accountIndex = params.accountIndex;
|
packet.clientInfo.accountIndex = accountIndex;
|
||||||
packet.clientInfo.characterIndex = params.characterIndex;
|
packet.clientInfo.characterIndex = characterIndex;
|
||||||
serialize(&packet, buffer);
|
serialize(&packet, buffer);
|
||||||
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
@@ -375,9 +383,9 @@ void InWorld::RequestShutDown() {
|
|||||||
|
|
||||||
//send a shutdown request
|
//send a shutdown request
|
||||||
packet.meta.type = SerialPacket::Type::SHUTDOWN;
|
packet.meta.type = SerialPacket::Type::SHUTDOWN;
|
||||||
packet.clientInfo.clientIndex = params.clientIndex;
|
packet.clientInfo.clientIndex = clientIndex;
|
||||||
packet.clientInfo.accountIndex = params.accountIndex;
|
packet.clientInfo.accountIndex = accountIndex;
|
||||||
packet.clientInfo.characterIndex = params.characterIndex;
|
packet.clientInfo.characterIndex = characterIndex;
|
||||||
serialize(&packet, buffer);
|
serialize(&packet, buffer);
|
||||||
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
network.Send(Channels::SERVER, buffer, PACKET_BUFFER_SIZE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
|
|
||||||
//client
|
//client
|
||||||
#include "base_scene.hpp"
|
#include "base_scene.hpp"
|
||||||
#include "shared_parameters.hpp"
|
|
||||||
|
|
||||||
//STL
|
//STL
|
||||||
#include <map>
|
#include <map>
|
||||||
@@ -52,7 +51,13 @@
|
|||||||
class InWorld : public BaseScene {
|
class InWorld : public BaseScene {
|
||||||
public:
|
public:
|
||||||
//Public access members
|
//Public access members
|
||||||
InWorld(ConfigUtility* const, UDPNetworkUtility* const, SharedParameters* const);
|
InWorld(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
);
|
||||||
~InWorld();
|
~InWorld();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -91,7 +96,9 @@ protected:
|
|||||||
//shared parameters
|
//shared parameters
|
||||||
ConfigUtility& config;
|
ConfigUtility& config;
|
||||||
UDPNetworkUtility& network;
|
UDPNetworkUtility& network;
|
||||||
SharedParameters& params;
|
int& clientIndex;
|
||||||
|
int& accountIndex;
|
||||||
|
int& characterIndex;
|
||||||
|
|
||||||
//graphics
|
//graphics
|
||||||
Image buttonImage;
|
Image buttonImage;
|
||||||
@@ -114,7 +121,7 @@ protected:
|
|||||||
FrameRate fps;
|
FrameRate fps;
|
||||||
|
|
||||||
//game
|
//game
|
||||||
PlayerCharacter* localCharacter = nullptr;
|
CharacterData* localCharacter = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -30,10 +30,18 @@
|
|||||||
//Public access members
|
//Public access members
|
||||||
//-------------------------
|
//-------------------------
|
||||||
|
|
||||||
LobbyMenu::LobbyMenu(ConfigUtility* const argConfig, UDPNetworkUtility* const argNetwork, SharedParameters* const argParams):
|
LobbyMenu::LobbyMenu(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
):
|
||||||
config(*argConfig),
|
config(*argConfig),
|
||||||
network(*argNetwork),
|
network(*argNetwork),
|
||||||
params(*argParams)
|
clientIndex(*argClientIndex),
|
||||||
|
accountIndex(*argAccountIndex),
|
||||||
|
characterIndex(*argCharacterIndex)
|
||||||
{
|
{
|
||||||
//setup the utility objects
|
//setup the utility objects
|
||||||
image.LoadSurface(config["dir.interface"] + "button_menu.bmp");
|
image.LoadSurface(config["dir.interface"] + "button_menu.bmp");
|
||||||
@@ -220,9 +228,9 @@ void LobbyMenu::HandlePacket(SerialPacket packet) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SerialPacket::Type::JOIN_RESPONSE:
|
case SerialPacket::Type::JOIN_RESPONSE:
|
||||||
params.clientIndex = packet.clientInfo.clientIndex;
|
clientIndex = packet.clientInfo.clientIndex;
|
||||||
params.accountIndex = packet.clientInfo.accountIndex;
|
accountIndex = packet.clientInfo.accountIndex;
|
||||||
params.characterIndex = packet.clientInfo.characterIndex;
|
characterIndex = packet.clientInfo.characterIndex;
|
||||||
network.Bind(&packet.meta.srcAddress, Channels::SERVER);
|
network.Bind(&packet.meta.srcAddress, Channels::SERVER);
|
||||||
SetNextScene(SceneList::INWORLD);
|
SetNextScene(SceneList::INWORLD);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
#include "raster_font.hpp"
|
#include "raster_font.hpp"
|
||||||
#include "button.hpp"
|
#include "button.hpp"
|
||||||
#include "config_utility.hpp"
|
#include "config_utility.hpp"
|
||||||
#include "shared_parameters.hpp"
|
|
||||||
|
|
||||||
//network
|
//network
|
||||||
#include "udp_network_utility.hpp"
|
#include "udp_network_utility.hpp"
|
||||||
@@ -43,7 +42,13 @@
|
|||||||
class LobbyMenu : public BaseScene {
|
class LobbyMenu : public BaseScene {
|
||||||
public:
|
public:
|
||||||
//Public access members
|
//Public access members
|
||||||
LobbyMenu(ConfigUtility* const, UDPNetworkUtility* const, SharedParameters* const);
|
LobbyMenu(
|
||||||
|
ConfigUtility* const argConfig,
|
||||||
|
UDPNetworkUtility* const argNetwork,
|
||||||
|
int* const argClientIndex,
|
||||||
|
int* const argAccountIndex,
|
||||||
|
int* const argCharacterIndex
|
||||||
|
);
|
||||||
~LobbyMenu();
|
~LobbyMenu();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -65,7 +70,9 @@ protected:
|
|||||||
//shared parameters
|
//shared parameters
|
||||||
ConfigUtility& config;
|
ConfigUtility& config;
|
||||||
UDPNetworkUtility& network;
|
UDPNetworkUtility& network;
|
||||||
SharedParameters& params;
|
int& clientIndex;
|
||||||
|
int& accountIndex;
|
||||||
|
int& characterIndex;
|
||||||
|
|
||||||
//members
|
//members
|
||||||
Image image;
|
Image image;
|
||||||
|
|||||||
@@ -1,40 +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 SHAREDPARAMETERS_HPP_
|
|
||||||
#define SHAREDPARAMETERS_HPP_
|
|
||||||
|
|
||||||
#include "character_data.hpp"
|
|
||||||
#include "enemy_data.hpp"
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
struct SharedParameters {
|
|
||||||
int clientIndex = -1;
|
|
||||||
int accountIndex = -1;
|
|
||||||
int characterIndex = -1;
|
|
||||||
|
|
||||||
std::map<int, CharacterData> characterMap;
|
|
||||||
std::map<int, CombatData> combatMap;
|
|
||||||
std::map<int, enemyData> enemyMap;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -72,6 +72,8 @@ union SerialPacket {
|
|||||||
COMBAT_ENTER,
|
COMBAT_ENTER,
|
||||||
COMBAT_EXIT,
|
COMBAT_EXIT,
|
||||||
|
|
||||||
|
COMBAT_UPDATE,
|
||||||
|
|
||||||
COMBAT_REJECTION,
|
COMBAT_REJECTION,
|
||||||
|
|
||||||
//character data
|
//character data
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
--TODO: Rename the SQL's tables, for consistency
|
||||||
-------------------------
|
-------------------------
|
||||||
--Server
|
--Server
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user