1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- message types:
- asteroid_pos (0x00):
- uint64_t microtimestamp;
- for each asteroid:
- uint16_t id;
- vec vel, pos;
- f32 rot, scale;
- player_pos (0x01):
- server to client:
- uint64_t microtimestamp; // only useful with prediction
- for each player:
- uint8_t id;
- vec pos;
- vec vel; // only useful with prediction
- vec front;
- vec up;
- client to server:
- uint64_t microtimestamp; // only useful with prediction
- vec pos;
- vec vel; // only useful with prediction
- vec front;
- vec up;
- sun_pos (0x02):
- uint64_t microtimestamp;
- f32 location;
- asteroid_destroyed (0x03):
- server to client: // reliable
- uint64_t microtimestamp;
- uint16_t id;
- vec newvel, newpos;
- f32 rot, scale;
- client to server: // confirmed by the server echoing the details back
- uint64_t microtimestamp;
- uint16_t id;
- exo_hit (0x04): // reliable
- uint64_t microtimestamp;
- uint16_t hit_id;
- uint16_t asteroid_id;
- vec oldvel, oldpos, newvel, newpos;
- f32 oldrot, oldscale, newrot, newscale;
- f32 damage_ratio; // > 10.f if the game should end
- player_disconnected (0x05): // reliable
- server to client:
- uint8_t id;
- pod_state_changed (0x06): // reliable
- server to client:
- microtimestamp; // detecting reuse of the same id
- uint8_t new_state; // 0x00: destroyed; 0x01: delivered; 0x02: spawned; 0x03: picked up
- uint16_t pod_id;
- if new_state == destroyed:
- f32 population_dead;
- else if new_state == delivered:
- server to client:
- f32 population_saved;
- else if new_state == spawned:
- vec pos;
- else if new_state == picked up:
- server to client:
- uint8_t player_id;
- exo_hit_recvd (0x80):
- uint16_t hid_id;
- asteroid_destroyed_recvd (0x81):
- uint16_t id;
- player_disconnected_recvd (0x82):
- client to server:
- uint8_t id;
- pod_state_changed_recvd (0x83):
- uint16_t id;
- register_accepted (0xC0):
- uint8_t your_id;
- uint16_t num_asteroids; // 0 = 0x10000
- bad_register_value (0xFE):
- <no data>
- register (0xFF):
- uint64_t epoch;
- uint16_t num_asteroids; // 0 = 0x10000
- message format:
- uint64_t protocol_id (0x75F6073677E10C44); // don't want random udp packets
- uint8_t message type;
- <message-specific data>;
|