Add support for dedicated activity flag

Polar posting about these recently in Discord jogged my memory that I'd
missed this flag off, previously I called this FLAG_HIGHLIGHT.

I've also added the official Jagex names to the documentation, thanks to
Polar.

I don't think 550 supports any of the flags after DEDICATEDACTIVITY.

Signed-off-by: Graham <gpe@openrs2.org>
master
Graham 8 months ago
parent 2a0401a35e
commit 4f5709acfa
  1. 3
      conf/src/main/kotlin/org/openrs2/conf/Config.kt
  2. 1
      game/src/main/kotlin/org/openrs2/game/cluster/SingleWorldCluster.kt
  3. 1
      protocol/src/main/kotlin/org/openrs2/protocol/world/downstream/WorldListResponse.kt
  4. 7
      protocol/src/main/kotlin/org/openrs2/protocol/world/downstream/WorldListResponseCodec.kt
  5. 13
      share/doc/protocol/world-list.md

@ -11,7 +11,8 @@ public data class Config(
val members: Boolean, val members: Boolean,
val quickChat: Boolean, val quickChat: Boolean,
val pvp: Boolean, val pvp: Boolean,
val lootShare: Boolean val lootShare: Boolean,
val dedicatedActivity: Boolean
) { ) {
val internalGame: String = game.toInternalName() val internalGame: String = game.toInternalName()
val internalOperator: String = operator.toInternalName() val internalOperator: String = operator.toInternalName()

@ -18,6 +18,7 @@ public class SingleWorldCluster @Inject constructor(
config.quickChat, config.quickChat,
config.pvp, config.pvp,
config.lootShare, config.lootShare,
config.dedicatedActivity,
config.activity, config.activity,
config.hostname config.hostname
) )

@ -22,6 +22,7 @@ public data class WorldListResponse(
public val quickChat: Boolean, public val quickChat: Boolean,
public val pvp: Boolean, public val pvp: Boolean,
public val lootShare: Boolean, public val lootShare: Boolean,
public val dedicatedActivity: Boolean,
public val activity: String, public val activity: String,
public val hostname: String public val hostname: String
) )

@ -49,11 +49,12 @@ public class WorldListResponseCodec : VariableShortPacketCodec<WorldListResponse
val quickChat = (flags and FLAG_QUICK_CHAT) != 0 val quickChat = (flags and FLAG_QUICK_CHAT) != 0
val pvp = (flags and FLAG_PVP) != 0 val pvp = (flags and FLAG_PVP) != 0
val lootShare = (flags and FLAG_LOOT_SHARE) != 0 val lootShare = (flags and FLAG_LOOT_SHARE) != 0
val dedicatedActivity = (flags and FLAG_DEDICATED_ACTIVITY) != 0
val activity = input.readVersionedString() val activity = input.readVersionedString()
val hostname = input.readVersionedString() val hostname = input.readVersionedString()
worlds[id] = WorldListResponse.World(country, members, quickChat, pvp, lootShare, activity, hostname) worlds[id] = WorldListResponse.World(country, members, quickChat, pvp, lootShare, dedicatedActivity, activity, hostname)
} }
val checksum = input.readInt() val checksum = input.readInt()
@ -111,6 +112,9 @@ public class WorldListResponseCodec : VariableShortPacketCodec<WorldListResponse
if (world.lootShare) { if (world.lootShare) {
flags = flags or FLAG_LOOT_SHARE flags = flags or FLAG_LOOT_SHARE
} }
if (world.dedicatedActivity) {
flags = flags or FLAG_DEDICATED_ACTIVITY
}
output.writeInt(flags) output.writeInt(flags)
output.writeVersionedString(world.activity) output.writeVersionedString(world.activity)
@ -135,5 +139,6 @@ public class WorldListResponseCodec : VariableShortPacketCodec<WorldListResponse
private const val FLAG_QUICK_CHAT = 0x2 private const val FLAG_QUICK_CHAT = 0x2
private const val FLAG_PVP = 0x4 private const val FLAG_PVP = 0x4
private const val FLAG_LOOT_SHARE = 0x8 private const val FLAG_LOOT_SHARE = 0x8
private const val FLAG_DEDICATED_ACTIVITY = 0x10
} }
} }

@ -50,12 +50,13 @@ The following fields are always present:
##### Flags ##### Flags
| Flag | Description | | Flag | Jagex name | Description |
|-----:|--------------| |-----:|---------------------|--------------------|
| 0x1 | Members only | | 0x1 | `MEMBERS` | Members only |
| 0x2 | Quick chat | | 0x2 | `QUICKCHAT` | Quick chat |
| 0x4 | PvP | | 0x4 | `PVPWORLD` | PvP |
| 0x8 | Loot share | | 0x8 | `LOOTSHARE` | Loot share |
| 0x10 | `DEDICATEDACTIVITY` | Dedicated activity |
### Player count ### Player count

Loading…
Cancel
Save