Branch 'dev-char' is stable, merging into 'dev'
This commit is contained in:
@@ -23,10 +23,13 @@
|
||||
#define SERVERAPPLICATION_HPP_
|
||||
|
||||
#include "utilities.hpp"
|
||||
#include "packet_type.hpp"
|
||||
#include "packet.hpp"
|
||||
#include "singleton.hpp"
|
||||
#include "network_queue.hpp"
|
||||
|
||||
#include "client_entry.hpp"
|
||||
#include "player_entry.hpp"
|
||||
|
||||
#include "config_Utility.hpp"
|
||||
#include "udp_network_utility.hpp"
|
||||
#include "vector2.hpp"
|
||||
@@ -40,25 +43,6 @@
|
||||
//lazy
|
||||
typedef std::chrono::high_resolution_clock Clock;
|
||||
|
||||
struct ClientData {
|
||||
int index;
|
||||
int channel;
|
||||
int playerIndex;
|
||||
};
|
||||
|
||||
struct PlayerData {
|
||||
int index;
|
||||
int clientIndex;
|
||||
std::string handle;
|
||||
std::string avatar;
|
||||
Vector2 position;
|
||||
Vector2 motion;
|
||||
|
||||
void Update(double delta) {
|
||||
position += motion * delta;
|
||||
}
|
||||
};
|
||||
|
||||
class ServerApplication {
|
||||
public:
|
||||
ServerApplication();
|
||||
@@ -74,10 +58,10 @@ private:
|
||||
void UpdateWorld(double delta);
|
||||
|
||||
//network loop
|
||||
int HandlePacket(Packet p);
|
||||
void HandleBroadcast(BroadcastRequest&);
|
||||
void HandleConnection(JoinRequest&);
|
||||
void HandleDisconnection(Disconnect&);
|
||||
int HandlePacket(Packet::Packet p);
|
||||
void HandleBroadcast(Packet::BroadcastRequest&);
|
||||
void HandleConnection(Packet::JoinRequest&);
|
||||
void HandleDisconnection(Packet::Disconnect&);
|
||||
|
||||
//services
|
||||
ConfigUtility* configUtil = Singleton<ConfigUtility>::Get();
|
||||
@@ -86,8 +70,8 @@ private:
|
||||
//members
|
||||
Clock::time_point lastTick = Clock::now();
|
||||
|
||||
std::map<int, ClientData> clients;
|
||||
std::map<int, PlayerData> players;
|
||||
std::map<int, ClientEntry> clients;
|
||||
std::map<int, PlayerEntry> players;
|
||||
|
||||
bool running = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user