kangarko / ChatControl-Red

Issue tracker and documentation for the next generation ChatControl Red, the most advanced chat management plugin.
43 stars 22 forks source link

Get server name using BungeeCord channel #2681

Closed SheerYin closed 1 month ago

SheerYin commented 1 month ago

Summary

Setting the server.properties server-name manually for each server is always cumbersome, and using a BungeeCord plugin message, sent when a player joins and waiting for BungeeCord to return the ServerName seems like a better option?

fun getServerName(player: Player) {
        val byteArrayOutputStream = ByteArrayOutputStream()
        DataOutputStream(byteArrayOutputStream).use { output ->
            output.writeUTF("GetServer")
        }
        player.sendPluginMessage(this, pluginChannel, byteArrayOutputStream.toByteArray())
    }

What would happen if we didn't implement this feature? Why not having this feature is a problem?

More convenient, that's all

kangarko commented 1 month ago

I apology, the documentation was outdated. You can now just set this in bungee.yml of ChatControl. We need you to set this manually the way our protocol communication works to ensure it's always the right value.