sillerud / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
http://www.spigotmc.org/threads/bungeecord.392/
Other
24 stars 25 forks source link

Add in support to set the summary array of players in 1.7 json pings #4

Closed fuzzybot closed 10 years ago

fuzzybot commented 10 years ago

Example on usage (similar to how you do it in upstream bungee 1.7.2): https://gist.github.com/mccore/7595129

odensc commented 10 years ago

@TheUnnamedDude Not the same implementation of this pull? Some plugins may use PlayerInfo. Maybe a gist of how to use this implementation?

sillerud commented 10 years ago

It would work the same way, you are just not able to set the "id"

literalplus commented 10 years ago

I can understand that you might want to save an object, but I think the current implementation must give different JSON output than the PR - Something like

         sample: [ "player1", "player2"]

, the PR should give

         sample: {{name: "player1", id: "aaaa"}, {name: "player2", id: "aaaa"}}

Does it work the same way, actually?

odensc commented 10 years ago

@TheUnnamedDude But there is no PlayerInfo, which the pull added.

sillerud commented 10 years ago

It was fixed in the last commit

odensc commented 10 years ago

@TheUnnamedDude This doesn't seem to be working? It says the server is outdated when I modify the sample, but when I modify anything else it works fine. Using this code: https://gist.github.com/thesbros/47df1ede2611f62d9be0

literalplus commented 10 years ago

@thesbros Can you try your test code with your PR code and give the output JSON of both? We might prove a point this way :P

odensc commented 10 years ago

@xxyy My code worked fine with this pull. But when TheUnnamedDude merged it and changed it, it did not work. If I use this pull and switch the code to work with it then it works fine. I'll just stick with my fork that has this merged until he tells me how to use it and / or fixes it (not sure if its broken or if I just don't know how to use it)

literalplus commented 10 years ago

@thesbros See https://github.com/TheUnnamedDude/BungeeCord/pull/4#issuecomment-29231010 - I think this is the problem. It could help if you provided the generated JSON for both methods (Use you IDE's Debug function along with this VM attach thing: http://forums.bukkit.org/threads/tutorial-remote-debugging-with-bukkit.92081/ (This is for Eclipse, but it works very similar in NetBeans))

odensc commented 10 years ago

@xxyy I'm using Eclipse. On it, brb!

odensc commented 10 years ago

@xxyy Bleh, nothing is working, java outdated, won't start with those params, accidentally exported nothing and already switched libraries..... Sorry, can't do it D: Here's the code that wasn't working if you want to try: https://gist.github.com/thesbros/47df1ede2611f62d9be0 for the pull code, just use the gist that the pull desc has. Here's the pull jar: REMOVEDEDEDEDSTUFFVIRUSESWAAT

literalplus commented 10 years ago

@thesbros Oh, I hate those sites where there are 5 download buttons and 4 of them install viruses on your system :-1: JSON with this PR:

{
   "version":{
      "name":"1.6.2-1.7.3",
      "protocol":4
   },
   "players":{
      "max":1,
      "online":0,
      "sample":[
         {
            "name":"§l§e---------------------------",
            "id":"aaaa"
         },
         {
            "name":"§l§7fuzzy_bot",
            "id":"aaaa"
         },
         {
            "name":"§l§e---------------------------",
            "id":"aaaa"
         }
      ]
   },
   "description":"Just another BungeeCord - Forced Host"
}

And here's the JSON for the current implementation (Note that it DOES NOT work, I believe the client error does not mean "wrong version" but "invalid JSON".

{
   "version":{
      "name":"1.6.2-1.7.3",
      "protocol":4
   },
   "players":{
      "max":1,
      "online":0,
      "sample":[
         {
            "name":"hi"
         },
         {
            "name":"bye"
         }
      ]
   },
   "description":"Just another BungeeCord - Forced Host"
}

(Seems the issue I saw before has been fixed - Still, the client seems to miss the "id" very badly - I suggest something like UUID#randomUUID().)

important edit: Look what I found in the Client Console :)

[23:17:52 INFO]: Client> [23:17:52] [Client thread/ERROR]: Can't ping localhost:4242: Internal Exception: io.netty.handler.codec.DecoderException: com.google.gson.JsonSyntaxException: Missing id, expected to find a string