Merge remote-tracking branch 'origin/Weapons' into Movement
# Conflicts: # resources/Schema/Entities/PlayerDefenderBlue.xml
This commit is contained in:
@@ -10,8 +10,9 @@ namespace Events
|
||||
struct PlayerDeath : Event
|
||||
{
|
||||
//KilledBy,KilledByWhat is optional for now. It might be used later in the playerlog-system
|
||||
EntityWrapper Player;
|
||||
std::string KilledByWhat;
|
||||
EntityWrapper Player = EntityWrapper::Invalid;
|
||||
EntityWrapper Killer = EntityWrapper::Invalid;
|
||||
std::string KilledByWhat = "";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ protected:
|
||||
|
||||
const std::string m_ComponentType;
|
||||
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& component, double dt) = 0;
|
||||
virtual void UpdateComponent(EntityWrapper& entity, ComponentWrapper& scoreScreen, double dt) = 0;
|
||||
};
|
||||
|
||||
class ImpureSystem : public virtual System
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
|
||||
void LoadBindings(std::string file);
|
||||
void Update(double dt);
|
||||
void Process();
|
||||
void Process(bool suppressNewEvents = false);
|
||||
template <typename T>
|
||||
void AddHandler();
|
||||
void Publish(const Events::InputCommand& e);
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
void Connect(std::string address, int port);
|
||||
void Update() override;
|
||||
private:
|
||||
UDPClient m_Unreliable;
|
||||
//UDPClient m_Unreliable;
|
||||
TCPClient m_Reliable;
|
||||
std::vector<Events::PlayerSpawned> m_PlayerSpawnEvents;
|
||||
void parseSpawnEvents();
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef Events_KillDeath_h__
|
||||
#define Events_KillDeath_h__
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
typedef unsigned int PlayerID;
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct KillDeath : public Event
|
||||
{
|
||||
PlayerID Casualty = -1;
|
||||
PlayerID Killer = -1;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef Events_PlayerConnected
|
||||
#define Events_PlayerConnected
|
||||
|
||||
#include "Core/EventBroker.h"
|
||||
|
||||
namespace Events
|
||||
{
|
||||
|
||||
struct PlayerConnected : public Event
|
||||
{
|
||||
std::string PlayerName = "";
|
||||
int PlayerID = -1;
|
||||
};
|
||||
|
||||
}
|
||||
#endif // !Events_PlayerConnected
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "Core/EEntityDeleted.h"
|
||||
#include "Core/EComponentDeleted.h"
|
||||
#include "Core/EAmmoPickup.h"
|
||||
#include "Core/EPlayerDeath.h"
|
||||
#include "Network/EPlayerConnected.h"
|
||||
#include "Network/EKillDeath.h"
|
||||
|
||||
class Server : public Network
|
||||
{
|
||||
@@ -33,7 +36,7 @@ public:
|
||||
private:
|
||||
// Network channels
|
||||
TCPServer m_Reliable;
|
||||
UDPServer m_Unreliable;
|
||||
//UDPServer m_Unreliable;
|
||||
UDPServer m_ServerlistRequest;
|
||||
// dont forget to set these in the childrens receive logic
|
||||
boost::asio::ip::address m_Address;
|
||||
@@ -77,7 +80,8 @@ private:
|
||||
void parseOnPlayerDamage(Packet& packet);
|
||||
void identifyPacketLoss();
|
||||
void kick(PlayerID player);
|
||||
PlayerID GetPlayerIDFromEndpoint();
|
||||
PlayerID getPlayerIDFromEndpoint();
|
||||
PlayerID getPlayerIDFromEntityID(EntityID entityID);
|
||||
void parsePlayerTransform(Packet& packet);
|
||||
void parseOnInputCommand(Packet& packet);
|
||||
void parseClientPing();
|
||||
@@ -103,6 +107,8 @@ private:
|
||||
bool OnPlayerDamage(const Events::PlayerDamage& e);
|
||||
EventRelay<Server, Events::AmmoPickup> m_EAmmoPickup;
|
||||
bool OnAmmoPickup(const Events::AmmoPickup& e);
|
||||
EventRelay<Server, Events::PlayerDeath> m_EPlayerDeath;
|
||||
bool OnPlayerDeath(const Events::PlayerDeath& e);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user