public override void Write(BinaryWriter writer) { WriteH(writer, 0); //Sender shift WriteH(writer, 0); //Message shift WriteD(writer, Type.GetHashCode()); WriteUid(writer, Player); byte isGm = 0; if (Player != null) { isGm = (byte)(Communication.Global.AdminEngine.IsGM(Player) ? 1 : 0); } WriteC(writer, 0); //Blue shit WriteC(writer, isGm); //GM if (Player != null) { writer.Seek(4, SeekOrigin.Begin); WriteH(writer, (short)writer.BaseStream.Length); writer.Seek(0, SeekOrigin.End); WriteS(writer, Player.PlayerData.Name); } writer.Seek(6, SeekOrigin.Begin); WriteH(writer, (short)writer.BaseStream.Length); writer.Seek(0, SeekOrigin.End); WriteS(writer, Message); WriteC(writer, 0); }
public override byte[] WritedData() { using (var stream = new MemoryStream()) { using (var writer = new BinaryWriter(stream)) { writer.Write((byte)_chatType.GetHashCode()); writer.Write((byte)1); writer.Write((int)_sessionId); writer.Write(BinaryExt.WriteFixedString(_characterName, Encoding.Unicode, 62)); writer.Write((byte)1); writer.Write((byte)0); writer.Write((byte)1); writer.Write(Encoding.Unicode.GetBytes(_message)); } return(stream.ToArray()); } }
public override void Write(BinaryWriter writer) { WriteH(writer, 0); //Sender shift WriteH(writer, 0); //Message shift WriteD(writer, Type.GetHashCode()); WriteUid(writer, Player); byte isGm = 0; if (Player != null) { if (Player.Connection.Account.isGM == true) { isGm = (byte)1; } else { isGm = (byte)0; } } WriteC(writer, 0); //Blue shit WriteC(writer, isGm); //GM if (Player != null) { writer.Seek(4, SeekOrigin.Begin); WriteH(writer, (short)writer.BaseStream.Length); writer.Seek(0, SeekOrigin.End); WriteS(writer, Player.PlayerData.Name); } writer.Seek(6, SeekOrigin.Begin); WriteH(writer, (short)writer.BaseStream.Length); writer.Seek(0, SeekOrigin.End); WriteS(writer, Message); WriteC(writer, 0); }
public override int GetHashCode() { int hash = 1; if (ChatType != global::ChatType.Local) { hash ^= ChatType.GetHashCode(); } if (Message.Length != 0) { hash ^= Message.GetHashCode(); } if (SenderUUID.Length != 0) { hash ^= SenderUUID.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }