Im develop my own game, And i use google play games services to add multiplayer features.
I have a problem with the data messages transfer. In default the message object is byte[], And its easy to transfer object like int, char, and cast they back.
My problem is to transfer objects i created.
Worked example:
When sending data:
int a = 0;
mMsgBuf[0] = (byte) a;
When reciving:
int a = (int) mMsgBuf[0];
Now i want to send my object, But i need to transfer him to a byte (not byte array), and put him in mMsgBuf[X].
How can i do that?
Edit Its easy to convert object to byte[], but The messages transfer is a byte[]. I'm consulting about how to transfer the message (As we know - byte[]) with my objectbyte[], Maybe merge the two arrays?