BungeeTabListPlus icon indicating copy to clipboard operation
BungeeTabListPlus copied to clipboard

Weird errors while loading tablists

Open DanielAlves123 opened this issue 4 years ago • 30 comments

18:21:21 [WARNING] [BungeeTabListPlus] There have been 65 warnings while loading plugins/BungeeTabListPlus/tabLists/tab.yml WARNING: Error in placeholder ${viewer arenaAttackingPlayers-1}: Unknown placeholder in 'reader', line 209, column 10: - {text: "${viewer arenaAttackingPlayers-1}"} ^

Whats that? Newest build Config with tab: components:

  • {text: "${viewer arenaAttackingPlayers-1}"}

DanielAlves123 avatar Apr 03 '20 16:04 DanielAlves123

If that placeholder actually works then the plugin will remember that after the first time someone visits the server with that placeholder and you won't see the warning again.

CodeCrafter47 avatar Apr 03 '20 16:04 CodeCrafter47

@CodeCrafter47 ye I think it works but why the warning?

DanielAlves123 avatar Apr 03 '20 16:04 DanielAlves123

I want to print warning when people misspell placeholders. Unfortunately the plugins doesn't know about all of the placeholders when loading the config - so there might be some false warnings. However any placeholders from the bridge plugin and PlaceholderAPI which the plugin figures out to actually work it will remember and not print the warning anymore next time you restart the server.

CodeCrafter47 avatar Apr 03 '20 16:04 CodeCrafter47

@CodeCrafter47 can you tell me what to change exactly so i can refresh variables every 3 seconds for example? Why do you need task every 2 ticks? Also how do you determine playerset from redis now?

DanielAlves123 avatar Apr 03 '20 16:04 DanielAlves123

@CodeCrafter47 it updates variable immedietely... how to check what playercount is getting from redisbungee or global?

DanielAlves123 avatar Apr 03 '20 17:04 DanielAlves123

it updates variable immedietely...

If you think somethings wrong please describe in detail the behavior you observe.

how to check what playercount is getting from redisbungee or global?

You want to do that for debugging or to display it on the tab list? For debugging I recommend using commands provided by BungeeCord and RedisBungee. To display it on the tab list - have a look at the wiki page on displaying player counts and use the redisbunge proxy id placeholder to create the player sets you need.

CodeCrafter47 avatar Apr 03 '20 17:04 CodeCrafter47

@CodeCrafter47 where is the code from getting playercount from redis or global? It was before in Placeholder class When I change to 60 ticks variables still updates right away..

DanielAlves123 avatar Apr 03 '20 17:04 DanielAlves123

Player counts are updated whenever a player joins/ leaves the server. Note that the plugin only updates the slot where you display the player count. So it is very efficient.

CodeCrafter47 avatar Apr 03 '20 17:04 CodeCrafter47

@CodeCrafter47 I want to create custom placeholder to get playcount from redis how can I do that can you tell me? BTW. Variables refresh too fast even with ticks set to 60.

DanielAlves123 avatar Apr 03 '20 19:04 DanielAlves123

If you display a player count as explained on the following wiki page it will include all players on other proxies (assuming your RedisBungee is set up correctly): https://github.com/CodeCrafter47/BungeeTabListPlus/wiki/Configuration-Basics-Part-4---Player-sets.

Variables refresh too fast even with ticks set to 60

Which ones? How do you notice looking at the tab list or do you have some debug output in your custom variable code (if that's what you're doing)?

CodeCrafter47 avatar Apr 03 '20 19:04 CodeCrafter47

@CodeCrafter47 i'm looking at the tablist and custom variables created by bukkit plugins. How to create variable like that but with player count? https://github.com/CodeCrafter47/BungeeTabListPlus/blob/4688e62d6a990aae7321214a218c45b6a89fc74a/bungee/src/main/java/codecrafter47/bungeetablistplus/data/BTLPBungeeDataKeys.java#L39

DanielAlves123 avatar Apr 03 '20 19:04 DanielAlves123

@CodeCrafter47 i'm looking at the tablist and custom variables created by bukkit plugins.

That shouldn't be the case. I'll check it out tomorrow.

How to create variable like that but with player count?

Just don't. Use ${playerset:all_players size} to display the number of players. This works with RedisBungee.

