コード例 #1
0
        private void ChatSocket_OnBnetAuthResponse(BnetAuthResponse packet)
        {
            BnetAuthResult result = packet.result;

            if (result == BnetAuthResult.Success)
            {
                this.Chat.WriteToLog("[0x" + Conversions.ToString(packet.Packetid) + "] Authenticated", Color.Gray);
            }
            else if (result == BnetAuthResult.CDKeyInUse || result == BnetAuthResult.BannedCDKey || result == BnetAuthResult.InvalidCDKey)
            {
                this.Chat.WriteToLog(string.Concat(new string[]
                {
                    packet.result.ToString(),
                    ":   ",
                    this.Infos.ClassicCdKey,
                    "    /     ",
                    this.Infos.ExpCdKey
                }), Color.DarkRed);
                this.Disconnect();
            }
            else
            {
                this.Chat.WriteToLog("[0x" + Conversions.ToString(packet.Packetid) + "]Authentication failed: " + packet.result, Color.Red);
                this.Disconnect();
            }
        }
コード例 #2
0
 // Methods
 public BnetAuthResponse(byte[] data) : base(data)
 {
     this.result = (BnetAuthResult)BitConverter.ToUInt32(data, 3);
     if (data.Length > 8)
     {
         this.info = ByteConverter.GetNullString(data, 7);
     }
 }
コード例 #3
0
 // Methods
 public BnetAuthResponse(byte[] data)
     : base(data)
 {
     this.result = (BnetAuthResult) BitConverter.ToUInt32(data, 3);
     if (data.Length > 8)
     {
     this.info = ByteConverter.GetNullString(data, 7);
     }
 }