kangarko / ChatControl-Pro

The ultimate chat solution. Prevent spam, ads, swears and even bots on your server. Replaced by ChatControl Red: https://mineacademy.org/chatcontrol-red
Other
65 stars 8 forks source link

1.12.2: Players lose channel to write to when switching servers #1873

Closed c0wg0d closed 4 years ago

c0wg0d commented 4 years ago

I upgraded from BungeeControl 2.3.0 and ChatControl 8.7.1 to BungeeControl 2.3.4 and ChatControl 8.7.10.

I have many servers on Paper 1.8.8, 1.12.2, and 1.15.2.

When a player first joins, they can write in chat normally. When they switch to another server, they can write normally there also, but when they go back to the first server they were on, they get the error "You have no channel to write into. Type /ch for help."

There are no errors in the console most of the time, but I did see this one on occasion:

[12:49:16 ERROR]: [ChatControl] Unhandled exception occured in onPacketSending(PacketEvent) for ChatControl
java.lang.UnsupportedOperationException: The method hasPermission is not supported for temporary players.
        at com.comphenix.protocol.injector.server.TemporaryPlayerFactory$1.intercept(TemporaryPlayerFactory.java:144) ~[?:?]
        at com.comphenix.protocol.injector.server.TemporaryPlayer$$EnhancerByCGLIB$$adc74a06.hasPermission(<generated>) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .M.a(SourceFile:280) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .dk.a(SourceFile:297) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .dk.a(SourceFile:683) ~[?:?]
        at org.mineacademy.chatcontrol.hook.d$4.onPacketSending(SourceFile:252) ~[?:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) ~[?:?]
        at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.handlePacket(PacketFilterManager.java:588) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:564) ~[?:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.packetQueued(ProtocolInjector.java:338) ~[?:?]
        at com.comphenix.protocol.injector.netty.ProtocolInjector.onPacketSending(ProtocolInjector.java:298) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.processSending(ChannelInjector.java:367) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector.access$800(ChannelInjector.java:66) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$3.handleScheduled(ChannelInjector.java:332) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelInjector$3.onMessageScheduled(ChannelInjector.java:302) ~[?:?]
        at com.comphenix.protocol.injector.netty.ChannelProxy$2.schedulingRunnable(ChannelProxy.java:127) ~[?:?]
        at com.comphenix.protocol.injector.netty.EventLoopProxy.execute(EventLoopProxy.java:95) ~[?:?]
        at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:209) ~[patched_1.12.2.jar:git-Paper-1618]
        at net.minecraft.server.v1_12_R1.NetworkManager.sendPacket(NetworkManager.java:157) ~[patched_1.12.2.jar:git-Paper-1618]
        at net.minecraft.server.v1_12_R1.PlayerConnection.sendPacket(PlayerConnection.java:1203) ~[patched_1.12.2.jar:git-Paper-1618]
        at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.sendRawMessage(CraftPlayer.java:170) ~[patched_1.12.2.jar:git-Paper-1618]
        at org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer.sendMessage(CraftPlayer.java:177) ~[patched_1.12.2.jar:git-Paper-1618]
        at org.mineacademy.chatcontrol.final.nul. .A.b(SourceFile:428) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .A.b(SourceFile:371) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .cM.a(SourceFile:41) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .cM.a(SourceFile:19) ~[?:?]
        at org.mineacademy.chatcontrol.final.nul. .aD.execute(SourceFile:77) ~[?:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:74) ~[patched_1.12.2.jar:git-Paper-1618]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-1618]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[patched_1.12.2.jar:git-Paper-1618]
        at net.minecraft.server.v1_12_R1.PlayerConnection.chat(PlayerConnection.java:1407) ~[patched_1.12.2.jar:git-Paper-1618]
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1322) ~[patched_1.12.2.jar:git-Paper-1618]
        at net.minecraft.server.v1_12_R1.PacketPlayInChat$1.run(PacketPlayInChat.java:39) ~[patched_1.12.2.jar:git-Paper-1618]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_265]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_265]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_265]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_265]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_265]
