Exemplo n.º 1
0
 public void serializeWithCompressor(Compressor c)
 {
     c.WriteNumber(id, GlobalSettings.MaxPlayers);
     CompressingUtils.WriteTime(c, _TimeStamp);
     c.WriteNumber(this.Health, GlobalSettings.MaxHealth);
     c.PutBit(this.Invulnerable);
     CompressingUtils.WritePosition(c, position);
     c.WriteNumber(lastId, GlobalSettings.MaxACK);
 }
Exemplo n.º 2
0
    public byte[] serialize()
    {
        Compressor compressor = new Compressor();

        compressor.WriteNumber(id, GlobalSettings.MaxPlayers);
        CompressingUtils.WriteTime(compressor, _TimeStamp);
        compressor.WriteNumber(this.Health, GlobalSettings.MaxHealth);
        compressor.PutBit(this.Invulnerable);
        CompressingUtils.WritePosition(compressor, position);
        compressor.WriteNumber(lastId, GlobalSettings.MaxACK);
        return(compressor.GetBuffer());
    }