Forum Multiplayer Sending a map (array ?)

Discussion and help relating to the PlayerIO Multiplayer API.

Sending a map (array ?)

Postby Bloof » May 26th, 2011, 4:20 pm

Hello,

I'd like to send a map structure to the players but i don't know what is the best way to do that, i'm used to serialize an array (with json) but it doesn't look possible with player.io.

I've read this topic and at the moment i'm thinking about playing with my datas joined with commas within a string but it doesn't look clean to me so i was wondering how you are doing it.
Bloof
 
Posts: 2
Joined: May 26th, 2011, 4:13 pm

Re: Sending a map (array ?)

Postby Benjaminsen » May 26th, 2011, 6:35 pm

Depending on the size of the array I do two things.

1: For small arrays I just add all elements as properties on a message object
2: for large arrays I serialize the array to a bytearray
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Sending a map (array ?)

Postby Bloof » June 6th, 2011, 4:11 pm

Thanks Benjaminsen.

I'm in the second situation but the bytearray concept is a bit blurry to me (maybe not the better place to talk about that though). As i understand it, it's an array of bytes (ho ho) which contain items values between 0 and 255.

I want to send values > 255 of course and i guess there's a simple and logical way to handle that but i don't get it; as i don't get the .ToByte method either.
Bloof
 
Posts: 2
Joined: May 26th, 2011, 4:13 pm

Re: Sending a map (array ?)

Postby Benjaminsen » June 6th, 2011, 5:15 pm

ByteArrays have all types of convience methods such as writeInt
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Sending a map (array ?)

Postby womoxey683 » January 19th, 2022, 9:55 am

I am using the best Garmin map and the latest Garmin GPS update are available in their official site so you can also try this and enjoy the services.
womoxey683
 
Posts: 3
Joined: January 19th, 2022, 7:52 am


Return to Multiplayer



cron