Ejemplo n.º 1
0
        private void OnPacketSend(ref CSteamID steamID, ref ESteamPacket type, ref byte[] packet, ref int size, ref int channel, ref bool cancel)
        {
            if (type != ESteamPacket.CONNECTED)
            {
                return;
            }

            object[] info = SteamPacker.getObjects(steamID, 0, 0, packet, new Type[]
            {
                Types.BYTE_TYPE,
                Types.STEAM_ID_TYPE,
                Types.BYTE_TYPE,
                Types.STRING_TYPE,
                Types.STRING_TYPE,
                Types.VECTOR3_TYPE,
                Types.BYTE_TYPE,
                Types.BOOLEAN_TYPE,
                Types.BOOLEAN_TYPE,
                Types.INT32_TYPE,
                Types.STEAM_ID_TYPE,
                Types.STRING_TYPE,
                Types.BYTE_TYPE,
                Types.BYTE_TYPE,
                Types.BYTE_TYPE,
                Types.COLOR_TYPE,
                Types.COLOR_TYPE,
                Types.BOOLEAN_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_TYPE,
                Types.INT32_ARRAY_TYPE,
                Types.BYTE_TYPE,
                Types.STRING_TYPE
            });
            UnturnedPlayer player = UnturnedPlayer.Get((CSteamID)info[1]);

            if (player.SteamID != steamID)
            {
                info[3]  = player.PlayerName;
                info[4]  = player.CharacterName;
                info[11] = player.NickName;
            }
            else
            {
                info[3]  = player.PlayerName;
                info[4]  = player.UnturnedCharacterName;
                info[11] = player.UnturnedNickName;
            }

            packet = SteamPacker.getBytes(0, out size, info);
        }
