Beispiel #1
0
 public void changeShirt(int setShirt)
 {
     if (setShirt != -1 || this.shirt != -1)
     {
         base.networkView.RPC("tellShirt", RPCMode.All, new object[] { setShirt });
         PlayerPrefs.SetInt(string.Concat("lastShirt_", PlayerSettings.id), Sneaky.sneak(setShirt));
         NetworkSounds.askSound("Sounds/Clothes/sleeve", base.transform.position, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f);
     }
 }
Beispiel #2
0
 public void changeBackpack(int backpack)
 {
     if (backpack != -1 || this.backpack != -1)
     {
         if (Equipment.equipped.x != -1 && (Equipment.equipped.x >= BagSize.getWidth(backpack) || Equipment.equipped.y >= BagSize.getHeight(backpack)) && Equipment.id != backpack)
         {
             Equipment.dequip();
         }
         base.networkView.RPC("tellBackpack", RPCMode.All, new object[] { backpack });
         PlayerPrefs.SetInt(string.Concat("lastBackpack_", PlayerSettings.id), Sneaky.sneak(backpack));
         NetworkSounds.askSound("Sounds/Clothes/zipper", base.transform.position, 0.5f, UnityEngine.Random.Range(0.9f, 1.1f), 1f);
     }
 }
Beispiel #3
0
 public static void saveStructures(string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(
             string.Concat("structures_", ServerSettings.map),
             string.Concat(new object[] {
             MasterSettings.MASTERSETTINGS_VERSION,
             "_",
             Savedata.STRUCTURES_VERSION,
             "_",
             Maps.MAP_VERSION[ServerSettings.map],
             "_",
             Sneaky.sneak(serial), "_"
         }));
     }
 }
Beispiel #4
0
    public static string loadVehicles()
    {
        if (ServerSettings.map == 0)
        {
            return(string.Empty);
        }
        string str = PlayerPrefs.GetString(string.Concat("vehicles_", ServerSettings.map));

        if (str == string.Empty)
        {
            return(string.Empty);
        }
        string[] strArrays = Packer.unpack(str, '\u005F');
        if (!(strArrays[0] == MasterSettings.MASTERSETTINGS_VERSION.ToString()) || !(strArrays[1] == Savedata.VEHICLES_VERSION.ToString()) || !(strArrays[2] == Maps.MAP_VERSION[ServerSettings.map].ToString()))
        {
            return(string.Empty);
        }
        return(Sneaky.expose(strArrays[3]));
    }
Beispiel #5
0
    public static string loadLife(string id)
    {
        if (ServerSettings.map == 0)
        {
            return(string.Empty);
        }
        string str = PlayerPrefs.GetString(string.Concat("life_", id));

        if (str == string.Empty)
        {
            return(string.Empty);
        }
        string[] strArrays = Packer.unpack(str, '\u005F');
        if (!(strArrays[0] == MasterSettings.MASTERSETTINGS_VERSION.ToString()) || !(strArrays[1] == Savedata.LIFE_VERSION.ToString()))
        {
            return(string.Empty);
        }
        return(Sneaky.expose(strArrays[2]));
    }
Beispiel #6
0
    public static string loadBarricades(int x, int y)
    {
        if (ServerSettings.map == 0)
        {
            return(string.Empty);
        }
        string str = PlayerPrefs.GetString(string.Concat(new object[] { "barricades_", x, "_", y, "_", ServerSettings.map }));

        if (str == string.Empty)
        {
            return(string.Empty);
        }
        string[] strArrays = Packer.unpack(str, '\u005F');
        if (!(strArrays[0] == MasterSettings.MASTERSETTINGS_VERSION.ToString()) || !(strArrays[1] == Savedata.BARRICADES_VERSION.ToString()) || !(strArrays[2] == Maps.MAP_VERSION[ServerSettings.map].ToString()))
        {
            return(string.Empty);
        }
        return(Sneaky.expose(strArrays[3]));
    }
Beispiel #7
0
    public static string loadPosition(string id)
    {
        if (ServerSettings.map == 0)
        {
            return(string.Empty);
        }
        string str = PlayerPrefs.GetString(string.Concat(new object[] { "position_", id, "_", ServerSettings.map }));

        if (str == string.Empty)
        {
            return(string.Empty);
        }
        string[] strArrays = Packer.unpack(str, '\u005F');
        if (!(strArrays[0] == MasterSettings.MASTERSETTINGS_VERSION.ToString()) || !(strArrays[1] == Savedata.POSITION_VERSION.ToString()) || !(strArrays[2] == Maps.MAP_VERSION[ServerSettings.map].ToString()))
        {
            return(string.Empty);
        }
        return(Sneaky.expose(strArrays[3]));
    }
