Merge remote-tracking branch 'origin/Networking' into Networking

# Conflicts:
#	include/Engine/Network/NetworkDefinitions.h
#	include/Game/Game.h
#	src/Engine/Network/Client.cpp
#	src/Game/Game.cpp
This commit is contained in:
Jocke
2015-12-10 14:39:01 +01:00
40 changed files with 1173 additions and 256 deletions
+5
View File
@@ -42,12 +42,17 @@ private:
void ParseServerPing();
void ParseSnapshot(char* data, size_t length);
void CreateNewPlayer(int i);
void IdentifyPacketLoss();
// udp stuff
boost::asio::ip::udp::endpoint m_ReceiverEndpoint;
boost::asio::io_service m_IOService;
boost::asio::ip::udp::socket m_Socket;
// Packet loss logic
unsigned int m_PacketID = 0;
unsigned int m_PreviousPacketID = 0;
World* m_World;
int m_PlayerID = -1;
glm::vec2 m_PlayerPositions[MAXCONNECTIONS];
@@ -7,6 +7,7 @@
#define BOARDSIZE 16
#define MAXCONNECTIONS 8
#define INPUTSIZE 128
#define PACKETMODULUS 1000 // How many packets to send before the number resets
#define PLAYERSPEED 0.2f;
typedef boost::shared_ptr<boost::asio::ip::udp::socket> socket_ptr;
+5
View File
@@ -32,6 +32,11 @@ private:
std::clock_t m_StopTimes[8];
// Game logic
World* m_World;
// Packet loss logic
unsigned int m_PacketCounter = 0;
unsigned int m_PacketID = 0;
const unsigned int m_PacketModolus = 1000;
// Close logic
bool m_ThreadIsRunning = true;
// Threaded