Ejemplo n.º 2
0
        private void OnSetVisible(UnturnedPlayer player, UnturnedPlayer target)
        {
            byte[] bytes = SteamPacker.getBytes(0, out int size, new object[]
            {
                11,
                target.SteamPlayerID.steamID,
                target.SteamPlayerID.characterID,
                target.PlayerName,
                target.CharacterName,
                target.SteamPlayer.model.transform.position,
                (byte)(target.SteamPlayer.model.transform.rotation.eulerAngles.y / 2f),
                target.SteamPlayer.isPro,
                target.SteamPlayer.isAdmin && !Provider.hideAdmins,
                target.SteamPlayer.channel,
                target.SteamPlayer.playerID.group,
                target.NickName,
                target.SteamPlayer.face,
                target.SteamPlayer.hair,
                target.SteamPlayer.beard,
                target.SteamPlayer.skin,
                target.SteamPlayer.color,
                target.SteamPlayer.hand,
                target.SteamPlayer.shirtItem,
                target.SteamPlayer.pantsItem,
                target.SteamPlayer.hatItem,
                target.SteamPlayer.backpackItem,
                target.SteamPlayer.vestItem,
                target.SteamPlayer.maskItem,
                target.SteamPlayer.glassesItem,
                target.SteamPlayer.skinItems,
                (byte)target.SteamPlayer.skillset,
                target.SteamPlayer.language
            });

            Provider.send(player.SteamID, ESteamPacket.CONNECTED, bytes, size, 0);
        }
        public static bool Prefix(CSteamID steamID, byte[] packet, int offset)
        {
            var steamPacket = (ESteamPacket)packet[offset];

            if (steamPacket == ESteamPacket.CONNECT)
            {
                for (int l = 0; l < Provider.pending.Count; l++)
                {
                    if (Provider.pending[l].playerID.steamID == steamID)
                    {
                        Provider.reject(steamID, ESteamRejection.ALREADY_PENDING);
                        return(false);
                    }
                }
                for (int m = 0; m < Provider.clients.Count; m++)
                {
                    if (Provider.clients[m].playerID.steamID == steamID)
                    {
                        Provider.reject(steamID, ESteamRejection.ALREADY_CONNECTED);
                        return(false);
                    }
                }
                object[] objects = SteamPacker.getObjects(steamID, offset, 0, packet, new Type[]
                {
                    Types.BYTE_TYPE,
                    Types.BYTE_TYPE,
                    Types.STRING_TYPE,
                    Types.STRING_TYPE,
                    Types.BYTE_ARRAY_TYPE,
                    Types.BYTE_ARRAY_TYPE,
                    Types.BYTE_ARRAY_TYPE,
                    Types.BYTE_TYPE,
                    Types.UINT32_TYPE,
                    Types.BOOLEAN_TYPE,
                    Types.SINGLE_TYPE,
                    Types.STRING_TYPE,
                    Types.STEAM_ID_TYPE,
                    Types.BYTE_TYPE,
                    Types.BYTE_TYPE,
                    Types.BYTE_TYPE,
                    Types.COLOR_TYPE,
                    Types.COLOR_TYPE,
                    Types.COLOR_TYPE,
                    Types.BOOLEAN_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_TYPE,
                    Types.UINT64_ARRAY_TYPE,
                    Types.BYTE_TYPE,
                    Types.STRING_TYPE,
                    Types.STRING_TYPE,
                    Types.STEAM_ID_TYPE,
                    Types.UINT32_TYPE,
                    Types.BYTE_ARRAY_TYPE
                });
                byte[] array3 = (byte[])objects[33];
                if (array3.Length != 20)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_HASH_ASSEMBLY);
                    return(false);
                }
                byte newCharacterID = (byte)objects[1];
                if (!Provider.modeConfigData.Players.Allow_Per_Character_Saves)
                {
                    newCharacterID = 0;
                }
                SteamPlayerID steamPlayerID = new SteamPlayerID(steamID, newCharacterID, (string)objects[2], (string)objects[3], (string)objects[11], (CSteamID)objects[12], array3);
                if ((uint)objects[8] != Provider.APP_VERSION_PACKED)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_VERSION, Provider.APP_VERSION);
                    return(false);
                }
                if ((uint)objects[32] != Level.packedVersion)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_LEVEL_VERSION, Level.version);
                    return(false);
                }
                if (steamPlayerID.playerName.Length < 2)
                {
                    Provider.reject(steamID, ESteamRejection.NAME_PLAYER_SHORT);
                    return(false);
                }
                if (steamPlayerID.characterName.Length < 2)
                {
                    Provider.reject(steamID, ESteamRejection.NAME_CHARACTER_SHORT);
                    return(false);
                }
                if (steamPlayerID.playerName.Length > 32)
                {
                    Provider.reject(steamID, ESteamRejection.NAME_PLAYER_LONG);
                    return(false);
                }
                if (steamPlayerID.characterName.Length > 32)
                {
                    Provider.reject(steamID, ESteamRejection.NAME_CHARACTER_LONG);
                    return(false);
                }

                if (long.TryParse(steamPlayerID.playerName, NumberStyles.Any, CultureInfo.InvariantCulture, out _) || double.TryParse(steamPlayerID.playerName, NumberStyles.Any, CultureInfo.InvariantCulture, out _))
                {
                    Provider.reject(steamID, ESteamRejection.NAME_PLAYER_NUMBER);
                    return(false);
                }

                if (long.TryParse(steamPlayerID.characterName, NumberStyles.Any, CultureInfo.InvariantCulture, out _) || double.TryParse(steamPlayerID.characterName, NumberStyles.Any, CultureInfo.InvariantCulture, out _))
                {
                    Provider.reject(steamID, ESteamRejection.NAME_CHARACTER_NUMBER);
                    return(false);
                }
                if (Provider.filterName)
                {
                    if (!NameTool.isValid(steamPlayerID.playerName))
                    {
                        Provider.reject(steamID, ESteamRejection.NAME_PLAYER_INVALID);
                        return(false);
                    }
                    if (!NameTool.isValid(steamPlayerID.characterName))
                    {
                        Provider.reject(steamID, ESteamRejection.NAME_CHARACTER_INVALID);
                        return(false);
                    }
                }
                if (NameTool.containsRichText(steamPlayerID.playerName))
                {
                    Provider.reject(steamID, ESteamRejection.NAME_PLAYER_INVALID);
                    return(false);
                }
                if (NameTool.containsRichText(steamPlayerID.characterName))
                {
                    Provider.reject(steamID, ESteamRejection.NAME_CHARACTER_INVALID);
                    return(false);
                }
                uint remoteIP;
                if (SteamGameServerNetworking.GetP2PSessionState(steamID, out P2PSessionState_t p2PSessionState_t))
                {
                    remoteIP = p2PSessionState_t.m_nRemoteIP;
                }
                else
                {
                    remoteIP = 0U;
                }
                Utils.checkBanStatus(steamPlayerID, remoteIP, out bool flag3, out string object_, out uint num5);
                if (flag3)
                {
                    byte[] bytes3 = SteamPacker.getBytes(0, out int size4, 9, object_, num5);
                    Provider.send(steamID, ESteamPacket.BANNED, bytes3, size4, 0);
                    return(false);
                }
                bool flag4 = SteamWhitelist.checkWhitelisted(steamID);
                if (Provider.isWhitelisted && !flag4)
                {
                    Provider.reject(steamID, ESteamRejection.WHITELISTED);
                    return(false);
                }
                if (Provider.clients.Count - Dummy.Instance.Dummies.Count + 1 > Provider.maxPlayers && Provider.pending.Count + 1 > Provider.queueSize)
                {
                    Provider.reject(steamID, ESteamRejection.SERVER_FULL);
                    return(false);
                }
                byte[] array4 = (byte[])objects[4];
                if (array4.Length != 20)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_PASSWORD);
                    return(false);
                }
                byte[] array5 = (byte[])objects[5];
                if (array5.Length != 20)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_HASH_LEVEL);
                    return(false);
                }
                byte[] array6 = (byte[])objects[6];
                if (array6.Length != 20)
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_HASH_ASSEMBLY);
                    return(false);
                }
                string             text = (string)objects[29];
                ModuleDependency[] array7;
                if (string.IsNullOrEmpty(text))
                {
                    array7 = Array.Empty <ModuleDependency>();
                }
                else
                {
                    string[] array8 = text.Split(new char[]
                    {
                        ';'
                    });
                    array7 = new ModuleDependency[array8.Length];
                    for (int n = 0; n < array7.Length; n++)
                    {
                        string[] array9 = array8[n].Split(new char[]
                        {
                            ','
                        });
                        if (array9.Length == 2)
                        {
                            array7[n] = new ModuleDependency
                            {
                                Name = array9[0]
                            };
                            uint.TryParse(array9[1], NumberStyles.Any, CultureInfo.InvariantCulture, out array7[n].Version_Internal);
                        }
                    }
                }
                var moduleList = new List <Module>();
                ModuleHook.getRequiredModules(moduleList);
                bool flag5 = true;
                for (int num6 = 0; num6 < array7.Length; num6++)
                {
                    bool flag6 = false;
                    if (array7[num6] != null)
                    {
                        for (int num7 = 0; num7 < moduleList.Count; num7++)
                        {
                            if (moduleList[num7]?.config != null && moduleList[num7].config.Name == array7[num6].Name && moduleList[num7].config.Version_Internal >= array7[num6].Version_Internal)
                            {
                                flag6 = true;
                                break;
                            }
                        }
                    }
                    if (!flag6)
                    {
                        flag5 = false;
                        break;
                    }
                }
                if (!flag5)
                {
                    Provider.reject(steamID, ESteamRejection.CLIENT_MODULE_DESYNC);
                    return(false);
                }
                bool flag7 = true;
                for (int num8 = 0; num8 < moduleList.Count; num8++)
                {
                    bool flag8 = false;
                    if (moduleList[num8]?.config != null)
                    {
                        for (int num9 = 0; num9 < array7.Length; num9++)
                        {
                            if (array7[num9] != null && array7[num9].Name == moduleList[num8].config.Name && array7[num9].Version_Internal >= moduleList[num8].config.Version_Internal)
                            {
                                flag8 = true;
                                break;
                            }
                        }
                    }
                    if (!flag8)
                    {
                        flag7 = false;
                        break;
                    }
                }
                if (!flag7)
                {
                    Provider.reject(steamID, ESteamRejection.SERVER_MODULE_DESYNC);
                    return(false);
                }
                if (!string.IsNullOrEmpty(Provider.serverPassword) && !Hash.verifyHash(array4, Provider.serverPasswordHash))
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_PASSWORD);
                    return(false);
                }
                if (!Hash.verifyHash(array5, Level.hash))
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_HASH_LEVEL);
                    return(false);
                }
                if (!ReadWrite.appIn(array6, (byte)objects[7]))
                {
                    Provider.reject(steamID, ESteamRejection.WRONG_HASH_ASSEMBLY);
                    return(false);
                }
                if ((float)objects[10] >= Provider.configData.Server.Max_Ping_Milliseconds / 1000f)
                {
                    Provider.reject(steamID, ESteamRejection.PING);
                    return(false);
                }
                Utils.notifyClientPending(steamID);
                SteamPending item = new SteamPending(steamPlayerID, (bool)objects[9], (byte)objects[13], (byte)objects[14], (byte)objects[15], (Color)objects[16], (Color)objects[17], (Color)objects[18], (bool)objects[19], (ulong)objects[20], (ulong)objects[21], (ulong)objects[22], (ulong)objects[23], (ulong)objects[24], (ulong)objects[25], (ulong)objects[26], (ulong[])objects[27], (EPlayerSkillset)((byte)objects[28]), (string)objects[30], (CSteamID)objects[31]);
                if (Provider.isWhitelisted || !flag4)
                {
                    Provider.pending.Add(item);
                    if (Provider.pending.Count == 1)
                    {
                        Utils.verifyNextPlayerInQueue();
                    }
                    return(false);
                }
                if (Provider.pending.Count == 0)
                {
                    Provider.pending.Add(item);
                    Utils.verifyNextPlayerInQueue();
                    return(false);
                }
                Provider.pending.Insert(1, item);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 4
