1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Floating Text of Online players in another server

Discussion in 'Requests' started by rektpixel, Apr 18, 2017.

  1. rektpixel

    rektpixel Baby Zombie

    Messages:
    186
    All the big servers like LifeBoat, BrokenLens, Cookie-Build have a count of players playing the particular game above the NPC. I can't find this plugin anywhere! I imagine this plugin would be simply to make, If someone would be nice enough to do so link the plugin in a reply and maybe I can give something in return :)

    Requirements:
    - To get the amount of online players on a server
    - Able to apply the data to a floating text such as: 'Online: {online}'

    The command to set an online server players floating text should be something like this.. /onlineplayers {IP;PORT}
    Then It will spawn floatingtext with the message 'Online {online}'

    ANY DEVELOPERS UP TO THE CHALLENGE XD
    (I think it'll be a popular plugin since there is no downloadable version of it
     
    Jackins likes this.
  2. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Send a query to a database every few seconds (Create a table in the database with a list of all online players with the name/id of the server) and fetch the data from another server and display them.
    (Don't have time to code it, so I just show the concepts:D)
     
  3. rektpixel

    rektpixel Baby Zombie

    Messages:
    186
    yeah, I would but I have no idea how to do that
     
  4. Jackins

    Jackins Slime

    Messages:
    92
    I also need this and i've making a request.... But ok, some plugins? :0 really need floating text with player on of another server....
     
    rektpixel likes this.
  5. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    You mean you don't know how to send database queries or what?
    Um, I have some time now, maybe I'll code the plugin now.
     
  6. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Coding in progress...
    The SQL player count syncing part is basically like this:
    [​IMG]
     
  7. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    Wouldn't ...
    PHP:
    $this->getServer()->getName()
    ... return PocketMine-MP? Is this intended?
     
  8. Jack Noordhuis

    Jack Noordhuis Zombie Pigman Poggit Reviewer

    Messages:
    618
    GitHub:
    JackNoordhuis
    Why are developers still writing plugins with queries on the main thread? Are there not enough resources around now for you to understand how to implement asynchronous reading/writing?
    Would be better of defining the server name/identifier in a config or using an IP/port combo imo.
     
  9. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Oh I thought it returns the server's name in server.properties
     
    Last edited: Apr 22, 2017
  10. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    I just don't care about those resources. The code above is not for public release. See my Jail plugin on my Github, queries are put on the main thread, and I'm not releasing it on any official PocketMine repositories. Up to the users, they can choose to use it or not.
     
    MC ATECH and corytortoise like this.
  11. rektpixel

    rektpixel Baby Zombie

    Messages:
    186
    omg, cool!
     
  12. Jackins

    Jackins Slime

    Messages:
    92
    News? :)
     
  13. hoyinm14mc

    hoyinm14mc Silverfish

    Messages:
    22
    Ah I'm busy again lol
    Or I turn it open source on Github so people can contribute in the current code?
     
  14. Jackins

    Jackins Slime

    Messages:
    92
    It
    's better!
     
  15. akmalrizki

    akmalrizki Spider

    Messages:
    11
    GitHub:
    Beaconcraft
    has it been successful? because I want to try the code
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.