piqueserver / aosprotocol

Documentation and development of the protocol used by AoS 0.x, OpenSpades, pyspades and piqueserver
https://piqueserver.github.io/aosprotocol/
Apache License 2.0
26 stars 9 forks source link

PP: Custom map bounds #28

Open iamgreaser opened 4 years ago

iamgreaser commented 4 years ago

This would allow one to restrict players to a subset of the map, which is less difficult than trying to shoehorn in support for smaller (or larger) maps.

A suitable fallback is to teleport older clients back to their last in-bounds position.

struct MapBounds {
   uint8_t extension_id[2] = {0x8?, 0x??};
   uint8_t packet_id = 0x00;
   uint16_t flags;
      // bit 0: 1 = disable visible world wrap
      // bit 1: 1 = show translucent boundary
   int16_t min_x, max_x; // both inclusive, default = (0, 511)
   int16_t min_y, max_y; // both inclusive, default = (0, 511)
} __attribute__((__packed__));