0
        public static bool Prefix(int level,
                                  ref List <SDG.Framework.Modules.Module> ___critMods,
                                  ref StringBuilder ___modBuilder,
                                  ref byte[] ____serverPasswordHash)
        {
            if (level == 2)
            {
                Provider.isLoadingUGC = false;
                if (Provider.isConnected)
                {
                    int  num12;
                    byte num13 = 1;
                    ___critMods.Clear();
                    ___modBuilder.Length = 0;
                    SDG.Framework.Modules.ModuleHook.getRequiredModules(___critMods);
                    for (int m = 0; m < ___critMods.Count; m++)
                    {
                        ___modBuilder.Append(___critMods[m].config.Name);
                        ___modBuilder.Append(",");
                        ___modBuilder.Append(___critMods[m].config.Version_Internal);
                        if (m < (___critMods.Count - 1))
                        {
                            ___modBuilder.Append(";");
                        }
                    }

                    object[] objects = new object[] {
                        (byte)2, Characters.selected,
                        Provider.clientName,
                        Characters.active.name,
                        ____serverPasswordHash, Level.hash, ReadWrite.appOut(), num13,
                        Provider.APP_VERSION_PACKED,
                        Provider.isPro,
                        ((float)Provider.currentServerInfo.ping) / 1000f,
                        Characters.active.nick,
                        Characters.active.group,
                        Characters.active.face,
                        Characters.active.hair,
                        Characters.active.beard,
                        Characters.active.skin,
                        Characters.active.color,
                        Characters.active.markerColor,
                        Characters.active.hand,
                        Characters.active.packageShirt,
                        Characters.active.packagePants,
                        Characters.active.packageHat,
                        Characters.active.packageBackpack,
                        Characters.active.packageVest,
                        Characters.active.packageMask,
                        Characters.active.packageGlasses,
                        Characters.packageSkins.ToArray(),
                        (byte)Characters.active.skillset, ___modBuilder.ToString(), Translator.language, Lobbies.currentLobby, Level.packedVersion,
                        LocalHwid.getHwid()
                    };

                    //Allows us to auto-detect inventory selected items without additional work.
                    Skins.SkinsUsing = Characters.packageSkins;
                    ulong[] Converting = new ulong[7] {
                        Characters.active.packageShirt,
                        Characters.active.packagePants,
                        Characters.active.packageHat,
                        Characters.active.packageBackpack,
                        Characters.active.packageVest,
                        Characters.active.packageMask,
                        Characters.active.packageGlasses
                    };
                    foreach (Skins.Sk t in Skins.SkinList)
                    {
                        for (int p = 0; p < 7; p++)
                        {
                            if (Converting[p] == t.instanceId)
                            {
                                Skins.Clothes[p] = t.itemDef;
                            }
                        }
                    }

                    Console.WriteLine("P:" + Provider.APP_VERSION_PACKED + " | L:" + Level.packedVersion);

                    byte[] packet = SteamPacker.getBytes(0, out num12, objects);
                    Provider.send(Provider.server, ESteamPacket.CONNECT, packet, num12, 0);
                    return(false);
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
 public static void notifyClientPending(CSteamID remoteSteamID)
 {
     byte[] bytes = SteamPacker.getBytes(0, out int size, 26);
     Provider.send(remoteSteamID, ESteamPacket.CLIENT_PENDING, bytes, size, 0);
 }
Ejemplo n.º 6
0
        public static void IShit(CSteamID steamID, byte[] packet, int offset, int size, int channel)
        {
            Provider._bytesReceived += (uint)size;
            Provider._packetsReceived++;
            if (Dedicator.isDedicated)
            {
                ESteamPacket packet2 = (ESteamPacket)packet[offset];
                if (Provider.isUpdate(packet2))
                {
                    if (steamID == Provider.server)
                    {
                        for (int i = 0; i < Provider.receivers.Count; i++)
                        {
                            if (Provider.receivers[i].id == channel)
                            {
                                Provider.receivers[i].receive(steamID, packet, offset, size);
                                return;
                            }
                        }
                    }
                    else
                    {
                        for (int j = 0; j < Provider.clients.Count; j++)
                        {
                            if (Provider.clients[j].playerID.steamID == steamID)
                            {
                                for (int k = 0; k < Provider.receivers.Count; k++)
                                {
                                    if (Provider.receivers[k].id == channel)
                                    {
                                        Provider.receivers[k].receive(steamID, packet, offset, size);
                                        return;
                                    }
                                }
                                return;
                            }
                        }
                    }
                }
                else
                {
                    SteamPending pending;
                    switch (packet2)
                    {
                    case ESteamPacket.WORKSHOP:
                    {
                        ulong        num8;
                        List <ulong> list     = new List <ulong>();
                        string[]     strArray = ReadWrite.getFolders("/Bundles/Workshop/Content");
                        for (int m = 0; m < strArray.Length; m++)
                        {
                            ulong num5;
                            if (ulong.TryParse(ReadWrite.folderName(strArray[m]), out num5))
                            {
                                list.Add(num5);
                            }
                        }
                        string[] strArray2 = ReadWrite.getFolders(ServerSavedata.directory + "/" + Provider.serverID + "/Workshop/Content");
                        for (int n = 0; n < strArray2.Length; n++)
                        {
                            ulong num7;
                            if (ulong.TryParse(ReadWrite.folderName(strArray2[n]), out num7))
                            {
                                list.Add(num7);
                            }
                        }
                        if (ulong.TryParse(new DirectoryInfo(Level.info.path).Parent.Name, out num8))
                        {
                            list.Add(num8);
                        }
                        byte[] array = new byte[2 + (list.Count * 8)];
                        array[0] = 1;
                        array[1] = (byte)list.Count;
                        for (byte num9 = 0; num9 < list.Count; num9 = (byte)(num9 + 1))
                        {
                            BitConverter.GetBytes(list[num9]).CopyTo(array, (int)(2 + (num9 * 8)));
                        }
                        Provider.send(steamID, ESteamPacket.WORKSHOP, array, array.Length, 0);
                        return;
                    }

                    case ESteamPacket.TICK:
                    {
                        int      num10;
                        object[] objects = new object[] { (byte)14, Provider.net };
                        byte[]   buffer2 = SteamPacker.getBytes(0, out num10, objects);
                        Provider.send(steamID, ESteamPacket.TIME, buffer2, num10, 0);
                        return;
                    }

                    case ESteamPacket.TIME:
                        for (int num11 = 0; num11 < Provider.clients.Count; num11++)
                        {
                            if (Provider.clients[num11].playerID.steamID == steamID)
                            {
                                if (Provider.clients[num11].lastPing > 0f)
                                {
                                    Provider.clients[num11].lastNet = Time.realtimeSinceStartup;
                                    Provider.clients[num11].lag(Time.realtimeSinceStartup - Provider.clients[num11].lastPing);
                                    Provider.clients[num11].lastPing = -1f;
                                }
                                return;
                            }
                        }
                        return;

                    case ESteamPacket.CONNECT:
                    {
                        long             num14;
                        double           num15;
                        long             num16;
                        double           num17;
                        SteamBlacklistID tid;
                        for (int num12 = 0; num12 < Provider.pending.Count; num12++)
                        {
                            if (Provider.pending[num12].playerID.steamID == steamID)
                            {
                                Provider.Reject(steamID, ESteamRejection.ALREADY_PENDING);
                                return;
                            }
                        }
                        for (int num13 = 0; num13 < Provider.clients.Count; num13++)
                        {
                            if (Provider.clients[num13].playerID.steamID == steamID)
                            {
                                Provider.Reject(steamID, ESteamRejection.ALREADY_CONNECTED);
                                return;
                            }
                        }
                        Type[] types = new Type[] {
                            Types.BYTE_TYPE, Types.BYTE_TYPE, Types.STRING_TYPE, Types.STRING_TYPE, Types.BYTE_ARRAY_TYPE, Types.BYTE_ARRAY_TYPE, Types.BYTE_ARRAY_TYPE, Types.BYTE_TYPE, Types.STRING_TYPE, Types.BOOLEAN_TYPE, Types.SINGLE_TYPE, Types.STRING_TYPE, Types.STEAM_ID_TYPE, Types.BYTE_TYPE, Types.BYTE_TYPE, Types.BYTE_TYPE,
                            Types.COLOR_TYPE, Types.COLOR_TYPE, Types.BOOLEAN_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_TYPE, Types.UINT64_ARRAY_TYPE, Types.BYTE_TYPE
                        };
                        object[]      objArray    = SteamPacker.getObjects(steamID, offset, 0, packet, types);
                        SteamPlayerID newPlayerID = new SteamPlayerID(steamID, (byte)objArray[1], (string)objArray[2], (string)objArray[3], (string)objArray[11], (CSteamID)objArray[12]);
                        if (((string)objArray[8]) != Provider.Version)
                        {
                            Provider.Reject(steamID, ESteamRejection.WRONG_VERSION);
                            return;
                        }
                        if (newPlayerID.SteamName.Length < 2)
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_PLAYER_SHORT);
                            return;
                        }
                        if (newPlayerID.CharacterName.Length < 2)
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_CHARACTER_SHORT);
                            return;
                        }
                        if (newPlayerID.SteamName.Length > 0x20)
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_PLAYER_LONG);
                            return;
                        }
                        if (newPlayerID.CharacterName.Length > 0x20)
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_CHARACTER_LONG);
                            return;
                        }
                        if (long.TryParse(newPlayerID.SteamName, out num14) || double.TryParse(newPlayerID.SteamName, out num15))
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_PLAYER_NUMBER);
                            return;
                        }
                        if (long.TryParse(newPlayerID.CharacterName, out num16) || double.TryParse(newPlayerID.CharacterName, out num17))
                        {
                            Provider.Reject(steamID, ESteamRejection.NAME_CHARACTER_NUMBER);
                            return;
                        }
                        if (Provider.filterName)
                        {
                            if (!NameTool.isValid(newPlayerID.SteamName))
                            {
                                Provider.Reject(steamID, ESteamRejection.NAME_PLAYER_INVALID);
                                return;
                            }
                            if (!NameTool.isValid(newPlayerID.CharacterName))
                            {
                                Provider.Reject(steamID, ESteamRejection.NAME_CHARACTER_INVALID);
                                return;
                            }
                        }
                        if (SteamBlacklist.checkBanned(steamID, out tid))
                        {
                            int      num18;
                            object[] objArray2 = new object[] { (byte)9, tid.reason, tid.getTime() };
                            byte[]   buffer3   = SteamPacker.getBytes(0, out num18, objArray2);
                            Provider.send(steamID, ESteamPacket.BANNED, buffer3, num18, 0);
                            return;
                        }
                        if (!SteamWhitelist.checkWhitelisted(steamID))
                        {
                            Provider.Reject(steamID, ESteamRejection.WHITELISTED);
                            return;
                        }
                        if ((Provider.clients.Count + 1) > Provider.maxPlayers)
                        {
                            Provider.Reject(steamID, ESteamRejection.SERVER_FULL);
                            return;
                        }
                        byte[] buffer4 = (byte[])objArray[4];
                        if (buffer4.Length != 20)
                        {
                            Provider.Reject(steamID, ESteamRejection.WRONG_HASH);
                            return;
                        }
                        byte[] buffer5 = (byte[])objArray[5];
                        if (buffer5.Length != 20)
                        {
                            Provider.Reject(steamID, ESteamRejection.WRONG_HASH);
                            return;
                        }
                        byte[] h = (byte[])objArray[6];
                        if (h.Length != 20)
                        {
                            Provider.Reject(steamID, ESteamRejection.WRONG_HASH);
                            return;
                        }
                        if ((Provider.serverPassword == string.Empty) || Hash.verifyHash(buffer4, Provider._serverPasswordHash))
                        {
                            if (Hash.verifyHash(buffer5, Level.hash))
                            {
                                if (ReadWrite.appIn(h, (byte)objArray[7]))
                                {
                                    if (((float)objArray[10]) < Provider.timeout)
                                    {
                                        Provider.pending.Add(new SteamPending(newPlayerID, (bool)objArray[9], (byte)objArray[13], (byte)objArray[14], (byte)objArray[15], (Color)objArray[0x10], (Color)objArray[0x11], (bool)objArray[0x12], (ulong)objArray[0x13], (ulong)objArray[20], (ulong)objArray[0x15], (ulong)objArray[0x16], (ulong)objArray[0x17], (ulong)objArray[0x18], (ulong)objArray[0x19], (ulong[])objArray[0x1a], (EPlayerSpeciality)((byte)objArray[0x1b])));
                                        byte[] buffer1 = new byte[] { 3 };
                                        Provider.send(steamID, ESteamPacket.VERIFY, buffer1, 1, 0);
                                        return;
                                    }
                                    Provider.Reject(steamID, ESteamRejection.PING);
                                    return;
                                }
                                Provider.Reject(steamID, ESteamRejection.WRONG_HASH);
                                return;
                            }
                            Provider.Reject(steamID, ESteamRejection.WRONG_HASH);
                            return;
                        }
                        Provider.Reject(steamID, ESteamRejection.WRONG_PASSWORD);
                        return;
                    }

                    default:
                        if (packet2 != ESteamPacket.AUTHENTICATE)
                        {
                            Debug.LogError("Failed to handle message: " + packet2);
                            return;
                        }
                        pending = null;
                        for (int num19 = 0; num19 < Provider.pending.Count; num19++)
                        {
                            if (Provider.pending[num19].playerID.steamID == steamID)
                            {
                                pending = Provider.pending[num19];
                                break;
                            }
                        }
                        break;
                    }
                    if (pending == null)
                    {
                        Provider.Reject(steamID, ESteamRejection.NOT_PENDING);
                    }
                    else if ((Provider.clients.Count + 1) > Provider.maxPlayers)
                    {
                        Provider.Reject(steamID, ESteamRejection.SERVER_FULL);
                    }
                    else
                    {
                        ushort count = BitConverter.ToUInt16(packet, 1);
                        byte[] dst   = new byte[count];
                        Buffer.BlockCopy(packet, 3, dst, 0, count);
                        ushort num21   = BitConverter.ToUInt16(packet, 3 + count);
                        byte[] buffer8 = new byte[num21];
                        Buffer.BlockCopy(packet, 5 + count, buffer8, 0, num21);
                        if (!Provider.verifyTicket(steamID, dst))
                        {
                            Provider.Reject(steamID, ESteamRejection.AUTH_VERIFICATION);
                        }
                        else if (num21 > 0)
                        {
                            if (!SteamGameServerInventory.DeserializeResult(out pending.inventoryResult, buffer8, num21, false))
                            {
                                Provider.Reject(steamID, ESteamRejection.AUTH_ECON);
                            }
                        }
                        else
                        {
                            pending.shirtItem        = 0;
                            pending.pantsItem        = 0;
                            pending.hatItem          = 0;
                            pending.backpackItem     = 0;
                            pending.vestItem         = 0;
                            pending.maskItem         = 0;
                            pending.glassesItem      = 0;
                            pending.skinItems        = new int[0];
                            pending.packageShirt     = 0L;
                            pending.packagePants     = 0L;
                            pending.packageHat       = 0L;
                            pending.packageBackpack  = 0L;
                            pending.packageVest      = 0L;
                            pending.packageMask      = 0L;
                            pending.packageGlasses   = 0L;
                            pending.packageSkins     = new ulong[0];
                            pending.inventoryResult  = SteamInventoryResult_t.Invalid;
                            pending.inventoryDetails = new SteamItemDetails_t[0];
                            pending.hasProof         = true;
                        }
                    }
                }
            }
        }