Jump to content

Recommended Posts

Posted

Basically what I am doing is that, I has some waypoints in which you can share with other people, the only thing is, is that if the person who shared the waypoint updates that waypoint, it will not change for anyone else who they have shared the waypoint with. So what I am wondering is what would be the best way to send an updated waypoint packet to everyone else who the waypoint is shared with.

Posted

Since I send the update message from the actual packet what would be the best thing to go with to send to players, a String array or a List of Strings since I am storing the name of players the waypoint has been shared with, also how would I send their data through the packet since I know you can send strings, but not string arrays or lists.

Posted

to write a string array do the following:

write the size of the array to the buf.

after that write each string to the buf.

 

to read it.

read the size of the array from the buff

for(i=0; i<size;i++) read the string

Posted

the way my waypoints work is that there is two types of waypoints, just a normal "Waypoint", and then there is the "Shared Waypoint", the waypoint is what is created when a user creates a new waypoint, a shared waypoint is what a user receives from other users. The waypoint is editable, but the shared waypoint is not editable, meaning that only the user that shared the waypoint can edit it, and the users who have received that waypoint should get the edited version once the creator of the waypoint clicks the confirm edit button. I have up to the point so that it can send the update to a specified player, but I cannot figure out how to send it to all the players that are stored in a List of Strings (it is strings because it stores their usernames). I have the usernames stored in the list instead of an array since to add a new name to an array I would have to create a new array, but instead I can just add it to a list.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.