package clientdata import ( "github.com/osm/quake/common/buffer" "github.com/osm/quake/common/context" "github.com/osm/quake/protocol" ) type Command struct { Bits uint16 ViewHeight byte IdealPitch byte PunchAngle [3]byte Velocity [3]byte Items uint32 WeaponFrame byte Armor byte Weapon byte Health uint16 ActiveAmmo byte AmmoShells byte AmmoNails byte AmmoRockets byte AmmoCells byte ActiveWeapon byte } func (cmd *Command) Bytes() []byte { buf := buffer.New() buf.PutByte(protocol.SVCClientData) buf.PutUint16(cmd.Bits) if cmd.Bits&protocol.SUViewHeight != 0 { buf.PutByte(cmd.ViewHeight) } if cmd.Bits&protocol.SUIdealPitch != 0 { buf.PutByte(cmd.IdealPitch) } for i := 0; i < 3; i++ { if cmd.Bits&(protocol.SUPunch1<