I am trying to create an Real-Time-Strategy game with processing and to do this i am trying to program a server and client. Both my server and the client that I have created keeps getting the error: "StringOutOfBoundsException: String index out of range: -1".
Substring() doesn´t return an array of Strings, it returns another String, contained in the former. When you apply the substring() method you are removing the 'end of carriage' of the data passed, and when you split() it is when you get the array of Strings. But that´s not the error, only a misunderstanding... Mmm... I see you are using a lot of Team arrays but they aren´t instantiated anywhere (TeamTwoXY=new int, i.e.). Is this the complete code?