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); }
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); }
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); }
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); }
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); }
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()); }
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()); }
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()); }
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); } }
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()); }
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()); }
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()); }