bStats icon indicating copy to clipboard operation
bStats copied to clipboard

Differentiate between 'regular' offline-mode and offline-mode due to BungeeCord

Open lucko opened this issue 7 years ago • 11 comments

The "Online mode" statistic is a really nice thing to be able to refer to, however, it's usefulness is limited as the statistic doesn't truly represent the state. Servers which use BungeeCord will report as being 'offline' - when in most cases, they're are in fact authenticating, just via the proxy.

I notice the setting is currently represented by an integer (although I assume it may be converted to a boolean at some point internally??): https://github.com/BtoBastian/bStats-Metrics/blob/master/bstats-bukkit/src/main/java/org/bstats/bukkit/Metrics.java#L215

Perhaps a third value could be added there using a value of 2 for Offline due to BungeeCord.

This would mean 'Online mode' would have the following possible values:

  • Online
  • Offline
  • Offline (BungeeCord)

lucko avatar Jan 14 '18 20:01 lucko

The problem is, that there's no reliable way to check if a server is running behind a Bungeecord proxy or not.

Bastian avatar Jan 14 '18 20:01 Bastian

boolean isBungee = Bukkit.getServer().spigot().getConfig().getBoolean("settings.bungeecord", false);

lucko avatar Jan 14 '18 21:01 lucko

@lucko Still not a reliable way to check. The option can be false while using or not using BungeeCord.

RadBuilder avatar Jan 14 '18 21:01 RadBuilder

Without the option set, your server effectively is running in offline mode, as the server doesn't attempt to authenticate itself, and it doesn't use the data forwarded by the proxy.

It absolutely is reliable.

In the case given above:

  • Online --> The server is authenticating itself.
  • Offline --> The server is not authenticating, at all.
  • Offline (Bungee) --> The server may or may not be authenticating, but we do at least know it's running behind a proxy - not just plain offline mode.

lucko avatar Jan 14 '18 21:01 lucko

my server in offline mode behind bungee with bungeecord true :thinking:

ghost avatar Jan 14 '18 21:01 ghost

There's an additional issue that the server may be vanilla forge and entirely trusting bungee to auth.

But having at least some measure is better then none, but it would take a long, long time for the stats to correlate as people updated.

ryantheleach avatar Jan 15 '18 02:01 ryantheleach

That's indeed an other problem: If I change it now, the chart would be completely useless for quite a long time

  • Online -> Normal server with online mode true
  • Offline -> Maybe a server which uses an old bStats version and is behind a bungeecord, maybe it's not authenticated at all and maybe it's behind a bungeecord but hasn't the option enabled.
  • Offline (Bungeecord) -> The server may or not be authenticated, but at least it seems like it's using Bungeecord

I would rather create a new "Uses Bungeecord" pie-chart than modifying the old one. That's doesn't solve the issue with the online-mode chart ofc. and it may also contain false-positives.

Bastian avatar Jan 15 '18 09:01 Bastian

If I change it now, the chart would be completely useless for quite a long time

You're effectively saying: I'm not going to bother to ever update my software because some people won't update to the new versions. In my opinion that is totally crazy. :)

A new chart will kind of solve it, but I still think it's less useful.

The aim is to be able to see the distribution of online mode servers to offline mode servers - without the added interference from offline mode due to a proxy. Adding a separate chart for Bungee/Not Bungee doesn't really solve that.

You're right, for a while the data won't be representative, but it's not representative at the moment either! (hence the reason for this issue) As more people update their bStats version, the data will become more accurate.

lucko avatar Jan 15 '18 13:01 lucko

Adding a chart for Bungee/Not Bungee would effectively solve it. As you can have the new counts that would be a somewhat accurate sample (disregarding biases)

As more things update, the sample size merely gets larger. You could always add a onlinemode-nobungee and a offlinemode-nobungee to that same new chart, and get the information you are looking for but in a smaller sample.

ryantheleach avatar Jan 16 '18 00:01 ryantheleach

@o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o0o It would be more for global tracking then anything, doesn't necessarily have to show on your plugins page.

If you would like to have things hidden from your plugins page, I suggest you make a separate issue allowing the customization of plugin pages.

Also, did you really need to choose an intentionally disruptive github username?

ryantheleach avatar Jan 18 '18 08:01 ryantheleach

There is another possible way to detect whether or not a server is using online-mode or offline-mode: The UUID of a player which will always be a version 4 UUID for online-mode and a version 3 UUID for offline-mode. This requires at least one player being logged in though or some kind of accessing of the player files/cache.

Phoenix616 avatar Mar 20 '18 18:03 Phoenix616