My sending and receiving method in depth
Ok I will go over the method of which I send and receive the data currently
First I have the values prepared nice within the game (x, y, rotation, etc.). And then I make an object and give it an array in which I add all the above values and others.
From there I write the object to a bytearray and compress it. Then I use Base64 to encode the bytearray to a string. Then I send the string over with the server, the string is about 75 to 120 characters long, IDK.
And when I receive the text on the other end I decode the string to a bytearray again, I decompress it, and then I create a new object from the object read off the byte array.
After that I just simply check a few things within the array that was placed on the object by another client with some ifs. Such as finding out which username it belongs to, if its an update to a player, if a player just joined, etc. And then if everything checks out with say it was an update to a player, it sets all the values (such as x, y, rotation) to the child with the name of the players username that is provided in the array