Synchronization works

This commit is contained in:
Kayne Ruse
2013-06-24 21:46:11 +10:00
parent 42f9c5e1df
commit ebd8c5e6fc
6 changed files with 57 additions and 33 deletions
+4 -12
View File
@@ -90,9 +90,10 @@ struct Disconnect {
struct Synchronize {
Metadata meta;
int clientIndex;
};
struct PlayerNew {
struct PlayerData {
Metadata meta;
int playerIndex;
int clientIndex;
@@ -109,14 +110,6 @@ struct PlayerDelete {
int clientIndex;
};
struct PlayerUpdate {
Metadata meta;
int playerIndex;
int clientIndex;
Vector2 position;
Vector2 motion;
};
union Packet {
Packet() {
meta.type = Type::NONE;
@@ -133,11 +126,10 @@ union Packet {
JoinResponse joinResponse;
Disconnect disconnect;
Synchronize sync;
Synchronize synchronize;
PlayerNew playerNew;
PlayerData playerData;
PlayerDelete playerDelete;
PlayerUpdate playerUpdate;
#ifdef DEBUG
char buffer[1024];