コード例 #1
0
ファイル: AuthPacket.cs プロジェクト: drolean/Arctium-RE
        public AuthPacket(AuthServerMessage message, AuthChannel channel = AuthChannel.None)
        {
            while (true)
            {
IL_111:
                uint arg_E5_0 = 4169648401u;
                while (true)
                {
                    uint num;
                    switch ((num = (arg_E5_0 ^ 2523131924u)) % 8u)
                    {
                    case 0u:
                        goto IL_111;

                    case 2u:
                        this.Header = new AuthPacketHeader();
                        arg_E5_0    = (num * 4138080164u ^ 2675252904u);
                        continue;

                    case 3u:
                        this.Write <byte>((byte)this.Header.Channel, 4);
                        arg_E5_0 = (num * 3127461979u ^ 2628254444u);
                        continue;

                    case 4u:
                        this.Header.Message = (byte)message;
                        arg_E5_0            = (num * 1888841257u ^ 182257382u);
                        continue;

                    case 5u:
                        this.stream = AuthPacket.smethod_1(AuthPacket.smethod_0());
                        arg_E5_0    = (num * 4268182235u ^ 1808986985u);
                        continue;

                    case 6u:
                    {
                        this.Header.Channel = channel;
                        bool flag = channel > AuthChannel.None;
                        this.Write <byte>(this.Header.Message, 6);
                        arg_E5_0 = (num * 1702613302u ^ 3433456695u);
                        continue;
                    }

                    case 7u:
                    {
                        bool flag;
                        this.Write <bool>(flag, 1);
                        arg_E5_0 = (((!flag) ? 1611924362u : 28007344u) ^ num * 3110452489u);
                        continue;
                    }
                    }
                    return;
                }
            }
        }
コード例 #2
0
        public AuthPacket(AuthServerMessage message, AuthChannel channel = AuthChannel.None)
        {
            stream = new BinaryWriter(new MemoryStream());

            Header         = new AuthPacketHeader();
            Header.Message = (byte)message;
            Header.Channel = channel;

            var hasChannel = channel != AuthChannel.None;

            Write(Header.Message, 6);
            Write(hasChannel, 1);

            if (hasChannel)
            {
                Write((byte)Header.Channel, 4);
            }
        }
コード例 #3
0
ファイル: AuthPacket.cs プロジェクト: sebasbrs/Arctium-WoW
        public AuthPacket(AuthServerMessage message, AuthChannel channel = AuthChannel.Authentication)
        {
            writeStream = new BinaryWriter(new MemoryStream());

            Header         = new AuthPacketHeader();
            Header.Message = (ushort)message;
            Header.Channel = channel;

            var hasChannel = channel != AuthChannel.Authentication;
            var msg        = Header.Message >= 0x7E ? (Header.Message >> (byte)channel) - 0x3F : Header.Message - 0x3F;

            Write(msg, 6);
            Write(hasChannel, 1);

            if (hasChannel)
            {
                Write((byte)Header.Channel, 4);
            }
        }
コード例 #4
0
 public AuthMessageAttribute(AuthClientMessage message, AuthChannel channel)
 {
     Message = message;
     Channel = channel;
 }
コード例 #5
0
ファイル: MasterServer.cs プロジェクト: GAM-4-5/SpaceRTS
 public void AddHook(Channels channel, AuthChannel subChannel, Action <NetIncomingMessage, object> hook, bool oneTime)
 {
     AddHook((int)channel, (int)subChannel, hook, oneTime);
 }
コード例 #6
0
        public static async void Write <T>(ushort value, byte[] data, EndPoint remote, AuthChannel channel = 0)
        {
            Func <Task> write = async delegate
            {
                var sb         = new StringBuilder();
                var endPoint   = remote as IPEndPoint;
                var clientInfo = endPoint.Address + ":" + endPoint.Port;

                sb.AppendLine(string.Format("Client: {0}", clientInfo));
                sb.AppendLine(string.Format("Time: {0}", DateTime.Now.ToString()));
                sb.AppendLine(string.Format("Type: {0}", typeof(T).Name));

                if (Enum.IsDefined(typeof(T), value))
                {
                    sb.AppendLine(string.Format("Name: {0}", Enum.GetName(typeof(T), value)));
                }

                if (typeof(T) == typeof(AuthClientMessage) || typeof(T) == typeof(AuthServerMessage))
                {
                    sb.AppendLine(string.Format("Channel: {0}", channel));
                }

                sb.AppendLine(string.Format("Value: 0x{0:X} ({0})", value));
                sb.AppendLine(string.Format("Length: {0}", data.Length));

                sb.AppendLine("|----------------------------------------------------------------|");
                sb.AppendLine("| 00  01  02  03  04  05  06  07  08  09  0A  0B  0C  0D  0E  0F |");
                sb.AppendLine("|----------------------------------------------------------------|");
                sb.Append("|");

                var count = 0;
                var ctr   = 0;

                foreach (var b in data)
                {
                    sb.Append(string.Format(" {0:X2} ", b));

                    if (count == 0xF)
                    {
                        sb.Append("|");
                        sb.Append("  " + Encoding.UTF8.GetString(data, ctr * 0x10, 0x10));
                        sb.AppendLine();
                        sb.Append("|");

                        count = 0;

                        ++ctr;
                    }
                    else
                    {
                        count++;
                    }
                }
                ;

                sb.AppendLine("");
                sb.AppendLine("|----------------------------------------------------------------|");
                sb.AppendLine("");

                await logger.Write(sb.ToString());
            };

            await write();
        }
コード例 #7
0
 public AuthMessageAttribute(AuthClientMessage message, AuthChannel channel)
 {
     Message = message;
     Channel = channel;
 }
コード例 #8
0
 protected ServerPacket(AuthServerMessage netMessage, AuthChannel channel = AuthChannel.Authentication)
 {
     Packet = new AuthPacket(netMessage, channel);
 }
コード例 #9
0
 public static void SendMessageAndGetResponse(Channels channel, AuthChannel subChannel, object message, Action <object> response)
 {
     SendMessageAndGetResponse((int)channel, (int)subChannel, message, response);
 }
コード例 #10
0
 public static void AddHook(Channels channel, AuthChannel subChannel, Action <object> hook, bool oneTime)
 {
     AddHook((int)channel, (int)subChannel, hook, oneTime);
 }
コード例 #11
0
 public static void SendMessage(Channels channel, AuthChannel subChannel, object message, NetDeliveryMethod method)
 {
     SendMessage((int)channel, (int)subChannel, message, method);
 }