class
Rosegold::Spectate::Server
- Rosegold::Spectate::Server
- Reference
- Object
Defined in:
rosegold/spectate/server.crConstant Summary
-
BOT_MONITOR_INTERVAL =
50.milliseconds -
DEFAULT_RENDER_DISTANCE =
4 -
DEFAULT_SIMULATION_DISTANCE =
3_u32 -
DEFAULT_SPECTATOR_ENTITY_ID =
2147483647 -
DEFAULT_VIEW_DISTANCE =
10_u32 -
INVENTORY_POLL_INTERVAL =
1.second -
KEEP_ALIVE_INTERVAL =
20.seconds -
Log =
::Log.for(self) -
LOOK_UPDATE_INTERVAL =
16.milliseconds -
LOOK_UPSAMPLING =
true -
MAX_CONNECTIONS =
10 -
UNIMPLEMENTED_FORWARDED =
{"set_entity_motion" => {772_u32 => 94_u32, 774_u32 => 99_u32, 775_u32 => 101_u32, 777_u32 => 103_u32}, "set_entity_data" => {772_u32 => 92_u32, 774_u32 => 97_u32, 775_u32 => 99_u32, 777_u32 => 101_u32}, "sound" => {772_u32 => 110_u32, 774_u32 => 115_u32, 775_u32 => 117_u32, 777_u32 => 119_u32}, "update_attributes" => {772_u32 => 124_u32, 774_u32 => 129_u32, 775_u32 => 131_u32, 777_u32 => 134_u32}, "world_particles" => {772_u32 => 41_u32, 774_u32 => 46_u32, 775_u32 => 47_u32, 777_u32 => 48_u32}, "explosion" => {772_u32 => 32_u32, 774_u32 => 36_u32, 775_u32 => 36_u32, 777_u32 => 36_u32}, "scoreboard_objective" => {772_u32 => 99_u32, 774_u32 => 104_u32, 775_u32 => 106_u32, 777_u32 => 108_u32}, "scoreboard_score" => {772_u32 => 103_u32, 774_u32 => 108_u32, 775_u32 => 110_u32, 777_u32 => 112_u32}, "scoreboard_display_objective" => {772_u32 => 91_u32, 774_u32 => 96_u32, 775_u32 => 98_u32, 777_u32 => 100_u32}, "reset_score" => {772_u32 => 72_u32, 774_u32 => 77_u32, 775_u32 => 79_u32, 777_u32 => 80_u32}, "teams" => {772_u32 => 102_u32, 774_u32 => 107_u32, 775_u32 => 109_u32, 777_u32 => 111_u32}, "set_title_text" => {772_u32 => 107_u32, 774_u32 => 112_u32, 775_u32 => 114_u32, 777_u32 => 116_u32}, "set_title_subtitle" => {772_u32 => 105_u32, 774_u32 => 110_u32, 775_u32 => 112_u32, 777_u32 => 114_u32}, "set_title_time" => {772_u32 => 108_u32, 774_u32 => 113_u32, 775_u32 => 115_u32, 777_u32 => 117_u32}, "clear_titles" => {772_u32 => 14_u32, 774_u32 => 14_u32, 775_u32 => 14_u32, 777_u32 => 14_u32}, "action_bar" => {772_u32 => 80_u32, 774_u32 => 85_u32, 775_u32 => 87_u32, 777_u32 => 89_u32}, "playerlist_header" => {772_u32 => 115_u32, 774_u32 => 120_u32, 775_u32 => 122_u32, 777_u32 => 125_u32}, "hurt_animation" => {772_u32 => 36_u32, 774_u32 => 41_u32, 775_u32 => 42_u32, 777_u32 => 43_u32}, "damage_event" => {772_u32 => 25_u32, 774_u32 => 25_u32, 775_u32 => 25_u32, 777_u32 => 25_u32}, "entity_sound_effect" => {772_u32 => 109_u32, 774_u32 => 114_u32, 775_u32 => 116_u32, 777_u32 => 118_u32}, "entity_head_rotation" => {772_u32 => 76_u32, 774_u32 => 81_u32, 775_u32 => 83_u32, 777_u32 => 85_u32}, "entity_status" => {772_u32 => 30_u32, 774_u32 => 34_u32, 775_u32 => 34_u32, 777_u32 => 34_u32}, "initialize_world_border" => {772_u32 => 37_u32, 774_u32 => 42_u32, 775_u32 => 43_u32, 777_u32 => 44_u32}, "world_border_center" => {772_u32 => 81_u32, 774_u32 => 86_u32, 775_u32 => 88_u32, 777_u32 => 90_u32}, "world_border_lerp_size" => {772_u32 => 82_u32, 774_u32 => 87_u32, 775_u32 => 89_u32, 777_u32 => 91_u32}, "world_border_size" => {772_u32 => 83_u32, 774_u32 => 88_u32, 775_u32 => 90_u32, 777_u32 => 92_u32}, "world_border_warning_delay" => {772_u32 => 84_u32, 774_u32 => 89_u32, 775_u32 => 91_u32, 777_u32 => 93_u32}, "world_border_warning_reach" => {772_u32 => 85_u32, 774_u32 => 90_u32, 775_u32 => 92_u32, 777_u32 => 94_u32}, "world_event" => {772_u32 => 40_u32, 774_u32 => 45_u32, 775_u32 => 46_u32, 777_u32 => 47_u32}, "block_action" => {772_u32 => 7_u32, 774_u32 => 7_u32, 775_u32 => 7_u32, 777_u32 => 7_u32}, "tile_entity_data" => {772_u32 => 6_u32, 774_u32 => 6_u32, 775_u32 => 6_u32, 777_u32 => 6_u32}, "experience" => {772_u32 => 96_u32, 774_u32 => 101_u32, 775_u32 => 103_u32, 777_u32 => 105_u32}, "set_cooldown" => {772_u32 => 22_u32, 774_u32 => 22_u32, 775_u32 => 22_u32, 777_u32 => 22_u32}, "collect" => {772_u32 => 117_u32, 774_u32 => 122_u32, 775_u32 => 124_u32, 777_u32 => 127_u32}, "attach_entity" => {772_u32 => 93_u32, 774_u32 => 98_u32, 775_u32 => 100_u32, 777_u32 => 102_u32}, "entity_teleport" => {772_u32 => 118_u32, 774_u32 => 123_u32, 775_u32 => 125_u32, 777_u32 => 128_u32}, "commands" => {772_u32 => 16_u32, 774_u32 => 16_u32, 775_u32 => 16_u32, 777_u32 => 16_u32}}.transform_values do |ids| ids.merge({773_u32 => ids[774_u32], 776_u32 => ids[775_u32]}) end
Constructors
Class Method Summary
Macro Summary
Instance Method Summary
-
#action_bar(text : String | Rosegold::TextComponent)
Broadcast an action bar message to every spectating connection.
- #attach_client(client : Rosegold::Client)
-
#boss_bar(title : String | Rosegold::TextComponent, progress : Float64, color : Clientbound::BossEvent::Color = Clientbound::BossEvent::Color::White, division : Clientbound::BossEvent::Division = Clientbound::BossEvent::Division::None)
Broadcast a boss bar update to every spectating connection.
-
#boss_bar(title : String | Rosegold::TextComponent, current : Number, max : Number, color : Clientbound::BossEvent::Color = Clientbound::BossEvent::Color::White, division : Clientbound::BossEvent::Division = Clientbound::BossEvent::Division::None)
Convenience overload computing progress from current/max, clamped to 0..1.
- #cached_commands_bytes : Bytes | Nil
-
#chat(message : String | Rosegold::TextComponent)
Broadcast a chat message to every spectating connection.
-
#clear_boss_bar
Remove the boss bar from every spectating connection and clear stored state.
- #client : Rosegold::Client | Nil
- #client=(client : Rosegold::Client | Nil)
- #connections : Array(Rosegold::Spectate::Connection)
- #connections=(connections : Array(Rosegold::Spectate::Connection))
- #detach_client
- #host : String
- #host=(host : String)
- #next_command_suggestion_tid : UInt32
- #port : Int32
- #port=(port : Int32)
-
#replay_ui_state(connection : Connection, boss_bar_session : UInt64)
Replay stored action bar and boss bar state to a spectator that just joined.
- #server : TCPServer | Nil
- #server=(server : TCPServer | Nil)
- #start
- #stop
Constructor Detail
Class Method Detail
Macro Detail
Instance Method Detail
Broadcast an action bar message to every spectating connection. Sticky: replayed to spectators that join later, until replaced.
Broadcast a boss bar update to every spectating connection. Complete add packets also replace existing bars, avoiding vanilla crashes if the client lost its prior state before an update.
Convenience overload computing progress from current/max, clamped to 0..1.
Broadcast a chat message to every spectating connection.
Replay stored action bar and boss bar state to a spectator that just joined.