CodeCrafter47 avatar Apr 03 '20 19:04 CodeCrafter47

@CodeCrafter47 I'm creating a little bit complicated thing and this system isn't working for me, is there a way to create 1 variable specifically for redisbungee player count?

DanielAlves123 avatar Apr 03 '20 19:04 DanielAlves123

I'm fairly certain the system would work for you - but if you must do you own thing I won't stop you. BungeeTabListPlus has an API for adding custom variables on BungeeCord which works quite similar to the one on Bukkit. You can use that.

CodeCrafter47 avatar Apr 03 '20 19:04 CodeCrafter47

@CodeCrafter47 java.lang.NoClassDefFoundError: codecrafter47/bungeetablistplus/api/bungee/ServerVariable Caused by: java.lang.ClassNotFoundException: codecrafter47.bungeetablistplus.api.bungee.ServerVariable BungeeTabListPlusAPI.registerVariable(this, new PlayerCountVariable("redis-player-count"));

DanielAlves123 avatar Apr 03 '20 20:04 DanielAlves123

Please follow the instructions on the wiki on using the API: https://github.com/CodeCrafter47/BungeeTabListPlus/wiki/Developers#bungee-side-api.

CodeCrafter47 avatar Apr 03 '20 20:04 CodeCrafter47

@CodeCrafter47 22:26:55 [WARNING] Circular dependency detected: RedisBungee -> BungeeTabListPlus -> RedisBungee 22:26:55 [WARNING] BungeeTabListPlus (required by RedisBungee) is unavailable 22:26:55 [WARNING] Failed to enable RedisBunge

DanielAlves123 avatar Apr 03 '20 20:04 DanielAlves123

I think the error message there is kind of self explanatory.

CodeCrafter47 avatar Apr 04 '20 07:04 CodeCrafter47

@CodeCrafter47 not really, can you tell how to fix that? Addind depends to Redisbungee or BTLP doesn't work. It shows this warning or ClassNotFoundException

DanielAlves123 avatar Apr 04 '20 08:04 DanielAlves123

That's because BTLP depends on RedisBungee. Thus RedisBungee cannot depend on BTLP. If you make RedisBungee depend on BTLP then you got a circular dependency. Which BungeeCord even explains to you with this illustration: RedisBungee -> BungeeTabListPlus -> RedisBungee. A dependency declaration is used to tell BungeeCord which plugin to load first. If RedisBungee needs to be loaded before BTLP and BTLP needs to be loaded before RedisBungee, then that's kind of a problem, which BungeeCord solves by not loading redisbungee.

CodeCrafter47 avatar Apr 04 '20 08:04 CodeCrafter47

I've just tested the update interval of variables registered using the BukkitBridge API. I've created a variable that displays the result of System.currentTimeMillis. Since that changes every millisecond it's easy to observe how often it is updated on the tab list. I've tried this with both the player and the server variables. In both cases the variable was updated once every second.

public String getReplacement(Player player) {
    return System.currentTimeMillis()+"";
}

CodeCrafter47 avatar Apr 04 '20 08:04 CodeCrafter47

@CodeCrafter47 ye I solved that by adding this to another plugin. Every second, if you change in bukkit to 60 ticks it still updates too fast.

DanielAlves123 avatar Apr 04 '20 09:04 DanielAlves123

I've just tested that too. If I change the period in the line I've indicated to you to 60 ticks it updates exactly every 3 seconds.

CodeCrafter47 avatar Apr 04 '20 09:04 CodeCrafter47

@CodeCrafter47 it works for me too now.

DanielAlves123 avatar Apr 04 '20 09:04 DanielAlves123

@CodeCrafter47 java.lang.IllegalArgumentException: Unsupported size 80

DanielAlves123 avatar Apr 04 '20 17:04 DanielAlves123

Can you give me a bit more context. What are doing? Which version of minecraft?

CodeCrafter47 avatar Apr 04 '20 18:04 CodeCrafter47

@CodeCrafter47 how to change refresh time of bungee variables?

DanielAlves123 avatar Apr 06 '20 17:04 DanielAlves123

https://github.com/CodeCrafter47/BungeeTabListPlus/blob/master/bungee/src/main/java/codecrafter47/bungeetablistplus/managers/DataManager.java#L90

CodeCrafter47 avatar Apr 07 '20 06:04 CodeCrafter47