Get Player Name when player browses Server List

Discussion in 'Plugin Development' started by RAFA_GATO_FOFO, May 18, 2014.

Thread Status:
Not open for further replies.
  1. Hey,

    I've been messing around with the ServerListPingEvent trying to get a players name.
    I know this is possible because of this:
    Show Spoiler

    [​IMG]


    The server thewallspvp.com has this feature and although it's no good use for me since I don't really own a server I'd like to know how to code it.
    If anyone knows anything about this please post below.

    and to RawCode, please don't post on this thread.
     
  2. Offline

    Nonam82

    You can get the IP that pinged it, but not their username. If you want to show their username, you'll have to store players' names with their IPs when they log in, then use that information on a server list ping event.
     
  3. Nonam82

    Yeah I know that far, I've googled before posting here.
     
  4. Offline

    Garris0n

    LOL RawCode

    Create an internal map of IP -> Username/UUID and use that. It won't work particularly well, for example if there are multiple players per IP or the player's IP changes, but that's the best you can do.
     
    AdamQpzm likes this.
  5. Garris0n

    You've just said the exact same thing as Nonam82 up above and I've already answered that. If you've got nothing helpful to add why bother.
     
  6. Offline

    Adriani6

    RAFA_GATO_FOFO
    What exactly are you expecting then ? That's the only way possible, which answers your question.
     
    Garris0n likes this.
  7. Offline

    Garris0n

    Technically, I added information.
     
    Adriani6 likes this.
  8. Offline

    RawCode

    what about posting your coding attempts?

    I've been messing around with the ServerListPingEvent trying to get a players name. RAFA_GATO_FOFO

    show us what you have done, currently you ask for spoonfeeding - plugin request section located elsewhere.
     
    Garris0n likes this.
  9. RawCode
    Can you not read? Fuck off.
     
  10. Offline

    marwzoor

    No need to be mean here!

    If you know how to handle MySQL databases then just store the player name and ip whenever they log in. Else you just save the names with their IP in a .yml file. You will as Garris0n said sometimes get multiple players per IP. I just randomize between them if that happens. It doesn't really matter that much, it's still cool!
     
  11. RAFA_GATO_FOFO While I suspect that your aversion to RawCode is due to your belief that he is immature and/or unhelpful, I would like to tell you that you're coming off as immature and ungrateful. You're under absolutely no obligation to pay any attention to what he says, but you are obliged to follow the rules and be polite to people.

    The simplest and most mature solution to this issue you have with him? If he posts something which you do not find helpful, ignore him. By telling him not to read the thread and swearing at him/insulting him you only make sure that he definitely won't try to help you. If he's a certain type of person, it will even make him more likely to post again with the intention of irritating you.

    Or maybe that's what you were going for all along, who knows.
     
  12. Offline

    Garris0n

    What exactly do you want? You've been given the answer to your question a few times over. If you are satisfied, please mark the thread as solved. Otherwise, ask follow-up questions or explain what it is you need.
     
    xMrPoi likes this.
  13. Offline

    xMrPoi

    There is no need to be rude here as everyone so far has helped you. All of the solutions given will work.
     
  14. Offline

    Smerfa

    Hyym, I have plugin for that, with many options like counting time, and API - so you can add own "variables"...
    But description is in Polish and no on Bukkit.dev ;P
    I still writing second version with much more options and for bukkit.dev, but that can take some time :< (I don't have much of it :p)

    So IP is only way... about storing it, for me - it's better to save nick for every IP, so you can't get 2 this same IP - only last one will be saved - less memory :p
    Or you can create some more advanced system... save IP for every nickname and when selecting, skip players that are online, and players that don't player on server for long time - bigger change to select good nickname :p
     
  15. Offline

    Azubuso

    RawCode Somebody doesn't seem too fond of you huh.. :eek:

    RAFA_GATO_FOFO Your answer is right in the thread, you won't be able to just get the player's name without having them on the server at least once and keeping track of their IPs in whatever way you decide to it.
     
  16. You guys seem to not understand what helping means actually.
    I already know that I can store the players IP and names and relate them. As I've said in my second post: "(...) I know that far, I've googled before posting here."

    If you don't know any other way of doing this or you do know that this is in fact the only way to do it you can simply post: "There's no other way of doing it."
    instead of posting the same thing over and over again.

    And I won't even mention a certain member of this forum who acts like an absolute troll in every thread claiming the person asking for help is requesting spoon-feeding. If you look up his comments they're all the same and he never actually helps anyone because he simply doesn't know anything.
     
  17. Offline

    Azubuso

Thread Status:
Not open for further replies.

Share This Page