Beispiel #8
0
 public ClientItem(ServerItem item)
 {
     this.realID     = Sneaky.sneak(item.id);
     this.realAmount = Sneaky.sneak(item.amount);
     this.realState  = Sneaky.sneak(item.state);
 }
Beispiel #9
0
    public static string getState(int id)
    {
        int num = id;

        switch (num)
        {
        case 16001:
        {
            return(string.Concat(PlayerSettings.id, "_", PlayerSettings.friendHash, "_f_"));
        }

        case 16002:
        {
            return("f");
        }

        case 16007:
        {
            return("f");
        }

        case 16008:
        {
            return(Sneaky.sneak(string.Empty));
        }

        case 16013:
        {
            return("f");
        }

        case 16014:
        {
            return(string.Concat(PlayerSettings.id, "_", PlayerSettings.friendHash, "_f_"));
        }

        case 16019:
        {
            return(string.Empty);
        }

        case 16022:
        {
            return("f");
        }

        case 16023:
        {
            return(string.Concat(PlayerSettings.id, "_", PlayerSettings.friendHash, "__"));
        }

        case 16024:
        {
            return("f");
        }

        case 16025:
        {
            return(string.Concat(PlayerSettings.id, "_", PlayerSettings.friendHash, "__"));
        }

        case 16026:
        {
            return("f");
        }

        case 16027:
        {
            return("f");
        }

        case 16028:
        {
            return(string.Concat(PlayerSettings.id, "_", PlayerSettings.friendHash, "_f_"));
        }

        default:
        {
            switch (num)
            {
            case 22000:
            {
                return(Epoch.getSeconds().ToString());
            }

            case 22001:
            {
                return(Epoch.getSeconds().ToString());
            }

            case 22002:
            {
                return(Epoch.getSeconds().ToString());
            }

            case 22003:
            {
                return(Epoch.getSeconds().ToString());
            }

            case 22004:
            {
                return(Epoch.getSeconds().ToString());
            }
            }
            break;
        }
        }
        return(string.Empty);
    }
Beispiel #10
0
 public static void saveSkills(string id, string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(string.Concat("skills_", id), string.Concat(new object[] { MasterSettings.MASTERSETTINGS_VERSION, "_", Savedata.SKILLS_VERSION, "_", Sneaky.sneak(serial), "_" }));
     }
 }
Beispiel #11
0
 public static void saveReputation(string id, string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(string.Concat("reputation_", id), string.Concat(new object[] { MasterSettings.MASTERSETTINGS_VERSION, "_", Savedata.REPUTATION_VERSION, "_", Sneaky.sneak(serial), "_" }));
     }
 }
Beispiel #12
0
 public static void savePosition(string id, string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(string.Concat(new object[] { "position_", id, "_", ServerSettings.map }), string.Concat(new object[] { MasterSettings.MASTERSETTINGS_VERSION, "_", Savedata.POSITION_VERSION, "_", Maps.MAP_VERSION[ServerSettings.map], "_", Sneaky.sneak(serial), "_" }));
     }
 }
Beispiel #13
0
 public static void saveInventory(string id, string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(string.Concat("inventory_", id), string.Concat(new object[] { MasterSettings.MASTERSETTINGS_VERSION, "_", Savedata.INVENTORY_VERSION, "_", Sneaky.sneak(serial), "_" }));
     }
 }
Beispiel #14
0
 public static void saveBarricades(int x, int y, string serial)
 {
     if (ServerSettings.map != 0)
     {
         PlayerPrefs.SetString(string.Concat(new object[] { "barricades_", x, "_", y, "_", ServerSettings.map }), string.Concat(new object[] { MasterSettings.MASTERSETTINGS_VERSION, "_", Savedata.BARRICADES_VERSION, "_", Maps.MAP_VERSION[ServerSettings.map], "_", Sneaky.sneak(serial), "_" }));
     }
 }
Beispiel #15
0
 public ClientItem(int setID, int setAmount, string setState)
 {
     this.realID     = Sneaky.sneak(setID);
     this.realAmount = Sneaky.sneak(setAmount);
     this.realState  = Sneaky.sneak(setState);
 }
