WIP Reliable Message

This commit is contained in:
Jocke
2016-02-03 10:28:15 +01:00
parent 06f64f8fbf
commit e133791369
10 changed files with 40 additions and 7 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ public:
~Client();
void Start(World* world, EventBroker* eventBroker) override;
void Update() override;
private:
protected:
// Assio UDP logic
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::asio::io_service m_IOService;
+14
View File
@@ -0,0 +1,14 @@
#ifndef HybridClient_h__
#define HybridClient_h__
#include "Client.h"
class HybridClient : public Client
{
public:
HybridClient(ConfigFile* config);
~HybridClient();
};
#endif
+7
View File
@@ -0,0 +1,7 @@
#ifndef TCPClient_h__
#define TCPClient_h__
#endif
+1 -1
View File
@@ -25,7 +25,7 @@
#include <boost/thread.hpp>
#include "Network/Network.h"
#include "Network/Server.h"
#include "Network/Client.h"
#include "Network/HybridClient.h"
// Sound
#include "Sound/SoundSystem.h"
+12
View File
@@ -0,0 +1,12 @@
#include "Network/HybridClient.h"
HybridClient::HybridClient(ConfigFile * config) : Client(config)
{
}
HybridClient::~HybridClient()
{
}
+1 -1
View File
@@ -271,7 +271,7 @@ void Server::parseOnInputCommand(Packet& packet)
e.PlayerID = player; // Set correct player id
e.Value = packet.ReadPrimitive<float>();
m_EventBroker->Publish(e);
//LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
LOG_INFO("Server::parseOnInputCommand: Command is %s. Value is %f. PlayerID is %i.", e.Command.c_str(), e.Value, e.PlayerID);
}
}
}
View File
+1 -1
View File
@@ -169,7 +169,7 @@ void Game::networkFunction()
bool isServer = m_Config->Get<bool>("Networking.IsServer", false);
if (!isServer) {
m_IsClientOrServer = true;
m_ClientOrServer = new Client(m_Config);
m_ClientOrServer = new HybridClient(m_Config);
}
if (isServer) {
m_IsClientOrServer = true;
+1 -1
View File
@@ -29,7 +29,7 @@ void RayTest(std::string fileName) {
Ray ray(glm::vec3(-50, 0, 0), glm::vec3(1, 0, 0));
//using a
here, else we have to init the renderingsystem
//here, else we have to init the renderingsystem
ResourceManager::RegisterType<RawModel>("RawModel");
auto unitBox = ResourceManager::Load<RawModel>(fileName);
BOOST_REQUIRE(unitBox != nullptr);
+2 -2
View File
@@ -69,8 +69,8 @@ GameHealthSystemTest::GameHealthSystemTest()
m_EventBroker->Publish(e3);
//damage player with 50
Events::PlayerDamage e;
e.DamageAmount = 50.0f;
e.PlayerDamagedID = healthsID;
// e.DamageAmount = 50.0f;
// e.PlayerDamagedID = healthsID;
m_EventBroker->Publish(e);
//heal some other player with 40
Events::PlayerHealthPickup e2;