I'm pretty much at a total loss here. I tried all day yesterday and all night last night to figure out what the hell is wrong with my code but now I'm thinking there's actually a little gremlin in my computer nibbling on the CPU. I was following along with this tutorial series:
until I decided to pause it and make my own custom Packet class. It was working fine for a while but then some really weird stuff started to happen. Basically what's happening is the data sent between client and server is getting jumbled up somehow when it is received (I confirmed that the data was correct before it was sent). This happens at seemingly random points and now I'm baffled
For example I had the line:
System.out.println( m_Game.m_aConnectedPlayers[ intPlayerID ].GetUserName( ) + " has joined." );
and changed it to
System.out.println( m_Game.m_aConnectedPlayers[ intPlayerID ].GetUserName( ) + "(" + intPlayerID + ") has joined." );
to include the player ID, and then the packet data was getting scrambled up when I connected to the server with a third client. Also even as I typed this I decided to go back and test it again and the error stopped happening. I'll grant +100 internet points to whoever can somehow figure this out. I've attached my entire project (excuse my messy code)