[12:49:16 ERROR]: Parameters:
  net.minecraft.server.v1_12_R1.PacketPlayOutChat@53cdeb71[
    a=TextComponent{text='', siblings=[TextComponent{text='You have no channel to write into. Type ', siblings=[], style=Style{hasParent=true, color=, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}, TextComponent{text='/ch ', siblings=[], style=Style{hasParent=true, color=, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}, TextComponent{text='for help.', siblings=[], style=Style{hasParent=true, color=, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}
    components=<null>
    b=SYSTEM
  ]

I have deleted all the ChatControl data.db files and restarted all the servers multiple times, and this issue always occurs with ChatControl 8.7.10. When I revert to ChatControl 8.7.1 and BungeeControl 2.3.0, without changing anything else, everything works as expected.

I do not give my players access to the /ch join command because I want chat to be automatically joined for whatever server they go into.

In my main hub/lobby server, I have the following permissions set automatically for all players:

    chatcontrol.channel.lobby: true
    chatcontrol.channel.lobby.join.write: true
    chatcontrol.channel.autojoin.lobby.write: true

In my adventure server, I have the following permissions:

    chatcontrol.channel.adventure: true
    chatcontrol.channel.adventure.join.write: true
    chatcontrol.channel.autojoin.adventure.write: true

This is replicated across all my servers, and each server has their own channel setup in ChatControl.

channels.yml

  adventure:
    Format: adventure
    Bungee: true
    Log_Format: '[Adventure] {player}: {message}'
    Console_Format: '[Adventure] {player}: {message}'

  lobby:
    Format: lobby
    Bungee: true
    Log_Format: '[Lobby] {player}: {message}'
    Console_Format: '[Lobby] {player}: {message}'

formatting.yml

  adventure:
    Bracket:
      Message: '&7[&aA&7]&r '
    Player:
      Message: '{pl_prefix}{nick}{pl_suffix}&7: &r'
      Hover_Event:
        Action: SHOW_TEXT
        Values:
        - '&7Name&f: {javascript_full_name_for_mouse_hover}'
        - '&7Spiders Killed&f: {statistic_kill_entity:spider}'
        - '&7Time Played&f: {statistic_time_played}'
        - '&9Click to PM&f {player}'
      Click_Event:
        Action: SUGGEST_COMMAND
        Value: '/pm {player} '
    Message:
      Message: '{message}'

  lobby:
    Bracket:
      Message: '&7[&9L&7]&f '
    Player:
      Message: '{pl_prefix}{nick}{pl_suffix}&7: &r'
      Hover_Event:
        Action: SHOW_TEXT
        Values:
        - '&7Name&f: {javascript_full_name_for_mouse_hover}'
        - '&7Time Played&f: {statistic_time_played}'
        - '&9Click to PM&f {player}'
      Click_Event:
        Action: SUGGEST_COMMAND
        Value: '/pm {player} '
    Message:
      Message: '{message}'
kangarko commented 4 years ago

Thanks, tested on 1.8.8 and 1.16.2 and fixed the problem, please use the next version when it is ready.

c0wg0d commented 4 years ago

I see in 8.7.12 you mention fixing the ProtocolLib issue and the error in question, and in 8.7.11 you mention fixing the issue of players not joining channels when using MySQL, but I'm not using MySQL, and as I said in this report, I don't always get this error. Are you saying that my issue is fixed in 8.7.12 in regards to players not auto-joining channels properly?

kangarko commented 4 years ago

I am very confident that this got solved.

If not please set Debug to [channels] and let me know console log when it happens again.

c0wg0d commented 3 years ago

This bug is reoccurring now in 8.9.0-BETA. Only 1.12.2 servers seem to be affected by this. 1.16.3 servers do not have this problem.

kangarko commented 3 years ago

Any errors? Do you have both 1.12 and 1.16 on your network?

c0wg0d commented 3 years ago

Yes I have both 1.12 and 1.16 servers on my network. There are no errors. The players just tell me they get an error from CHC "No channels to write to." There should always be a channel to write to because each server is given the permissions I listed above, and players do not have permission to use the /ch command. It should always be fully automatic.

kangarko commented 3 years ago

https://www.loom.com/share/fe4021b557b44d3c9979bf85f3036518

Is it possible you start using MySQL? We're going to enforce this if one uses BungeeCord starting the next ChatControl anyways because of how data is transferred it makes sending much more efficient.

Regarding this problem here, please set Debug to [channels] on 8.9.1 and let me know the output when players rejoin back and lacks the channel

c0wg0d commented 3 years ago

What is loom.com?

I can start using MySQL but I really wish there was an option to not use a database at all. ChatControl v7 didn't have a database and I never had these kinds of problems.

kangarko commented 3 years ago

I recorded video for you, you can view it on that page.

kangarko commented 3 years ago

There are so many benefits to using database over Bungee we could not make it effective enough without it. Literally would have to do ninja shit and split packets which could cause more problems than fix

c0wg0d commented 3 years ago

I see the video--thanks for that. One player who experienced this problem today told me they changed their Minecraft name recently, and also they were logged in with MineChat. Maybe MineChat is doing something weird/irregular that Minecraft doesn't do? Maybe a name change will cause an issue if they don't exist in data.db before joining?

kangarko commented 3 years ago

We don't actually support name changes in ChatControl 8, but that's already added to ChatControl 10 :)