I'm writing a hybrid program that sends a struct containing vectors of sprites from the server to the client when a change has been made (New bullets added, new enemy added, enemy or bullet deleted). The program frequently adds several enemies to the vector in the struct.
The sending and receiving of the struct seems to work correctly, but when i attempt to memcopy the struct into the struck on the client program the program crashes. I'm unsure if i have to re-size the struct or how to do this, or if there is another solution to this.
Here is my struct:
struct map{
Player Player1;//DECLARE Player SPRITE
vector<Bullet> Bullets;
vector<Enemy*> Enemies;
}Map;
char Buffer[100];
and this is the function i have is used after the struct has been received:
memcpy(&Map, Buffer, sizeof(Buffer));
MessageBox (NULL, "Memcopied", "HelloMsg", MB_OK);
I will be very grateful of any help, Thank You