Best method for handling invisibility across plugins?

Discussion in 'Plugin Development' started by SaxSalute, Jul 14, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    SaxSalute

    I'm working with a set of plugins in which invisibility is used for players to spectate other players after they have died. All of these plugins have access to one core plugin with common methods, custom events, etc. I'm concerned about the best way to make sure that players always have the correct visibility set. My current best idea is just to make everybody mutually visible at login since new logins are always brought to a spawn location where everybody should be visible. However, I'm concerned about how that solution will scale with many players online. My instinct is that running setVisible on every player at every login is a dumb idea, but I don't know how else to handle a case such as an invisible player logging off then logging back in and remaining invisible since they logged out before they were set to visible. I could fix their visibility at logoff, but that would just displace the toll on the server. Any ideas?
     
  2. Create a List<String> of players that had been hidden. When they login again check if they are in the list and show them, removing them from the list.
     
  3. Offline

    ResultStatic

    SaxSalute when dealing with storing lots of player information. i would use objects per player, this will also let u serialize and deserialize their data into config file easier and manage their data better. that would create a nice place to store money, kills, stats and whatever else you want to store. you could have a class in ur core plugin named User, and initialize it on join.
     
Thread Status:
Not open for further replies.

Share This Page