Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

have a list of all players that are receiving the waypoint and

for(string pName : list)

if(!pName.equals(editingplayer.name)

  sendmessage(msg, world.getplayer(pname);

 

can't be copy pasted but you can use that structure to updated everyone you need to.

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

  • Author

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.

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

  • Author

the thing is is that I cannot use a string array since every time someone shares the waypoint with someone else it must add a player name to the list.

  • Author

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.