Ejemplo n.º 1
0
 // Token: 0x06002A02 RID: 10754 RVA: 0x00104A95 File Offset: 0x00102E95
 public static void rename(string name)
 {
     Characters.active.name = name;
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
Ejemplo n.º 2
0
 // Token: 0x06002A0C RID: 10764 RVA: 0x00104BF7 File Offset: 0x00102FF7
 public static void ungroup()
 {
     Characters.active.group = CSteamID.Nil;
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
Ejemplo n.º 3
0
 // Token: 0x06002A09 RID: 10761 RVA: 0x00104B5E File Offset: 0x00102F5E
 public static void renick(string nick)
 {
     Characters.active.nick = nick;
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
Ejemplo n.º 4
0
 // Token: 0x06002A0D RID: 10765 RVA: 0x00104C26 File Offset: 0x00103026
 public static void hand(bool state)
 {
     Characters.active.hand = state;
     Characters.apply(false, false);
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
Ejemplo n.º 5
0
 // Token: 0x06002A03 RID: 10755 RVA: 0x00104AC0 File Offset: 0x00102EC0
 public static void skillify(EPlayerSkillset skillset)
 {
     Characters.active.skillset = skillset;
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
     Characters.active.applyHero();
     Characters.apply();
 }
Ejemplo n.º 6
0
 // Token: 0x06002A0B RID: 10763 RVA: 0x00104B98 File Offset: 0x00102F98
 public static void group(CSteamID group)
 {
     if (Characters.active.group == group)
     {
         Characters.active.group = CSteamID.Nil;
     }
     else
     {
         Characters.active.group = group;
     }
     if (Characters.onCharacterUpdated != null)
     {
         Characters.onCharacterUpdated(Characters.selected, Characters.active);
     }
 }
Ejemplo n.º 7
0
        // Token: 0x06002A1C RID: 10780 RVA: 0x00105C74 File Offset: 0x00104074
        public static void load()
        {
            Characters.initialApply = false;
            Provider.provider.economyService.refreshInventory();
            if (Characters.list != null)
            {
                byte b = 0;
                while ((int)b < Characters.list.Length)
                {
                    if (Characters.list[(int)b] != null)
                    {
                        if (Characters.onCharacterUpdated != null)
                        {
                            Characters.onCharacterUpdated(b, Characters.list[(int)b]);
                        }
                    }
                    b += 1;
                }
                return;
            }
            Characters.list          = new Character[(int)(Customization.FREE_CHARACTERS + Customization.PRO_CHARACTERS)];
            Characters._packageSkins = new List <ulong>();
            if (ReadWrite.fileExists("/Characters.dat", true))
            {
                Block block = ReadWrite.readBlock("/Characters.dat", true, 0);
                if (block != null)
                {
                    byte b2 = block.readByte();
                    if (b2 >= 12)
                    {
                        if (b2 >= 14)
                        {
                            ushort num = block.readUInt16();
                            for (ushort num2 = 0; num2 < num; num2 += 1)
                            {
                                ulong num3 = block.readUInt64();
                                if (num3 != 0UL)
                                {
                                    Characters.packageSkins.Add(num3);
                                }
                            }
                        }
                        Characters._selected = block.readByte();
                        if (!Provider.isPro && Characters.selected >= Customization.FREE_CHARACTERS)
                        {
                            Characters._selected = 0;
                        }
                        byte b3 = 0;
                        while ((int)b3 < Characters.list.Length)
                        {
                            ushort newShirt           = block.readUInt16();
                            ushort newPants           = block.readUInt16();
                            ushort newHat             = block.readUInt16();
                            ushort newBackpack        = block.readUInt16();
                            ushort newVest            = block.readUInt16();
                            ushort newMask            = block.readUInt16();
                            ushort newGlasses         = block.readUInt16();
                            ulong  newPackageShirt    = block.readUInt64();
                            ulong  newPackagePants    = block.readUInt64();
                            ulong  newPackageHat      = block.readUInt64();
                            ulong  newPackageBackpack = block.readUInt64();
                            ulong  newPackageVest     = block.readUInt64();
                            ulong  newPackageMask     = block.readUInt64();
                            ulong  newPackageGlasses  = block.readUInt64();
                            ushort newPrimaryItem     = block.readUInt16();
                            byte[] newPrimaryState    = block.readByteArray();
                            ushort newSecondaryItem   = block.readUInt16();
                            byte[] newSecondaryState  = block.readByteArray();
                            byte   b4     = block.readByte();
                            byte   b5     = block.readByte();
                            byte   b6     = block.readByte();
                            Color  color  = block.readColor();
                            Color  color2 = block.readColor();
                            Color  newMarkerColor;
                            if (b2 > 20)
                            {
                                newMarkerColor = block.readColor();
                            }
                            else
                            {
                                newMarkerColor = Customization.MARKER_COLORS[UnityEngine.Random.Range(0, Customization.MARKER_COLORS.Length)];
                            }
                            bool   newHand = block.readBoolean();
                            string newName = block.readString();
                            if (b2 < 19)
                            {
                                newName = Provider.clientName;
                            }
                            string   newNick  = block.readString();
                            CSteamID csteamID = block.readSteamID();
                            byte     b7       = block.readByte();
                            if (!Provider.provider.communityService.checkGroup(csteamID))
                            {
                                csteamID = CSteamID.Nil;
                            }
                            if (b7 >= Customization.SKILLSETS)
                            {
                                b7 = 0;
                            }
                            if (b2 < 16)
                            {
                                b7 = (byte)UnityEngine.Random.Range(1, (int)Customization.SKILLSETS);
                            }
                            if (b2 > 16 && b2 < 20)
                            {
                                block.readBoolean();
                            }
                            if (!Provider.isPro)
                            {
                                if (b4 >= Customization.FACES_FREE)
                                {
                                    b4 = (byte)UnityEngine.Random.Range(0, (int)Customization.FACES_FREE);
                                }
                                if (b5 >= Customization.HAIRS_FREE)
                                {
                                    b5 = (byte)UnityEngine.Random.Range(0, (int)Customization.HAIRS_FREE);
                                }
                                if (b6 >= Customization.BEARDS_FREE)
                                {
                                    b6 = 0;
                                }
                                if (!Customization.checkSkin(color))
                                {
                                    color = Customization.SKINS[UnityEngine.Random.Range(0, Customization.SKINS.Length)];
                                }
                                if (!Customization.checkColor(color2))
                                {
                                    color2 = Customization.COLORS[UnityEngine.Random.Range(0, Customization.COLORS.Length)];
                                }
                            }
                            Characters.list[(int)b3] = new Character(newShirt, newPants, newHat, newBackpack, newVest, newMask, newGlasses, newPackageShirt, newPackagePants, newPackageHat, newPackageBackpack, newPackageVest, newPackageMask, newPackageGlasses, newPrimaryItem, newPrimaryState, newSecondaryItem, newSecondaryState, b4, b5, b6, color, color2, newMarkerColor, newHand, newName, newNick, csteamID, (EPlayerSkillset)b7);
                            if (Characters.onCharacterUpdated != null)
                            {
                                Characters.onCharacterUpdated(b3, Characters.list[(int)b3]);
                            }
                            b3 += 1;
                        }
                    }
                    else
                    {
                        byte b8 = 0;
                        while ((int)b8 < Characters.list.Length)
                        {
                            Characters.list[(int)b8] = new Character();
                            if (Characters.onCharacterUpdated != null)
                            {
                                Characters.onCharacterUpdated(b8, Characters.list[(int)b8]);
                            }
                            b8 += 1;
                        }
                    }
                }
            }
            else
            {
                Characters._selected = 0;
            }
            byte b9 = 0;

            while ((int)b9 < Characters.list.Length)
            {
                if (Characters.list[(int)b9] == null)
                {
                    Characters.list[(int)b9] = new Character();
                    if (Characters.onCharacterUpdated != null)
                    {
                        Characters.onCharacterUpdated(b9, Characters.list[(int)b9]);
                    }
                }
                b9 += 1;
            }
            Characters.apply();
            Characters.hasLoaded = true;
        }
Ejemplo n.º 8
0
        // Token: 0x06002A10 RID: 10768 RVA: 0x00104D00 File Offset: 0x00103100
        public static void package(ulong package)
        {
            int inventoryItem = Provider.provider.economyService.getInventoryItem(package);

            if (inventoryItem == 0)
            {
                return;
            }
            ushort num;
            ushort num2;

            Provider.provider.economyService.getInventoryTargetID(inventoryItem, out num, out num2);
            if (num == 0 && num2 == 0)
            {
                return;
            }
            ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, num);

            if (itemAsset == null || itemAsset.proPath == null || itemAsset.proPath.Length == 0)
            {
                if (Provider.provider.economyService.getInventorySkinID(inventoryItem) == 0)
                {
                    return;
                }
                if (!Characters.packageSkins.Remove(package))
                {
                    for (int i = 0; i < Characters.packageSkins.Count; i++)
                    {
                        ulong num3 = Characters.packageSkins[i];
                        if (num3 != 0UL)
                        {
                            int inventoryItem2 = Provider.provider.economyService.getInventoryItem(num3);
                            if (inventoryItem2 != 0)
                            {
                                ushort num4;
                                ushort num5;
                                Provider.provider.economyService.getInventoryTargetID(inventoryItem2, out num4, out num5);
                                if ((num != 0 && num == num4) || (num2 != 0 && num2 == num5))
                                {
                                    Characters.packageSkins.RemoveAt(i);
                                    break;
                                }
                            }
                        }
                    }
                    Characters.packageSkins.Add(package);
                }
            }
            if (itemAsset != null)
            {
                if (itemAsset.type == EItemType.SHIRT)
                {
                    if (Characters.active.packageShirt == package)
                    {
                        Characters.active.packageShirt = 0UL;
                    }
                    else
                    {
                        Characters.active.packageShirt = package;
                    }
                }
                else if (itemAsset.type == EItemType.PANTS)
                {
                    if (Characters.active.packagePants == package)
                    {
                        Characters.active.packagePants = 0UL;
                    }
                    else
                    {
                        Characters.active.packagePants = package;
                    }
                }
                else if (itemAsset.type == EItemType.HAT)
                {
                    if (Characters.active.packageHat == package)
                    {
                        Characters.active.packageHat = 0UL;
                    }
                    else
                    {
                        Characters.active.packageHat = package;
                    }
                }
                else if (itemAsset.type == EItemType.BACKPACK)
                {
                    if (Characters.active.packageBackpack == package)
                    {
                        Characters.active.packageBackpack = 0UL;
                    }
                    else
                    {
                        Characters.active.packageBackpack = package;
                    }
                }
                else if (itemAsset.type == EItemType.VEST)
                {
                    if (Characters.active.packageVest == package)
                    {
                        Characters.active.packageVest = 0UL;
                    }
                    else
                    {
                        Characters.active.packageVest = package;
                    }
                }
                else if (itemAsset.type == EItemType.MASK)
                {
                    if (Characters.active.packageMask == package)
                    {
                        Characters.active.packageMask = 0UL;
                    }
                    else
                    {
                        Characters.active.packageMask = package;
                    }
                }
                else if (itemAsset.type == EItemType.GLASSES)
                {
                    if (Characters.active.packageGlasses == package)
                    {
                        Characters.active.packageGlasses = 0UL;
                    }
                    else
                    {
                        Characters.active.packageGlasses = package;
                    }
                }
            }
            Characters.apply(false, true);
            if (Characters.onCharacterUpdated != null)
            {
                Characters.onCharacterUpdated(Characters.selected, Characters.active);
            }
        }