Solved DELETE

Discussion in 'Spigot Plugin Development' started by TheBlackTeddy, Apr 22, 2017.

  1. DELETE
     
    #1 TheBlackTeddy, Apr 22, 2017
    Last edited: Jan 22, 2021
  2. so i am guess you want on every server on your network you want them to have there rank
     
  3. I would recommend first of all setting up mysql and a shared DATA file with rank info etc
     
    • Optimistic Optimistic x 1
  4. Use a hashmap and save it like every minute
     
  5. have the data stored only ever so often then update the rank on the lobby server or skywars on every new Player join so its more efficient
     
  6. So you want to know how to "transfer" the data from server-1 to server-lobby, right?
    Maybe you could create a Item in the Players enderchest (he can´t see it there) Which stores data in Lore/DisplayName etc.
    And if you want to store the data on logout to the database, retrieve the info from this item.

    If i didn´t got your question right, sorry then^^
     
  7. maldahleh

    Wiki Team

    Look into Redis.
     
  8. Mas

    Mas

    This ^, and use SQL/MongoDB for long-term storage when the player leaves the network altogether.
     
  9. It's not efficient with querying the database every second as long as you use a pool and let bungee itself do it, though?
     
  10. I prefer to use a Redis database for this. But you need to get the rank information for each server, right? Therefore you have either to get the data out of the database when the player joins your bungeecord and send it to each server the player visits, or you do a request from each server to Redis.
    I prefer the last method. Just remove the playerdata from the redis db after the player leaves your server.
     
  11. Might wanna go MassiveCraft style and get Into MongoDb (it should actually be more convenient and easier than MySQL). This would ultimately allow you to access the same documents across the entire network. If you've ever worked with json the documents should look familiar (it's not json, but very same structured and elegant). It can even have nested child objects.

    MongoDb document for example for your player data:

    Code (Text):
    {
      _id: "theiruuidforexample",
      name: "their name",
      rank: {
        level: 3
      },
      kills: 5
    },
    _id: "anotheruuid",
      name: "their name",
      rank: {
        level: 10
      },
      kills: 30
    }
    The _id would be used to access them in the document. Check more of the documentation. Setting up the driver, and managing the databases (all you have to do is to keep track of a singleton object). MongoDb is very well documented and handles all the database exceptions etc. It's much better for both java and js to use this