libspades
Ace of Spades library
PacketExistingPlayer Struct Reference

Informs the client of in-game players and the server of the joining client player. More...

#include <protocol.h>

Data Fields

uint8_t packetID
 9 (Client<->Server)
 
uint8_t playerID
 The ID of the player.
 
uint8_t team
 The team of the player.
 
uint8_t weapon
 The weapon of the player.
 
uint8_t item
 The held item of the player.
 
uint32_t kills
 The amount of points the player has.
 
uint8_t blue
 The blue colour value of the player's block.
 
uint8_t green
 The green colour value of the player's block.
 
uint8_t red
 The red colour value of the player's block.
 
char name [16]
 The name of the player.
 

Detailed Description

Informs the client of in-game players and the server of the joining client player.

Warning
Sending a malformed Existing Player packet may cause piqueserver to permanently ban the player's IP address. This is referred to as a "hardban".
Piqueserver bug
Piqueserver can leak the player's IP address with its "ban subscribe" feature, potentially adding further insult to injury.

Field Documentation

◆ item

uint8_t PacketExistingPlayer::item

The held item of the player.

Possible values are:

  • ItemTypeSpade = 0,
  • ItemTypeBlock = 1,
  • ItemTypeGun = 2,
  • ItemTypeGrenade = 3

◆ name

char PacketExistingPlayer::name[16]

The name of the player.

Normally the maximum size is 16 bytes, the last of which is required by piqueserver to be NULL

Todo
verify
Piqueserver bug

This parameter can be left out entirely without being hardbanned by piqueserver and causes an OpenSpades bug in PacketCreatePlayer

This parameter is limited incorrectly by piqueserver not to 15 bytes and a NULL terminator, but rather 15 unicode code points, allowing four times the amount of bytes to be crammed into the player name!

SpadesX bug
SpadesX commits before 0493af85e126ab66e056ff667b1884b328c28f8e allowed player names 16 bytes and one NULL terminator long, instead of 15 bytes and one NULL terminator. @betterspadesbug BetterSpades commits before [fc7ab028345306391081953ec9383580b835f391](fc7ab028345306391081953ec9383580b835f391) did not properly handle player names which were too long, potentially causing crashes or funkiness after the actual name.
Todo
verify that betterspades actually fixed it properly, and SpadesX too.

◆ team

uint8_t PacketExistingPlayer::team

The team of the player.

This may be 0 for the first team, 1 for the second, and -1 for spectator.

◆ weapon

uint8_t PacketExistingPlayer::weapon

The weapon of the player.

Possible values are:

  • WeaponTypeRifle = 0,
  • WeaponTypeSMG = 1,
  • WeaponTypeShotgun = 2

The documentation for this struct was generated from the following file: