Skip to content

Commit

Permalink
feat: add a message on ws protocol mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
My-Name-Is-Jeff committed Sep 7, 2024
1 parent 742db09 commit 36de588
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsws/client/PacketHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

package gg.skytils.skytilsws.client

import gg.essential.universal.UChat
import gg.skytils.skytilsmod.Reference
import gg.skytils.skytilsmod.Skytils
import gg.skytils.skytilsmod.Skytils.Companion.mc
import gg.skytils.skytilsmod.features.impl.dungeons.catlas.core.map.Room
import gg.skytils.skytilsmod.features.impl.dungeons.catlas.core.map.Unknown
Expand Down Expand Up @@ -49,6 +51,7 @@ object PacketHandler : IPacketHandler {
is S2CPacketAcknowledge -> {
if (packet.wsVersion != SkytilsWS.version) {
session.close(CloseReason(CloseReason.Codes.CANNOT_ACCEPT, "Incompatible WS version"))
UChat.chat("${Skytils.failPrefix} §cIncompatible WS version. Expected ${packet.wsVersion} but you have protocol version ${SkytilsWS.version}.")
} else {
coroutineScope {
handleLogin(session, packet)
Expand Down

0 comments on commit 36de588

Please sign in to comment.