MessageFriendChannel

class MessageFriendChannel : OutgoingGameMessage

Message friendchannel is used to transmit messages within a friend chat channel.

Constructors

Link copied to clipboard
constructor(sender: String, channelName: String, worldId: Int, worldMessageCounter: Int, chatCrownType: Int, message: String)
constructor(sender: String, channelNameBase37: Long, worldId: Int, worldMessageCounter: Int, chatCrownType: Int, message: String)

Properties

Link copied to clipboard
open override val category: ServerProtCategory
Link copied to clipboard

the name of the friend chat channel

Link copied to clipboard
Link copied to clipboard

the id of the crown to render next to the name of the sender.

Link copied to clipboard

the message to be sent in the friend chat channel.

Link copied to clipboard

the name of the player who is sending the message

Link copied to clipboard
Link copied to clipboard

the world-local message counter. Each world must have its own message counter which is used to create a unique id for each message. This message counter must be incrementing with each message that is sent out. If two messages share the same unique id (which is a combination of the worldId and the worldMessageCounter properties), the client will not render the second message if it already has one received in the last 100 messages. It is additionally worth noting that servers with low population should probably not start the counter at the same value with each game boot, as the probability of multiple messages coinciding is relatively high in that scenario, given the low quantity of messages sent out to begin with. Additionally, only the first 24 bits of the counter are utilized, meaning a value from 0 to 16,777,215 (inclusive). A good starting point for message counting would be to take the hour of the year and multiply it by 50,000 when the server boots up. This means the roll-over happens roughly after every two weeks. Fine-tuning may be used to make it more granular, but the overall idea remains the same.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun estimateSize(): Int
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String