Example #1
0
 public override void SerializeWithCompressor(Compressor c)
 {
     c.WriteNumber((int)MessageType.ClientConnect, Enum.GetNames(typeof(MessageType)).Length);
     c.WriteNumber(_MessageId, int.MaxValue);
     CompressingUtils.WriteTime(c, _TimeStamp);
     c.WriteString(name);
 }
Example #2
0
 public override void SerializeWithCompressor(Compressor c)
 {
     c.WriteNumber((int)MessageType.PlayerInput, Enum.GetNames(typeof(MessageType)).Length);
     c.WriteNumber(_MessageId, int.MaxValue);
     CompressingUtils.WriteTime(c, _TimeStamp);
     c.WriteNumber((int)Action, Enum.GetNames(typeof(PlayerAction)).Length);
 }
Example #3
0
 public override void SerializeWithCompressor(Compressor c)
 {
     c.WriteNumber((int)MessageType.Shot, Enum.GetNames(typeof(MessageType)).Length);
     c.WriteNumber(_MessageId, GlobalSettings.MaxACK);
     CompressingUtils.WriteTime(c, _TimeStamp);
     c.WriteNumber(targetId, GlobalSettings.MaxPlayers);
 }
Example #4
0
 public override void SerializeWithCompressor(Compressor c)
 {
     c.WriteNumber((int)MessageType.ConnectConfirmation, Enum.GetNames(typeof(MessageType)).Length);
     c.WriteNumber(_MessageId, GlobalSettings.MaxACK);
     c.WriteNumber(id, GlobalSettings.MaxPlayers);
     CompressingUtils.WriteTime(c, _TimeStamp);
     c.WriteString(name);
 }
Example #5
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);
 }
Example #6
0
    public override byte[] Serialize()
    {
        Compressor compressor = new Compressor();

        compressor.WriteNumber((int)MessageType.ClientConnect, Enum.GetNames(typeof(MessageType)).Length);
        compressor.WriteNumber(_MessageId, int.MaxValue);
        CompressingUtils.WriteTime(compressor, _TimeStamp);
        compressor.WriteString(name);
        return(compressor.GetBuffer());
    }
Example #7
0
    public override byte[] Serialize()
    {
        Compressor compressor = new Compressor();

        compressor.WriteNumber((int)MessageType.PlayerInput, Enum.GetNames(typeof(MessageType)).Length);
        compressor.WriteNumber(_MessageId, int.MaxValue);
        CompressingUtils.WriteTime(compressor, _TimeStamp);
        compressor.WriteNumber((int)Action, Enum.GetNames(typeof(PlayerAction)).Length);
        return(compressor.GetBuffer());
    }
Example #8
0
    public override byte[] Serialize()
    {
        Compressor c = new Compressor();

        c.WriteNumber((int)MessageType.Shot, Enum.GetNames(typeof(MessageType)).Length);
        c.WriteNumber(_MessageId, GlobalSettings.MaxACK);
        CompressingUtils.WriteTime(c, _TimeStamp);
        c.WriteNumber(targetId, GlobalSettings.MaxPlayers);
        return(c.GetBuffer());
    }
Example #9
0
 public override void SerializeWithCompressor(Compressor c)
 {
     c.WriteNumber((int)MessageType.WorldSnapshot, Enum.GetNames(typeof(MessageType)).Length);
     CompressingUtils.WriteTime(c, time);
     c.WriteNumber(_numberOfPlayers, GlobalSettings.MaxPlayers);
     foreach (PlayerSnapshot playerSnapshot in _playerSnapshots)
     {
         playerSnapshot.serializeWithCompressor(c);
     }
 }
Example #10
0
    public override byte[] Serialize()
    {
        Compressor compressor = new Compressor();

        compressor.WriteNumber((int)MessageType.ConnectConfirmation, Enum.GetNames(typeof(MessageType)).Length);
        compressor.WriteNumber(_MessageId, GlobalSettings.MaxACK);
        compressor.WriteNumber(id, GlobalSettings.MaxPlayers);
        CompressingUtils.WriteTime(compressor, _TimeStamp);
        compressor.WriteString(name);
        return(compressor.GetBuffer());
    }
Example #11
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());
    }
Example #12
0
    public override byte[] Serialize()
    {
        Compressor compressor = new Compressor();

        compressor.WriteNumber((int)MessageType.WorldSnapshot, Enum.GetNames(typeof(MessageType)).Length);
        CompressingUtils.WriteTime(compressor, time);
        compressor.WriteNumber(_numberOfPlayers, GlobalSettings.MaxPlayers);
        foreach (PlayerSnapshot playerSnapshot in _playerSnapshots)
        {
            playerSnapshot.serializeWithCompressor(compressor);
        }
        return(compressor.GetBuffer());
    }