Sending an object via sockets - all fields but array updating

I have a client/server multiplayer game application for my final year project at uni.
The clients connect to the server and choose a game to join.

Whenever any client who is connected to that game makes a move, all the other clients need to be updated. The server will then send a GameState of the game to all the clients. The client receives the GameState object and handles it suitably.

The first time each client receives the GameState object works perfectly fine, everything is as it should be.

However any further GameState objects that are received do not work so well. All the normal fields variables areas they should be, changing if they need to be. Every single array that is in the GameState object reverts back to the same array that was received the first time round. Whether the array is of type Player/ int / string - it doesnt matter.

So the client receives the new GameState object with the appropriate values changed apart from all the arrays.

The server is sending the GameState object with the appropriate values (including the arrays). I had it print out the state that it sent and even write it to a file and in both cases the arrays were as they should be.
The client also reads in the object from the file several times and the arrays change as they should. The problem only occurs over sockets.

If I change for datatype, for example:
instead of int[] numbers being [10,20,30,40,50]
I have int1 = 10, int2 = 20, etc
then these values are sent and received correctly, its just when it exists in an array it defaults back to the values that were in the first object.

Without seeing your code it's hard to tell precisely what you're doing wrong. But generally, the thing you need to do is just bang the values from the array down the socket, and at the other end, read them in and set them on the client's copy of the array. There's nothing particularly magical. Perhaps if you show us your code?

OK, now I see what you're doing. The problem is that you're trying to use the same ObjectOutputStream to write the same object, but midway, you're changing the object's state. ObjectOutputStream isn't designed to do this: when you write the same object multiple times, what it actually sends after the firts time is a "marker" saying "repetition of object X". So at the other end, what you receive is a message effectively saying "the same object as last time was sent", without the changes actually being sent.

To get round this problem, possibilities include:
(1) do away with serialization and just write an explicit method to send the bytes/data that you want down the stream
(2) if you want to use serialization, then each time you need to send an object, create a new ObjectOutputStream around a ByteArrayOutputStream, write the object, then actually send the array from the ByteArrayOutputStream. This way, you're effectively "forgetting" the last version of the object sent down the stream and sending a brand new copy.