Beispiel #16
0
 public void setState(string setState)
 {
     if (setState != this.state)
     {
         this.state = setState;
     }
     this.items = InteractionInterface.getCrateItems(int.Parse(base.transform.parent.name), Sneaky.expose(this.state));
     if (Interact.edit == base.gameObject)
     {
         //HUDInteract.crate(int.Parse(base.transform.parent.name), this.items);
     }
 }
Beispiel #17
0
 public void changeItem(int setItem, string setState)
 {
     base.networkView.RPC("tellItem", RPCMode.All, new object[] { setItem, setState });
     PlayerPrefs.SetInt(string.Concat("lastItem_", PlayerSettings.id), Sneaky.sneak(setItem));
     PlayerPrefs.SetString(string.Concat("lastState_", PlayerSettings.id), Sneaky.sneak(setState));
 }
Beispiel #18
0
    public void destroyBarricade(Vector3 position)
    {
        int indexFromPositionServer;

        ClientItem[,] crateItems;
        Point2  region  = NetworkRegions.getRegion(position);
        bool    flag    = false;
        int     item    = -1;
        Vector3 vector3 = Vector3.zero;

        if (Network.isServer)
        {
            indexFromPositionServer = SpawnBarricades.getIndexFromPositionServer(region, position);
            if (SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id == 16019 || SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id == 16025 || SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id == 16023)
            {
                if (SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id != 16019)
                {
                    string[] strArrays = Packer.unpack(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].state, '\u005F');
                    crateItems = InteractionInterface.getCrateItems(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id, Sneaky.expose(strArrays[2]));
                }
                else
                {
                    crateItems = InteractionInterface.getCrateItems(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id, Sneaky.expose(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].state));
                }
                for (int i = 0; i < 2; i++)
                {
                    for (int j = 0; j < BarricadeStats.getCapacity(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id); j++)
                    {
                        if (!ItemStackable.getStackable(crateItems[i, j].id))
                        {
                            SpawnItems.drop(crateItems[i, j].id, crateItems[i, j].amount, crateItems[i, j].state, position);
                        }
                        else
                        {
                            for (int k = 0; k < crateItems[i, j].amount; k++)
                            {
                                SpawnItems.drop(crateItems[i, j].id, 1, crateItems[i, j].state, position);
                            }
                        }
                    }
                }
            }
            else if (ExplosiveStats.getDamage(SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id) != 0)
            {
                flag = true;
                item = SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id;
                if (SpawnBarricades.regions[region.x, region.y].barricades[indexFromPositionServer].id != 16015)
                {
                    vector3 = position + Vector3.up;
                    NetworkEffects.askEffect("Effects/grenade", position, Quaternion.Euler(-90f, 0f, 0f), -1f);
                    NetworkSounds.askSoundMax("Sounds/Projectiles/grenade", position, 1f, UnityEngine.Random.Range(0.95f, 1.05f), 4f, 64f);
                }
                else
                {
                    vector3 = position + SpawnBarricades.regions[region.x, region.y].models[indexFromPositionServer].transform.up;
                    NetworkEffects.askEffect("Effects/bomb", position, Quaternion.Euler(-90f, 0f, 0f), -1f);
                    NetworkSounds.askSoundMax("Sounds/Projectiles/bomb", position, 1f, UnityEngine.Random.Range(0.95f, 1.05f), 4f, 64f);
                }
            }
            if (indexFromPositionServer != -1 && indexFromPositionServer < SpawnBarricades.regions[region.x, region.y].barricades.Count)
            {
                SpawnBarricades.regions[region.x, region.y].barricades.RemoveAt(indexFromPositionServer);
            }
        }
        indexFromPositionServer = SpawnBarricades.getIndexFromPositionClient(region, position);
        if (indexFromPositionServer != -1 && indexFromPositionServer < SpawnBarricades.regions[region.x, region.y].models.Count)
        {
            UnityEngine.Object.Destroy(SpawnBarricades.regions[region.x, region.y].models[indexFromPositionServer]);
            SpawnBarricades.regions[region.x, region.y].models.RemoveAt(indexFromPositionServer);
        }
        if (flag)
        {
            ExplosionTool.explode(vector3, (float)ExplosiveStats.getRange(item), ExplosiveStats.getDamage(item));
        }
    }