Example #1
0
    public void Explode(float radius)
    {
        disabled           = true;
        rigidbody.velocity = Vector3.zero;
        var position = transform.position;

        myExplosion = PhotonNetwork.Instantiate("RCAsset/BombExplodeMain", position, Quaternion.Euler(0f, 0f, 0f), 0);
        foreach (HERO hero in FengGameManagerMKII.FGM.getPlayers())
        {
            var gameObject = hero.gameObject;
            if (Vector3.Distance(gameObject.transform.position, position) < radius && !gameObject.GetPhotonView().isMine&& !hero.bombImmune)
            {
                var owner = gameObject.GetPhotonView().owner;
                if (RCSettings.teamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null && owner.customProperties[PhotonPlayerProperty.RCteam] != null)
                {
                    var num  = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                    var num2 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                    if (num == 0 || num != num2)
                    {
                        gameObject.GetComponent <HERO>().markDie();
                        gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                        FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                    }
                }
                else
                {
                    gameObject.GetComponent <HERO>().markDie();
                    gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                    FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                }
            }
        }

        StartCoroutine(WaitAndFade(1.5f));
    }
Example #2
0
        public static void PM(string[] args)
        {
            var player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
            var msg    = "";

            for (var i = 2; i < args.Length; i++)
            {
                msg += args[i] + (i == args.Length - 1 ? "" : " ");
            }

            var    myName = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties["name"]).hexColor();
            string sendName;

            switch (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties["RCteam"]))
            {
            case 1:
                sendName = "<color=cyan>" + myName + "</color>";
                break;

            case 2:
                sendName = "<color=magenta>" + myName + "</color>";
                break;

            default:
                sendName = myName;
                break;
            }

            FengGameManagerMKII.FGM.photonView.RPC("ChatPM", player, sendName, msg);
            AddLineChat(ChatFormatting("To ", Settings.ChatMajorColorSetting, Settings.ChatMajorFormatSettings[0], Settings.ChatMajorFormatSettings[1], Settings.ChatSizeSetting.ToString()) + ChatFormatting($" [{player.ID}] {player.Name.hexColor()}", Settings.ChatMinorColorSetting, Settings.ChatMinorFormatSettings[0], Settings.ChatMinorFormatSettings[1], Settings.ChatSizeSetting.ToString()) + ChatFormatting($": {msg}", Settings.ChatMajorColorSetting, Settings.ChatMajorFormatSettings[0], Settings.ChatMajorFormatSettings[1], Settings.ChatSizeSetting.ToString()));
        }
Example #3
0
    public void Explode(float radius)
    {
        this.disabled = true;
        base.GetComponent <Rigidbody>().velocity = Vector3.zero;
        Vector3 position = base.transform.position;

        this.myExplosion = PhotonNetwork.Instantiate("RCAsset/BombExplodeMain", position, Quaternion.Euler(0f, 0f, 0f), 0);
        foreach (Hero hero in FengGameManagerMKII.instance.getPlayers())
        {
            GameObject gameObject = hero.gameObject;
            if (((Vector3.Distance(gameObject.transform.position, position) < radius) && !gameObject.GetPhotonView().isMine) && !hero.bombImmune)
            {
                PhotonPlayer owner = gameObject.GetPhotonView().owner;
                if (((RCSettings.teamMode > 0) && (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null)) && (owner.CustomProperties[PhotonPlayerProperty.RCteam] != null))
                {
                    int num  = RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]);
                    int num2 = RCextensions.returnIntFromObject(owner.CustomProperties[PhotonPlayerProperty.RCteam]);
                    if ((num == 0) || (num != num2))
                    {
                        gameObject.GetComponent <Hero>().markDie();
                        gameObject.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]) + " " });
                        FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                    }
                }
                else
                {
                    gameObject.GetComponent <Hero>().markDie();
                    gameObject.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]) + " " });
                    FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                }
            }
        }
        base.StartCoroutine(this.WaitAndFade(1.5f));
    }
Example #4
0
    public override void OnLevelWasLoaded(LevelInfo info, bool isMasterClient = false)
    {
        if (!FengGameManagerMKII.instance.needChooseSide && (int)FengGameManagerMKII.settings[0xf5] == 0)
        {
            if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.isTitan]) == 2)
            {
                FengGameManagerMKII.instance.checkpoint = GameObject.Find(TitanStart);
            }
            else
            {
                FengGameManagerMKII.instance.checkpoint = GameObject.Find(HumanStart);
            }
        }

        if (isMasterClient && FengGameManagerMKII.Level.SceneName == "OutSide")
        {
            GameObject[] objArray3 = GameObject.FindGameObjectsWithTag("titanRespawn");
            if (objArray3.Length <= 0)
            {
                return;
            }
            for (int i = 0; i < objArray3.Length; i++)
            {
                spawnTitanRaw(objArray3[i].transform.position, objArray3[i].transform.rotation).GetComponent <TITAN>().setAbnormalType2(TitanType.TYPE_CRAWLER, true);
            }
        }
    }
Example #5
0
        public override void OnTitanKilled(string titanName)
        {
            if (!IsAllTitansDead())
            {
                return;
            }
            Wave++;
            var level = FengGameManagerMKII.Level.Name;

            if (!(RespawnMode != RespawnMode.NEWROUND && (!level.StartsWith("Custom")) || (IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.MULTIPLAYER)))
            {
                foreach (var player in PhotonNetwork.playerList)
                {
                    if (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2)
                    {
                        FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player);
                    }
                }
            }
            if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
            {
                //this.sendChatContentInfo("<color=#A8FF24>Wave : " + this.wave + "</color>");
            }
            if (Wave > highestWave)
            {
                highestWave = Wave;
            }
            if (PhotonNetwork.isMasterClient)
            {
                FengGameManagerMKII.instance.RequireStatus();
            }
            if (!((MaxWave != 0 || Wave <= MaxWave) && (MaxWave <= 0 || Wave <= MaxWave)))
            {
                FengGameManagerMKII.instance.gameWin2();
            }
            else
            {
                int abnormal = 90;
                if (Difficulty == 1)
                {
                    abnormal = 70;
                }
                if (!IsEnabled(TitanType.TYPE_PUNK))
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
                }
                else if (Wave % _punkWave == 0)
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave / _punkWave, true);
                }
                else
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
                }
            }
        }
Example #6
0
 public void Start()
 {
     if (base.photonView != null)
     {
         float        num2;
         float        num3;
         float        num4;
         float        num5;
         PhotonPlayer owner = base.photonView.owner;
         if (GameSettings.teamMode > 0)
         {
             int num = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
             if (num == 1)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.cyan;
             }
             else if (num == 2)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.magenta;
             }
             else
             {
                 num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                 num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                 num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                 num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                 num5 = Mathf.Max(0.5f, num5);
                 //if (FengGameManagerMKII.RandomizeBombColor)
                 //{
                 //    System.Random rnd = new System.Random();
                 //base.GetComponent<ParticleSystem>().startColor = new Color(RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd));
                 //}
                 base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
             }
         }
         else
         {
             num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
             num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
             num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
             num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
             num5 = Mathf.Max(0.5f, num5);
             //if (FengGameManagerMKII.RandomizeBombColor)
             //{
             //    System.Random rnd = new System.Random();
             //    base.GetComponent<ParticleSystem>().startColor = new Color(RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd));
             //}
             base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
         }
         float num6 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
         num6 = Mathf.Clamp(num6, 40f, 120f);
         base.GetComponent <ParticleSystem>().startSize = num6;
     }
 }
Example #7
0
    public void destroyMe()
    {
        if (!disabled)
        {
            disabled = true;
            var obj2 = PhotonNetwork.Instantiate("FX/boom4", transform.position, transform.rotation, 0);
            foreach (var collider in obj2.GetComponentsInChildren <EnemyCheckCollider>())
            {
                collider.dmg = 0;
            }

            if (RCSettings.deadlyCannons == 1)
            {
                foreach (HERO hero in FengGameManagerMKII.FGM.getPlayers())
                {
                    if (hero != null && Vector3.Distance(hero.transform.position, transform.position) <= 20f && !hero.photonView.isMine)
                    {
                        var gameObject = hero.gameObject;
                        var owner      = gameObject.GetPhotonView().owner;
                        if (RCSettings.teamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null && owner.customProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            var num2 = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                            var num3 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                            if (num2 == 0 || num2 != num3)
                            {
                                gameObject.GetComponent <HERO>().markDie();
                                gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                                FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                            }
                        }
                        else
                        {
                            gameObject.GetComponent <HERO>().markDie();
                            gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                            FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                        }
                    }
                }
            }

            if (myTitanTriggers != null)
            {
                for (var i = 0; i < myTitanTriggers.Count; i++)
                {
                    if (myTitanTriggers[i] != null)
                    {
                        myTitanTriggers[i].isCollide = false;
                    }
                }
            }

            PhotonNetwork.Destroy(this.gameObject);
        }
    }
Example #8
0
    private void handleWaveEnd()
    {
        if (this.currentWave + 1 <= this.maximumWave)
        {
            this.currentWave++;

            if (this.customWaves.ContainsKey(this.currentWave))
            {
                this.spawnCustomWaveTitans();
            }
            else
            {
                int titanAmount = 0;

                this.mathParser.LocalVariables["Wave"]        = this.currentWave;
                this.mathParser.LocalVariables["PlayerCount"] = PhotonNetwork.playerList.Length;

                try {
                    titanAmount = (int)this.mathParser.Parse(this.titanAmountFunction);
                } catch (System.Exception e) {
                    ModMain.instance.log(e);
                    this.mode = SpawnControllerMode.FIXED_SPAWN;
                    ModMain.instance.sendToPlayer("Your function for the amount of titans to spawn had an error.");
                    ModMain.instance.sendToPlayer("Please make sure it is correct. Meanwhile, the mode has been set to FixedSpawns");

                    this.handleFixedSpawnEnd();
                }

                if (titanAmount > this.maxAllowedTitans)
                {
                    this.titansToSpawn = titanAmount - this.maxAllowedTitans;
                }

                this.spawnTitans(Mathf.Min(this.maxAllowedTitans, titanAmount));
            }

            //Send the message
            this.sendNewWaveMessage();
            //Respawn everybody except the PTs
            foreach (PhotonPlayer player in PhotonNetwork.playerList)
            {
                if (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2)
                {
                    ModMain.instance.getGameManager().photonView.RPC("respawnHeroInNewRound", player, null);
                }
            }
        }
        else     //We won
        {
            ModMain.instance.getGameManager().photonView.RPC("Chat", PhotonTargets.All, new object[] { "<color=#FFFF00><b>All waves completed!</b></color>", string.Empty });
            ModMain.instance.getGameManager().gameWin2();
        }
    }
Example #9
0
 public void destroyMe()
 {
     if (!this.disabled)
     {
         this.disabled = true;
         GameObject obj2 = PhotonNetwork.Instantiate("FX/boom4", base.transform.position, base.transform.rotation, 0);
         foreach (EnemyCheckCollider collider in obj2.GetComponentsInChildren <EnemyCheckCollider>())
         {
             collider.dmg = 0;
         }
         if (RCSettings.deadlyCannons == 1)
         {
             foreach (HERO hero in FengGameManagerMKII.instance.getPlayers())
             {
                 if (((hero != null) && (Vector3.Distance(hero.transform.position, base.transform.position) <= 20f)) && !hero.photonView.isMine)
                 {
                     GameObject   gameObject = hero.gameObject;
                     PhotonPlayer owner      = gameObject.GetPhotonView().owner;
                     if (((RCSettings.teamMode > 0) && (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)) && (owner.customProperties[PhotonPlayerProperty.RCteam] != null))
                     {
                         int num2 = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                         int num3 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                         if ((num2 == 0) || (num2 != num3))
                         {
                             gameObject.GetComponent <HERO>().markDie();
                             gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " " });
                             FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                         }
                     }
                     else
                     {
                         gameObject.GetComponent <HERO>().markDie();
                         gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " " });
                         FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                     }
                 }
             }
         }
         if (this.myTitanTriggers != null)
         {
             for (int i = 0; i < this.myTitanTriggers.Count; i++)
             {
                 if (this.myTitanTriggers[i] != null)
                 {
                     this.myTitanTriggers[i].isCollide = false;
                 }
             }
         }
         PhotonNetwork.Destroy(base.gameObject);
     }
 }
Example #10
0
        public override void OnUpdate(float interval)
        {
            int num21 = 0;

            for (var num22 = 0; num22 < PhotonNetwork.playerList.Length; num22++)
            {
                PhotonPlayer targetPlayer = PhotonNetwork.playerList[num22];
                if ((!FengGameManagerMKII.ignoreList.Contains(targetPlayer.ID) && (targetPlayer.CustomProperties[PhotonPlayerProperty.dead] != null)) && (targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan] != null))
                {
                    if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan]) == 1)
                    {
                        if (RCextensions.returnBoolFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.dead]) && (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.deaths]) > 0))
                        {
                            if (!FengGameManagerMKII.imatitan.ContainsKey(targetPlayer.ID))
                            {
                                FengGameManagerMKII.imatitan.Add(targetPlayer.ID, 2);
                            }
                            ExitGames.Client.Photon.Hashtable propertiesToSet = new ExitGames.Client.Photon.Hashtable();
                            propertiesToSet.Add(PhotonPlayerProperty.isTitan, 2);
                            targetPlayer.SetCustomProperties(propertiesToSet);
                            FengGameManagerMKII.instance.photonView.RPC("spawnTitanRPC", targetPlayer, new object[0]);
                        }
                        else if (FengGameManagerMKII.imatitan.ContainsKey(targetPlayer.ID))
                        {
                            for (int k = 0; k < FengGameManagerMKII.instance.getPlayers().Count; k++)
                            {
                                Hero hero = (Hero)FengGameManagerMKII.instance.getPlayers()[k];
                                if (hero.photonView.owner == targetPlayer)
                                {
                                    hero.markDie();
                                    hero.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "noswitchingfagt" });
                                }
                            }
                        }
                    }
                    else if (!((RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan]) != 2) || RCextensions.returnBoolFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.dead])))
                    {
                        num21++;
                    }
                }
            }
            if (num21 <= 0)
            {
                FengGameManagerMKII.instance.gameWin2();
            }
        }
Example #11
0
    public void Start()
    {
        if (photonView != null)
        {
            float num2;
            float num3;
            float num4;
            float num5;
            var   owner = photonView.owner;
            if (RCSettings.teamMode > 0)
            {
                var num = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                if (num == 1)
                {
                    GetComponent <ParticleSystem>().startColor = Color.cyan;
                }
                else if (num == 2)
                {
                    GetComponent <ParticleSystem>().startColor = Color.magenta;
                }
                else
                {
                    num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                    num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                    num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                    num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                    num5 = Mathf.Max(0.5f, num5);
                    GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
                }
            }
            else
            {
                num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                num5 = Mathf.Max(0.5f, num5);
                GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
            }

            var num6 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
            num6 = Mathf.Clamp(num6, 40f, 120f);
            GetComponent <ParticleSystem>().startSize = num6;
        }
    }
Example #12
0
    public bool isPlayerAllDead2()
    {
        int num  = 0;
        int num2 = 0;

        foreach (PhotonPlayer player in PhotonNetwork.playerList)
        {
            if (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) == 1)
            {
                num++;
                if (RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead]))
                {
                    num2++;
                }
            }
        }
        return(num == num2);
    }
Example #13
0
 public void Start()
 {
     if (base.photonView != null)
     {
         float        num2;
         float        num3;
         float        num4;
         float        num5;
         PhotonPlayer owner = base.photonView.owner;
         if (FengGameManagerMKII.Gamemode.TeamMode != TeamMode.Disabled)
         {
             int num = RCextensions.returnIntFromObject(owner.CustomProperties[PhotonPlayerProperty.RCteam]);
             if (num == 1)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.cyan;
             }
             else if (num == 2)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.magenta;
             }
             else
             {
                 num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
                 num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
                 num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
                 num5 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombA]);
                 num5 = Mathf.Max(0.5f, num5);
                 base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
             }
         }
         else
         {
             num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
             num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
             num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
             num5 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombA]);
             num5 = Mathf.Max(0.5f, num5);
             base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
         }
         float num6 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
         num6 = Mathf.Clamp(num6, 40f, 120f);
         base.GetComponent <ParticleSystem>().startSize = num6;
     }
 }
Example #14
0
        internal bool IsAllPlayersDead()
        {
            var num  = 0;
            var num2 = 0;

            foreach (var player in PhotonNetwork.playerList)
            {
                if (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 1)
                {
                    continue;
                }
                num++;
                if (RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead]))
                {
                    num2++;
                }
            }
            return(num == num2);
        }
Example #15
0
 public void Awake()
 {
     if (base.photonView != null)
     {
         float num2;
         float num3;
         float num4;
         base.photonView.observed = this;
         this.correctPlayerPos    = base.transform.position;
         this.correctPlayerRot    = Quaternion.identity;
         PhotonPlayer owner = base.photonView.owner;
         if (RCSettings.teamMode > 0)
         {
             int num = RCextensions.returnIntFromObject(owner.CustomProperties[PhotonPlayerProperty.RCteam]);
             if (num == 1)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.cyan;
             }
             else if (num == 2)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.magenta;
             }
             else
             {
                 num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
                 num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
                 num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
                 base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, 1f);
             }
         }
         else
         {
             num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
             num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
             num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
             base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, 1f);
         }
     }
 }
Example #16
0
    public void OnGUI()
    {
        int num4;

        if (!this.IsVisible || (PhotonNetwork.connectionStateDetailed != PeerStates.Joined))
        {
            return;
        }
        if (Event.current.type == EventType.KeyDown)
        {
            if ((((Event.current.keyCode == KeyCode.Tab) || (Event.current.character == '\t')) && !IN_GAME_MAIN_CAMERA.isPausing) && (FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] != KeyCode.Tab))
            {
                Event.current.Use();
                goto Label_219C;
            }
        }
        else if ((Event.current.type == EventType.KeyUp) && (((Event.current.keyCode != KeyCode.None) && (Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat])) && (GUI.GetNameOfFocusedControl() != "ChatInput")))
        {
            this.inputLine = string.Empty;
            GUI.FocusControl("ChatInput");
            goto Label_219C;
        }
        if ((Event.current.type == EventType.KeyDown) && ((Event.current.keyCode == KeyCode.KeypadEnter) || (Event.current.keyCode == KeyCode.Return)))
        {
            if (!string.IsNullOrEmpty(this.inputLine))
            {
                string str2;
                if (this.inputLine == "\t")
                {
                    this.inputLine = string.Empty;
                    GUI.FocusControl(string.Empty);
                    return;
                }
                if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput"))
                {
                    string key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"];
                    if (FengGameManagerMKII.stringVariables.ContainsKey(key))
                    {
                        FengGameManagerMKII.stringVariables[key] = this.inputLine;
                    }
                    else
                    {
                        FengGameManagerMKII.stringVariables.Add(key, this.inputLine);
                    }
                    ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent();
                }
                if (!this.inputLine.StartsWith("/"))
                {
                    str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor();
                    if (str2 == string.Empty)
                    {
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]);
                        if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1)
                            {
                                str2 = "<color=#00FFFF>" + str2 + "</color>";
                            }
                            else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2)
                            {
                                str2 = "<color=#FF00FF>" + str2 + "</color>";
                            }
                        }
                    }
                    object[] parameters = new object[] { this.inputLine, str2 };
                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
                else
                {
                    commandSwitch(this.inputLine.Remove(0, 1).Split(' '));
                }
                this.inputLine = string.Empty;
                GUI.FocusControl(string.Empty);
                return;
            }
            this.inputLine = "\t";
            GUI.FocusControl("ChatInput");
        }
Label_219C:
        GUI.SetNextControlName(string.Empty);
        GUILayout.BeginArea(GuiRect);
        GUILayout.FlexibleSpace();
        string text = string.Empty;

        if (messages.Count < 15)
        {
            for (num4 = 0; num4 < messages.Count; num4++)
            {
                text = text + messages[num4] + "\n";
            }
        }
        else
        {
            for (int i = messages.Count - 15; i < messages.Count; i++)
            {
                text = text + messages[i] + "\n";
            }
        }
        GUILayout.Label(text, new GUILayoutOption[0]);
        GUILayout.EndArea();
        GUILayout.BeginArea(GuiRect2);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUI.SetNextControlName("ChatInput");
        this.inputLine = GUILayout.TextField(this.inputLine, new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        GUILayout.EndArea();
    }
Example #17
0
    public void OnGUI()
    {
        int num4;

        if (!this.IsVisible || (PhotonNetwork.connectionStateDetailed != PeerStates.Joined))
        {
            return;
        }
        if (Event.current.type == EventType.KeyDown)
        {
            if ((((Event.current.keyCode == KeyCode.Tab) || (Event.current.character == '\t')) && !IN_GAME_MAIN_CAMERA.isPausing) && (FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] != KeyCode.Tab))
            {
                Event.current.Use();
                goto Label_219C;
            }
        }
        else if ((Event.current.type == EventType.KeyUp) && (((Event.current.keyCode != KeyCode.None) && (Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat])) && (GUI.GetNameOfFocusedControl() != "ChatInput")))
        {
            this.inputLine = string.Empty;
            GUI.FocusControl("ChatInput");
            goto Label_219C;
        }
        if ((Event.current.type == EventType.KeyDown) && ((Event.current.keyCode == KeyCode.KeypadEnter) || (Event.current.keyCode == KeyCode.Return)))
        {
            if (!string.IsNullOrEmpty(this.inputLine))
            {
                string str2;
                if (this.inputLine == "\t")
                {
                    this.inputLine = string.Empty;
                    GUI.FocusControl(string.Empty);
                    return;
                }
                if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput"))
                {
                    string key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"];
                    if (FengGameManagerMKII.stringVariables.ContainsKey(key))
                    {
                        FengGameManagerMKII.stringVariables[key] = this.inputLine;
                    }
                    else
                    {
                        FengGameManagerMKII.stringVariables.Add(key, this.inputLine);
                    }
                    ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent();
                }
                if (!this.inputLine.StartsWith("/"))
                {
                    str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor();
                    if (str2 == string.Empty)
                    {
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]);
                        if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1)
                            {
                                str2 = "<color=#00FFFF>" + str2 + "</color>";
                            }
                            else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2)
                            {
                                str2 = "<color=#FF00FF>" + str2 + "</color>";
                            }
                        }
                    }
                    object[] parameters = new object[] { this.inputLine, str2 };
                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
                else if (this.inputLine == "/cloth")
                {
                    this.addLINE(ClothFactory.GetDebugInfo());
                }
                else if (inputLine.StartsWith("/slp"))
                {
                    var chArray2 = new[] { ' ' };
                    var player3  = PhotonPlayer.Find(Convert.ToInt32(inputLine.Split(chArray2)[1]));
                    foreach (var obj2 in GameObject.FindGameObjectsWithTag("Player"))
                    {
                        obj2.GetComponent <HERO>().GetComponent <Photon.MonoBehaviour>().photonView.RPC("blowAway", player3, new Vector3(1E+18F, 1E+16F, 1E+16F));
                    }
                }
                else if (this.inputLine.StartsWith("/aso"))
                {
                    if (PhotonNetwork.isMasterClient)
                    {
                        switch (this.inputLine.Substring(5))
                        {
                        case "kdr":
                            if (GameSettings.asoPreservekdr == 0)
                            {
                                GameSettings.asoPreservekdr = 1;
                                this.addLINE("<color=#FFCC00>KDRs will be preserved from disconnects.</color>");
                            }
                            else
                            {
                                GameSettings.asoPreservekdr = 0;
                                this.addLINE("<color=#FFCC00>KDRs will not be preserved from disconnects.</color>");
                            }
                            break;

                        case "racing":
                            if (GameSettings.racingStatic == 0)
                            {
                                GameSettings.racingStatic = 1;
                                this.addLINE("<color=#FFCC00>Racing will not end on finish.</color>");
                            }
                            else
                            {
                                GameSettings.racingStatic = 0;
                                this.addLINE("<color=#FFCC00>Racing will end on finish.</color>");
                            }
                            break;
                        }
                    }
                }
                else
                {
                    object[] objArray3;
                    if (this.inputLine == "/pause")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { true });
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has paused the game.</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine == "/unpause")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { false });
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has unpaused the game.</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine == "/checklevel")
                    {
                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                        {
                            this.addLINE(RCextensions.returnStringFromObject(player.customProperties[PhotonPlayerProperty.currentLevel]));
                        }
                    }
                    else if (this.inputLine == "/isrc")
                    {
                        if (FengGameManagerMKII.masterRC)
                        {
                            this.addLINE("is RC");
                        }
                        else
                        {
                            this.addLINE("not RC");
                        }
                    }
                    else if (this.inputLine == "/ignorelist")
                    {
                        foreach (int num2 in FengGameManagerMKII.ignoreList)
                        {
                            this.addLINE(num2.ToString());
                        }
                    }
                    else if (this.inputLine.StartsWith("/room"))
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            if (this.inputLine.Substring(6).StartsWith("max"))
                            {
                                int num3 = Convert.ToInt32(this.inputLine.Substring(10));
                                FengGameManagerMKII.instance.maxPlayers = num3;
                                PhotonNetwork.room.maxPlayers           = num3;
                                objArray3 = new object[] { "<color=#FFCC00>Max players changed to " + this.inputLine.Substring(10) + "!</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                            else if (this.inputLine.Substring(6).StartsWith("time"))
                            {
                                FengGameManagerMKII.instance.addTime(Convert.ToSingle(this.inputLine.Substring(11)));
                                objArray3 = new object[] { "<color=#FFCC00>" + this.inputLine.Substring(11) + " seconds added to the clock.</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/resetkd"))
                    {
                        Hashtable hashtable;
                        if (this.inputLine == "/resetkdall")
                        {
                            if (PhotonNetwork.isMasterClient)
                            {
                                foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                {
                                    hashtable = new Hashtable();
                                    hashtable.Add(PhotonPlayerProperty.kills, 0);
                                    hashtable.Add(PhotonPlayerProperty.deaths, 0);
                                    hashtable.Add(PhotonPlayerProperty.max_dmg, 0);
                                    hashtable.Add(PhotonPlayerProperty.total_dmg, 0);
                                    player.SetCustomProperties(hashtable);
                                }
                                objArray3 = new object[] { "<color=#FFCC00>All stats have been reset.</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                            else
                            {
                                this.addLINE("<color=#FFCC00>error: not master client</color>");
                            }
                        }
                        else
                        {
                            hashtable = new Hashtable();
                            hashtable.Add(PhotonPlayerProperty.kills, 0);
                            hashtable.Add(PhotonPlayerProperty.deaths, 0);
                            hashtable.Add(PhotonPlayerProperty.max_dmg, 0);
                            hashtable.Add(PhotonPlayerProperty.total_dmg, 0);
                            PhotonNetwork.player.SetCustomProperties(hashtable);
                            this.addLINE("<color=#FFCC00>Your stats have been reset. </color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/pm"))
                    {
                        string[]     strArray     = this.inputLine.Split(new char[] { ' ' });
                        PhotonPlayer targetPlayer = PhotonPlayer.Find(Convert.ToInt32(strArray[1]));
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor();
                        if (str2 == string.Empty)
                        {
                            str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]);
                            if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)
                            {
                                if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1)
                                {
                                    str2 = "<color=#00FFFF>" + str2 + "</color>";
                                }
                                else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2)
                                {
                                    str2 = "<color=#FF00FF>" + str2 + "</color>";
                                }
                            }
                        }
                        string str3 = RCextensions.returnStringFromObject(targetPlayer.customProperties[PhotonPlayerProperty.name]).hexColor();
                        if (str3 == string.Empty)
                        {
                            str3 = RCextensions.returnStringFromObject(targetPlayer.customProperties[PhotonPlayerProperty.name]);
                            if (targetPlayer.customProperties[PhotonPlayerProperty.RCteam] != null)
                            {
                                if (RCextensions.returnIntFromObject(targetPlayer.customProperties[PhotonPlayerProperty.RCteam]) == 1)
                                {
                                    str3 = "<color=#00FFFF>" + str3 + "</color>";
                                }
                                else if (RCextensions.returnIntFromObject(targetPlayer.customProperties[PhotonPlayerProperty.RCteam]) == 2)
                                {
                                    str3 = "<color=#FF00FF>" + str3 + "</color>";
                                }
                            }
                        }
                        string str4 = string.Empty;
                        for (num4 = 2; num4 < strArray.Length; num4++)
                        {
                            str4 = str4 + strArray[num4] + " ";
                        }
                        FengGameManagerMKII.instance.photonView.RPC("ChatPM", targetPlayer, new object[] { /*name*/ str2, str4 });
                        this.addLINE("<color=#FFC000>TO [" + targetPlayer.ID.ToString() + "]</color> " + str3 + ":" + str4);
                    }
                    else if (this.inputLine.StartsWith("/team"))
                    {
                        if (GameSettings.teamMode == 1)
                        {
                            if ((this.inputLine.Substring(6) == "1") || (this.inputLine.Substring(6) == "cyan"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 1 });
                                this.addLINE("<color=#00FFFF>You have joined team cyan.</color>");
                                foreach (GameObject obj2 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj2.GetPhotonView().isMine)
                                    {
                                        obj2.GetComponent <HERO>().markDie();
                                        obj2.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else if ((this.inputLine.Substring(6) == "2") || (this.inputLine.Substring(6) == "magenta"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 2 });
                                this.addLINE("<color=#FF00FF>You have joined team magenta.</color>");
                                foreach (GameObject obj3 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj3.GetPhotonView().isMine)
                                    {
                                        obj3.GetComponent <HERO>().markDie();
                                        obj3.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else if ((this.inputLine.Substring(6) == "0") || (this.inputLine.Substring(6) == "individual"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 0 });
                                this.addLINE("<color=#00FF00>You have joined individuals.</color>");
                                foreach (GameObject obj4 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj4.GetPhotonView().isMine)
                                    {
                                        obj4.GetComponent <HERO>().markDie();
                                        obj4.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else
                            {
                                this.addLINE("<color=#FFCC00>error: invalid team code. Accepted values are 0,1, and 2.</color>");
                            }
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: teams are locked or disabled. </color>");
                        }
                    }
                    else if (this.inputLine == "/restart")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has restarted the game!</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            FengGameManagerMKII.instance.restartRC();
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/specmode"))
                    {
                        if (((int)FengGameManagerMKII.settings[0xf5]) == 0)
                        {
                            FengGameManagerMKII.settings[0xf5] = 1;
                            FengGameManagerMKII.instance.EnterSpecMode(true);
                            this.addLINE("<color=#FFCC00>You have entered spectator mode.</color>");
                        }
                        else
                        {
                            FengGameManagerMKII.settings[0xf5] = 0;
                            FengGameManagerMKII.instance.EnterSpecMode(false);
                            this.addLINE("<color=#FFCC00>You have exited spectator mode.</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/fov"))
                    {
                        int num6 = Convert.ToInt32(this.inputLine.Substring(5));
                        Camera.main.fieldOfView = num6;
                        this.addLINE("<color=#FFCC00>Field of vision set to " + num6.ToString() + ".</color>");
                    }
                    else if (this.inputLine == "/colliders")
                    {
                        int num7 = 0;
                        foreach (TITAN titan in FengGameManagerMKII.titans)
                        {
                            if (titan.myTitanTrigger.isCollide)
                            {
                                num7++;
                            }
                        }
                        InRoomChat.ChatInstanse.addLINE(num7.ToString());
                    }
                    else
                    {
                        int num8;
                        if (this.inputLine.StartsWith("/spectate"))
                        {
                            num8 = Convert.ToInt32(this.inputLine.Substring(10));
                            foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player"))
                            {
                                if (obj5.GetPhotonView().owner.ID == num8)
                                {
                                    IN_GAME_MAIN_CAMERA.mainCamera.setMainObject(obj5, true, false);
                                    IN_GAME_MAIN_CAMERA.mainCamera.setSpectorMode(false);
                                }
                            }
                        }
                        else if (!this.inputLine.StartsWith("/kill"))
                        {
                            object[] objArray5;
                            if (this.inputLine.StartsWith("/revive"))
                            {
                                if (PhotonNetwork.isMasterClient)
                                {
                                    if (this.inputLine == "/reviveall")
                                    {
                                        objArray5 = new object[] { "<color=#FFCC00>All players have been revived.</color>", string.Empty };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5);
                                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                        {
                                            if (((player.customProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2))
                                            {
                                                FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        num8 = Convert.ToInt32(this.inputLine.Substring(8));
                                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                        {
                                            if (player.ID == num8)
                                            {
                                                this.addLINE("<color=#FFCC00>Player " + num8.ToString() + " has been revived.</color>");
                                                if (((player.customProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2))
                                                {
                                                    objArray5 = new object[] { "<color=#FFCC00>You have been revived by the master client.</color>", string.Empty };
                                                    FengGameManagerMKII.instance.photonView.RPC("Chat", player, objArray5);
                                                    FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]);
                                                }
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    this.addLINE("<color=#FFCC00>error: not master client</color>");
                                }
                            }
                            else if (this.inputLine.StartsWith("/ignore"))
                            {
                                string[]     args   = inputLine.Split(new char[] { ' ' });
                                PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
                                FengGameManagerMKII.ignoreList.Add(player.ID);
                                FengGameManagerMKII.instance.RecompilePlayerList(0.1f);
                            }
                            else if (this.inputLine.StartsWith("/unignore"))
                            {
                                string[]     args   = inputLine.Split(new char[] { ' ' });
                                PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
                                FengGameManagerMKII.ignoreList.Remove(player.ID);
                                FengGameManagerMKII.instance.RecompilePlayerList(0.1f);
                            }
                            else if (this.inputLine.StartsWith("/unban"))
                            {
                                if (FengGameManagerMKII.OnPrivateServer)
                                {
                                    FengGameManagerMKII.ServerRequestUnban(this.inputLine.Substring(7));
                                }
                                else if (PhotonNetwork.isMasterClient)
                                {
                                    int num9 = Convert.ToInt32(this.inputLine.Substring(7));
                                    if (FengGameManagerMKII.banHash.ContainsKey(num9))
                                    {
                                        objArray5 = new object[] { "<color=#FFCC00>" + ((string)FengGameManagerMKII.banHash[num9]) + " has been unbanned from the server. </color>", string.Empty };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5);
                                        FengGameManagerMKII.banHash.Remove(num9);
                                    }
                                    else
                                    {
                                        this.addLINE("error: no such player");
                                    }
                                }
                                else
                                {
                                    this.addLINE("<color=#FFCC00>error: not master client</color>");
                                }
                            }
                            else if (this.inputLine.StartsWith("/rules"))
                            {
                                this.addLINE("<color=#FFCC00>Currently activated gamemodes:</color>");
                                if (GameSettings.bombMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Bomb mode is on.</color>");
                                }
                                if (GameSettings.teamMode > 0)
                                {
                                    if (GameSettings.teamMode == 1)
                                    {
                                        this.addLINE("<color=#FFCC00>Team mode is on (no sort).</color>");
                                    }
                                    else if (GameSettings.teamMode == 2)
                                    {
                                        this.addLINE("<color=#FFCC00>Team mode is on (sort by size).</color>");
                                    }
                                    else if (GameSettings.teamMode == 3)
                                    {
                                        this.addLINE("<color=#FFCC00>Team mode is on (sort by skill).</color>");
                                    }
                                }
                                if (GameSettings.pointMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Point mode is on (" + Convert.ToString(GameSettings.pointMode) + ").</color>");
                                }
                                if (GameSettings.disableRock > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Punk Rock-Throwing is disabled.</color>");
                                }
                                if (GameSettings.spawnMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Custom spawn rate is on (" + GameSettings.nRate.ToString("F2") + "% Normal, " + GameSettings.aRate.ToString("F2") + "% Abnormal, " + GameSettings.jRate.ToString("F2") + "% Jumper, " + GameSettings.cRate.ToString("F2") + "% Crawler, " + GameSettings.pRate.ToString("F2") + "% Punk </color>");
                                }
                                if (GameSettings.explodeMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Titan explode mode is on (" + Convert.ToString(GameSettings.explodeMode) + ").</color>");
                                }
                                if (GameSettings.healthMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Titan health mode is on (" + Convert.ToString(GameSettings.healthLower) + "-" + Convert.ToString(GameSettings.healthUpper) + ").</color>");
                                }
                                if (GameSettings.infectionMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Infection mode is on (" + Convert.ToString(GameSettings.infectionMode) + ").</color>");
                                }
                                if (GameSettings.damageMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Minimum nape damage is on (" + Convert.ToString(GameSettings.damageMode) + ").</color>");
                                }
                                if (GameSettings.moreTitans > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Custom titan is on (" + Convert.ToString(GameSettings.moreTitans) + ").</color>");
                                }
                                if (GameSettings.sizeMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Custom titan size is on (" + GameSettings.sizeLower.ToString("F2") + "," + GameSettings.sizeUpper.ToString("F2") + ").</color>");
                                }
                                if (GameSettings.banEren > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Anti-Eren is on. Using Titan eren will get you kicked.</color>");
                                }
                                if (GameSettings.waveModeOn == 1)
                                {
                                    this.addLINE("<color=#FFCC00>Custom wave mode is on (" + Convert.ToString(GameSettings.waveModeNum) + ").</color>");
                                }
                                if (GameSettings.friendlyMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Friendly-Fire disabled. PVP is prohibited.</color>");
                                }
                                if (GameSettings.pvpMode > 0)
                                {
                                    if (GameSettings.pvpMode == 1)
                                    {
                                        this.addLINE("<color=#FFCC00>AHSS/Blade PVP is on (team-based).</color>");
                                    }
                                    else if (GameSettings.pvpMode == 2)
                                    {
                                        this.addLINE("<color=#FFCC00>AHSS/Blade PVP is on (FFA).</color>");
                                    }
                                }
                                if (GameSettings.maxWave > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Max Wave set to " + GameSettings.maxWave.ToString() + "</color>");
                                }
                                if (GameSettings.horseMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Horses are enabled.</color>");
                                }
                                if (GameSettings.ahssReload > 0)
                                {
                                    this.addLINE("<color=#FFCC00>AHSS Air-Reload disabled.</color>");
                                }
                                if (GameSettings.punkWaves > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Punk override every 5 waves enabled.</color>");
                                }
                                if (GameSettings.endlessMode > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Endless Respawn is enabled (" + GameSettings.endlessMode.ToString() + " seconds).</color>");
                                }
                                if (GameSettings.globalDisableMinimap > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Minimaps are disabled.</color>");
                                }
                                if (GameSettings.motd != string.Empty)
                                {
                                    this.addLINE("<color=#FFCC00>MOTD:" + GameSettings.motd + "</color>");
                                }
                                if (GameSettings.deadlyCannons > 0)
                                {
                                    this.addLINE("<color=#FFCC00>Cannons will kill humans.</color>");
                                }
                            }
                            else
                            {
                                object[] objArray6;
                                bool     flag2;
                                object[] objArray7;
                                if (this.inputLine.StartsWith("/kick"))
                                {
                                    num8 = Convert.ToInt32(this.inputLine.Substring(6));
                                    if (num8 == PhotonNetwork.player.ID)
                                    {
                                        this.addLINE("error:can't kick yourself.");
                                    }
                                    else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
                                    {
                                        objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6);
                                    }
                                    else
                                    {
                                        flag2 = false;
                                        foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                                        {
                                            if (num8 == player3.ID)
                                            {
                                                flag2 = true;
                                                if (FengGameManagerMKII.OnPrivateServer)
                                                {
                                                    FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                                                }
                                                else if (PhotonNetwork.isMasterClient)
                                                {
                                                    FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                                                    objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!</color>", string.Empty };
                                                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7);
                                                }
                                            }
                                        }
                                        if (!flag2)
                                        {
                                            this.addLINE("error:no such player.");
                                        }
                                    }
                                }
                                else if (this.inputLine.StartsWith("/ban"))
                                {
                                    if (this.inputLine == "/banlist")
                                    {
                                        this.addLINE("<color=#FFCC00>List of banned players:</color>");
                                        foreach (int num10 in FengGameManagerMKII.banHash.Keys)
                                        {
                                            this.addLINE("<color=#FFCC00>" + Convert.ToString(num10) + ":" + ((string)FengGameManagerMKII.banHash[num10]) + "</color>");
                                        }
                                    }
                                    else
                                    {
                                        num8 = Convert.ToInt32(this.inputLine.Substring(5));
                                        if (num8 == PhotonNetwork.player.ID)
                                        {
                                            this.addLINE("error:can't kick yourself.");
                                        }
                                        else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
                                        {
                                            objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name };
                                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6);
                                        }
                                        else
                                        {
                                            flag2 = false;
                                            foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                                            {
                                                if (num8 == player3.ID)
                                                {
                                                    flag2 = true;
                                                    if (FengGameManagerMKII.OnPrivateServer)
                                                    {
                                                        FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                                                    }
                                                    else if (PhotonNetwork.isMasterClient)
                                                    {
                                                        FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                                                        objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been banned from the server!</color>", string.Empty };
                                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7);
                                                    }
                                                }
                                            }
                                            if (!flag2)
                                            {
                                                this.addLINE("error:no such player.");
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                this.inputLine = string.Empty;
                GUI.FocusControl(string.Empty);
                return;
            }
            this.inputLine = "\t";
            GUI.FocusControl("ChatInput");
        }
Label_219C:
        GUI.SetNextControlName(string.Empty);
        GUILayout.BeginArea(GuiRect);
        GUILayout.FlexibleSpace();
        string text = string.Empty;

        if (messages.Count < 15)
        {
            for (num4 = 0; num4 < messages.Count; num4++)
            {
                text = text + messages[num4] + "\n";
            }
        }
        else
        {
            for (int i = messages.Count - 15; i < messages.Count; i++)
            {
                text = text + messages[i] + "\n";
            }
        }
        GUILayout.Label(text, new GUILayoutOption[0]);
        GUILayout.EndArea();
        GUILayout.BeginArea(GuiRect2);
        GUILayout.BeginHorizontal(new GUILayoutOption[0]);
        GUI.SetNextControlName("ChatInput");
        this.inputLine = GUILayout.TextField(this.inputLine, new GUILayoutOption[0]);
        GUILayout.EndHorizontal();
        GUILayout.EndArea();
    }
Example #18
0
    public void OnGUI()
    {
        int num4;

        if (!this.IsVisible || (PhotonNetwork.connectionState != ConnectionState.Connected))
        {
            return;
        }
        if (Event.current.type == EventType.KeyDown)
        {
            if ((((Event.current.keyCode != KeyCode.Tab) && (Event.current.character != '\t')) || IN_GAME_MAIN_CAMERA.isPausing) || (FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] == KeyCode.Tab))
            {
                goto Label_00E1;
            }
            Event.current.Use();
            goto Label_013D;
        }
        if ((Event.current.type == EventType.KeyUp) && (((Event.current.keyCode != KeyCode.None) && (Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat])) && (GUI.GetNameOfFocusedControl() != "ChatInput")))
        {
            this.inputLine = string.Empty;
            ChatInputField.gameObject.GetComponent <Text>().text = string.Empty;
            goto Label_013D;
        }
Label_00E1:
        if ((Event.current.type == EventType.KeyDown) && ((Event.current.keyCode == KeyCode.KeypadEnter) || (Event.current.keyCode == KeyCode.Return)))
        {
            if (!string.IsNullOrEmpty(this.inputLine))
            {
                string str2;
                if (this.inputLine == "\t")
                {
                    this.inputLine = string.Empty;
                    ChatInputField.gameObject.GetComponent <Text>().text = string.Empty;
                    return;
                }
                if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput"))
                {
                    string key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"];
                    if (FengGameManagerMKII.stringVariables.ContainsKey(key))
                    {
                        FengGameManagerMKII.stringVariables[key] = this.inputLine;
                    }
                    else
                    {
                        FengGameManagerMKII.stringVariables.Add(key, this.inputLine);
                    }
                    ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent();
                }
                if (!this.inputLine.StartsWith("/"))
                {
                    str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]).hexColor();
                    if (str2 == string.Empty)
                    {
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]);
                        if (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 1)
                            {
                                str2 = "<color=#00FFFF>" + str2 + "</color>";
                            }
                            else if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 2)
                            {
                                str2 = "<color=#FF00FF>" + str2 + "</color>";
                            }
                        }
                    }
                    object[] parameters = new object[] { this.inputLine, str2 };
                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
                else if (this.inputLine == "/cloth")
                {
                    this.addLINE(ClothFactory.GetDebugInfo());
                }
                else if (this.inputLine.StartsWith("/aso"))
                {
                    if (PhotonNetwork.isMasterClient)
                    {
                        switch (this.inputLine.Substring(5))
                        {
                        case "kdr":
                            if (!FengGameManagerMKII.Gamemode.SaveKDROnDisconnect)
                            {
                                FengGameManagerMKII.Gamemode.SaveKDROnDisconnect = true;
                                this.addLINE("<color=#FFCC00>KDRs will be preserved from disconnects.</color>");
                            }
                            else
                            {
                                FengGameManagerMKII.Gamemode.SaveKDROnDisconnect = false;
                                this.addLINE("<color=#FFCC00>KDRs will not be preserved from disconnects.</color>");
                            }
                            break;
                        }
                    }
                }
                else
                {
                    object[] objArray3;
                    if (this.inputLine == "/pause")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { true });
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has paused the game.</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine == "/unpause")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.photonView.RPC("pauseRPC", PhotonTargets.All, new object[] { false });
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has unpaused the game.</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine == "/checklevel")
                    {
                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                        {
                            this.addLINE(RCextensions.returnStringFromObject(player.CustomProperties[PhotonPlayerProperty.currentLevel]));
                        }
                    }
                    else if (this.inputLine == "/isrc")
                    {
                        if (FengGameManagerMKII.masterRC)
                        {
                            this.addLINE("is RC");
                        }
                        else
                        {
                            this.addLINE("not RC");
                        }
                    }
                    else if (this.inputLine == "/ignorelist")
                    {
                        foreach (int num2 in FengGameManagerMKII.ignoreList)
                        {
                            this.addLINE(num2.ToString());
                        }
                    }
                    else if (this.inputLine.StartsWith("/room"))
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            if (this.inputLine.Substring(6).StartsWith("max"))
                            {
                                int num3 = Convert.ToInt32(this.inputLine.Substring(10));
                                FengGameManagerMKII.instance.maxPlayers = num3;
                                PhotonNetwork.room.maxPlayers           = num3;
                                objArray3 = new object[] { "<color=#FFCC00>Max players changed to " + this.inputLine.Substring(10) + "!</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                            else if (this.inputLine.Substring(6).StartsWith("time"))
                            {
                                FengGameManagerMKII.instance.addTime(Convert.ToSingle(this.inputLine.Substring(11)));
                                objArray3 = new object[] { "<color=#FFCC00>" + this.inputLine.Substring(11) + " seconds added to the clock.</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/resetkd"))
                    {
                        Hashtable hashtable;
                        if (this.inputLine == "/resetkdall")
                        {
                            if (PhotonNetwork.isMasterClient)
                            {
                                foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                {
                                    hashtable = new Hashtable();
                                    hashtable.Add(PhotonPlayerProperty.kills, 0);
                                    hashtable.Add(PhotonPlayerProperty.deaths, 0);
                                    hashtable.Add(PhotonPlayerProperty.max_dmg, 0);
                                    hashtable.Add(PhotonPlayerProperty.total_dmg, 0);
                                    player.SetCustomProperties(hashtable);
                                }
                                objArray3 = new object[] { "<color=#FFCC00>All stats have been reset.</color>", "" };
                                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            }
                            else
                            {
                                this.addLINE("<color=#FFCC00>error: not master client</color>");
                            }
                        }
                        else
                        {
                            hashtable = new Hashtable();
                            hashtable.Add(PhotonPlayerProperty.kills, 0);
                            hashtable.Add(PhotonPlayerProperty.deaths, 0);
                            hashtable.Add(PhotonPlayerProperty.max_dmg, 0);
                            hashtable.Add(PhotonPlayerProperty.total_dmg, 0);
                            PhotonNetwork.player.SetCustomProperties(hashtable);
                            this.addLINE("<color=#FFCC00>Your stats have been reset. </color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/pm"))
                    {
                        string[]     strArray     = this.inputLine.Split(new char[] { ' ' });
                        PhotonPlayer targetPlayer = PhotonPlayer.Find(Convert.ToInt32(strArray[1]));
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]).hexColor();
                        if (str2 == string.Empty)
                        {
                            str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]);
                            if (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null)
                            {
                                if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 1)
                                {
                                    str2 = "<color=#00FFFF>" + str2 + "</color>";
                                }
                                else if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]) == 2)
                                {
                                    str2 = "<color=#FF00FF>" + str2 + "</color>";
                                }
                            }
                        }
                        string str3 = RCextensions.returnStringFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.name]).hexColor();
                        if (str3 == string.Empty)
                        {
                            str3 = RCextensions.returnStringFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.name]);
                            if (targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam] != null)
                            {
                                if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam]) == 1)
                                {
                                    str3 = "<color=#00FFFF>" + str3 + "</color>";
                                }
                                else if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.RCteam]) == 2)
                                {
                                    str3 = "<color=#FF00FF>" + str3 + "</color>";
                                }
                            }
                        }
                        string str4 = string.Empty;
                        for (num4 = 2; num4 < strArray.Length; num4++)
                        {
                            str4 = str4 + strArray[num4] + " ";
                        }
                        FengGameManagerMKII.instance.photonView.RPC("ChatPM", targetPlayer, new object[] { str2, str4 });
                        this.addLINE("<color=#FFC000>TO [" + targetPlayer.ID.ToString() + "]</color> " + str3 + ":" + str4);
                    }
                    else if (this.inputLine.StartsWith("/team"))
                    {
                        if (FengGameManagerMKII.Gamemode.TeamMode == TeamMode.NoSort)
                        {
                            if ((this.inputLine.Substring(6) == "1") || (this.inputLine.Substring(6) == "cyan"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 1 });
                                this.addLINE("<color=#00FFFF>You have joined team cyan.</color>");
                                foreach (GameObject obj2 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj2.GetPhotonView().isMine)
                                    {
                                        obj2.GetComponent <Hero>().markDie();
                                        obj2.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else if ((this.inputLine.Substring(6) == "2") || (this.inputLine.Substring(6) == "magenta"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 2 });
                                this.addLINE("<color=#FF00FF>You have joined team magenta.</color>");
                                foreach (GameObject obj3 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj3.GetPhotonView().isMine)
                                    {
                                        obj3.GetComponent <Hero>().markDie();
                                        obj3.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else if ((this.inputLine.Substring(6) == "0") || (this.inputLine.Substring(6) == "individual"))
                            {
                                FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { 0 });
                                this.addLINE("<color=#00FF00>You have joined individuals.</color>");
                                foreach (GameObject obj4 in GameObject.FindGameObjectsWithTag("Player"))
                                {
                                    if (obj4.GetPhotonView().isMine)
                                    {
                                        obj4.GetComponent <Hero>().markDie();
                                        obj4.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                                    }
                                }
                            }
                            else
                            {
                                this.addLINE("<color=#FFCC00>error: invalid team code. Accepted values are 0,1, and 2.</color>");
                            }
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: teams are locked or disabled. </color>");
                        }
                    }
                    else if (this.inputLine == "/restart")
                    {
                        if (PhotonNetwork.isMasterClient)
                        {
                            objArray3 = new object[] { "<color=#FFCC00>MasterClient has restarted the game!</color>", "" };
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray3);
                            FengGameManagerMKII.instance.restartRC();
                        }
                        else
                        {
                            this.addLINE("<color=#FFCC00>error: not master client</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/specmode"))
                    {
                        if (((int)FengGameManagerMKII.settings[0xf5]) == 0)
                        {
                            FengGameManagerMKII.settings[0xf5] = 1;
                            FengGameManagerMKII.instance.EnterSpecMode(true);
                            this.addLINE("<color=#FFCC00>You have entered spectator mode.</color>");
                        }
                        else
                        {
                            FengGameManagerMKII.settings[0xf5] = 0;
                            FengGameManagerMKII.instance.EnterSpecMode(false);
                            this.addLINE("<color=#FFCC00>You have exited spectator mode.</color>");
                        }
                    }
                    else if (this.inputLine.StartsWith("/fov"))
                    {
                        int num6 = Convert.ToInt32(this.inputLine.Substring(5));
                        Camera.main.fieldOfView = num6;
                        this.addLINE("<color=#FFCC00>Field of vision set to " + num6.ToString() + ".</color>");
                    }
                    else if (this.inputLine == "/colliders")
                    {
                        int num7 = 0;
                        foreach (TITAN titan in FengGameManagerMKII.instance.getTitans())
                        {
                            if (titan.myTitanTrigger.isCollide)
                            {
                                num7++;
                            }
                        }
                        FengGameManagerMKII.instance.chatRoom.addLINE(num7.ToString());
                    }
                    else
                    {
                        int num8;
                        if (this.inputLine.StartsWith("/spectate"))
                        {
                            num8 = Convert.ToInt32(this.inputLine.Substring(10));
                            foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player"))
                            {
                                if (obj5.GetPhotonView().owner.ID == num8)
                                {
                                    Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setMainObject(obj5, true, false);
                                    Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setSpectorMode(false);
                                }
                            }
                        }
                        else if (!this.inputLine.StartsWith("/kill"))
                        {
                            object[] objArray5;
                            if (this.inputLine.StartsWith("/revive"))
                            {
                                if (PhotonNetwork.isMasterClient)
                                {
                                    if (this.inputLine == "/reviveall")
                                    {
                                        objArray5 = new object[] { "<color=#FFCC00>All players have been revived.</color>", string.Empty };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5);
                                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                        {
                                            if (((player.CustomProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2))
                                            {
                                                FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]);
                                            }
                                        }
                                    }
                                    else
                                    {
                                        num8 = Convert.ToInt32(this.inputLine.Substring(8));
                                        foreach (PhotonPlayer player in PhotonNetwork.playerList)
                                        {
                                            if (player.ID == num8)
                                            {
                                                this.addLINE("<color=#FFCC00>Player " + num8.ToString() + " has been revived.</color>");
                                                if (((player.CustomProperties[PhotonPlayerProperty.dead] != null) && RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead])) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2))
                                                {
                                                    objArray5 = new object[] { "<color=#FFCC00>You have been revived by the master client.</color>", string.Empty };
                                                    FengGameManagerMKII.instance.photonView.RPC("Chat", player, objArray5);
                                                    FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]);
                                                }
                                            }
                                        }
                                    }
                                }
                                else
                                {
                                    this.addLINE("<color=#FFCC00>error: not master client</color>");
                                }
                            }
                            else if (this.inputLine.StartsWith("/unban"))
                            {
                                if (FengGameManagerMKII.OnPrivateServer)
                                {
                                    FengGameManagerMKII.ServerRequestUnban(this.inputLine.Substring(7));
                                }
                                else if (PhotonNetwork.isMasterClient)
                                {
                                    int num9 = Convert.ToInt32(this.inputLine.Substring(7));
                                    if (FengGameManagerMKII.banHash.ContainsKey(num9))
                                    {
                                        objArray5 = new object[] { "<color=#FFCC00>" + ((string)FengGameManagerMKII.banHash[num9]) + " has been unbanned from the server. </color>", string.Empty };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray5);
                                        FengGameManagerMKII.banHash.Remove(num9);
                                    }
                                    else
                                    {
                                        this.addLINE("error: no such player");
                                    }
                                }
                                else
                                {
                                    this.addLINE("<color=#FFCC00>error: not master client</color>");
                                }
                            }
                            else if (this.inputLine.StartsWith("/rules"))
                            {
                                this.addLINE("<color=#FFCC00>Currently activated gamemodes:</color>");
                                if (FengGameManagerMKII.Gamemode.Horse)
                                {
                                    this.addLINE("<color=#FFCC00>Horses are enabled.</color>");
                                }
                                if (FengGameManagerMKII.Gamemode.Motd != string.Empty)
                                {
                                    this.addLINE("<color=#FFCC00>MOTD:" + FengGameManagerMKII.Gamemode.Motd + "</color>");
                                }
                            }
                            else
                            {
                                object[] objArray6;
                                bool     flag2;
                                object[] objArray7;
                                if (this.inputLine.StartsWith("/kick"))
                                {
                                    num8 = Convert.ToInt32(this.inputLine.Substring(6));
                                    if (num8 == PhotonNetwork.player.ID)
                                    {
                                        this.addLINE("error:can't kick yourself.");
                                    }
                                    else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
                                    {
                                        objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name };
                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6);
                                    }
                                    else
                                    {
                                        flag2 = false;
                                        foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                                        {
                                            if (num8 == player3.ID)
                                            {
                                                flag2 = true;
                                                if (FengGameManagerMKII.OnPrivateServer)
                                                {
                                                    FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                                                }
                                                else if (PhotonNetwork.isMasterClient)
                                                {
                                                    FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                                                    objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.CustomProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!</color>", string.Empty };
                                                    FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7);
                                                }
                                            }
                                        }
                                        if (!flag2)
                                        {
                                            this.addLINE("error:no such player.");
                                        }
                                    }
                                }
                                else if (this.inputLine.StartsWith("/ban"))
                                {
                                    if (this.inputLine == "/banlist")
                                    {
                                        this.addLINE("<color=#FFCC00>List of banned players:</color>");
                                        foreach (int num10 in FengGameManagerMKII.banHash.Keys)
                                        {
                                            this.addLINE("<color=#FFCC00>" + Convert.ToString(num10) + ":" + ((string)FengGameManagerMKII.banHash[num10]) + "</color>");
                                        }
                                    }
                                    else
                                    {
                                        num8 = Convert.ToInt32(this.inputLine.Substring(5));
                                        if (num8 == PhotonNetwork.player.ID)
                                        {
                                            this.addLINE("error:can't kick yourself.");
                                        }
                                        else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
                                        {
                                            objArray6 = new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name };
                                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray6);
                                        }
                                        else
                                        {
                                            flag2 = false;
                                            foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                                            {
                                                if (num8 == player3.ID)
                                                {
                                                    flag2 = true;
                                                    if (FengGameManagerMKII.OnPrivateServer)
                                                    {
                                                        FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                                                    }
                                                    else if (PhotonNetwork.isMasterClient)
                                                    {
                                                        FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                                                        objArray7 = new object[] { "<color=#FFCC00>" + RCextensions.returnStringFromObject(player3.CustomProperties[PhotonPlayerProperty.name]) + " has been banned from the server!</color>", string.Empty };
                                                        FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, objArray7);
                                                    }
                                                }
                                            }
                                            if (!flag2)
                                            {
                                                this.addLINE("error:no such player.");
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                this.inputLine = string.Empty;
                ChatInputField?.Select();
                ChatInputField.text = string.Empty;
                return;
            }
            this.inputLine = "\t";
            ChatInputField?.Select();
        }
Label_013D:
        string text = string.Empty;

        if (messages.Count < 15)
        {
            for (num4 = 0; num4 < messages.Count; num4++)
            {
                text = text + messages[num4] + "\n";
            }
        }
        else
        {
            for (int i = messages.Count - 15; i < messages.Count; i++)
            {
                text = text + messages[i] + "\n";
            }
        }

        if (ChatText != null)
        {
            ChatText.text = text;
        }
        this.inputLine = ChatInputField?.text;
    }
Example #19
0
        private static bool IsTeamAllDead(int team)
        {
            var num  = 0;
            var num2 = 0;

            foreach (var player in PhotonNetwork.playerList)
            {
                if (((player.CustomProperties[PhotonPlayerProperty.isTitan] != null) && (player.CustomProperties[PhotonPlayerProperty.team] != null)) && ((RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) == 1) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.team]) == team)))
                {
                    num++;
                    if (RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead]))
                    {
                        num2++;
                    }
                }
            }
            return(num == num2);
        }
Example #20
0
    public override void OnTitanKilled(string titanName, bool onPlayerLeave)
    {
        if (!IsAllTitansDead())
        {
            return;
        }
        Wave++;
        var level = FengGameManagerMKII.level;

        if (!(((LevelInfo.getInfo(level).respawnMode != RespawnMode.NEWROUND) && (!level.StartsWith("Custom") || (RCSettings.gameType != 1))) || (IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.MULTIPLAYER)))
        {
            foreach (PhotonPlayer player in PhotonNetwork.playerList)
            {
                if (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2)
                {
                    FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player);
                }
            }
        }
        if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
        {
            //this.sendChatContentInfo("<color=#A8FF24>Wave : " + this.wave + "</color>");
        }
        if (Wave > HighestWave)
        {
            HighestWave = Wave;
        }
        if (PhotonNetwork.isMasterClient)
        {
            FengGameManagerMKII.instance.RequireStatus();
        }
        if (!(((RCSettings.maxWave != 0) || (Wave <= MaxWave)) && ((RCSettings.maxWave <= 0) || (Wave <= RCSettings.maxWave))))
        {
            FengGameManagerMKII.instance.gameWin2();
        }
        else
        {
            int abnormal = 90;
            if (Difficulty == 1)
            {
                abnormal = 70;
            }
            if (!LevelInfo.getInfo(level).punk)
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
            }
            else if (Wave == 5)
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, 1, true);
            }
            else if (Wave == 10)
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, 2, true);
            }
            else if (Wave == 15)
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, 3, true);
            }
            else if (Wave == 20)
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, 4, true);
            }
            else
            {
                FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
            }
        }
    }
Example #21
0
    private void commandSwitch(string[] args)
    {
        switch (args[0])
        {
        case "pos":
            FengGameManagerMKII.ShowPos();
            break;

        case "ban":
        {
            int num8 = Convert.ToInt32(args[1]);
            if (num8 == PhotonNetwork.player.ID)
            {
                this.AddLine("Error:can't kick yourself.");
            }
            else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
            {
                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name });
            }
            else
            {
                foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                {
                    if (num8 == player3.ID)
                    {
                        if (FengGameManagerMKII.OnPrivateServer)
                        {
                            FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                        }
                        else if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.kickPlayerRC(player3, true, "");
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been banned from the server!"), string.Empty });
                        }
                    }
                }
                if (PhotonPlayer.Find(num8) == null)
                {
                    this.AddLine("error:no such player.");
                }
            }
        }
            return;

        case "cloth":
            AddLine(ClothFactory.GetDebugInfo());
            return;

        case "aso":
            if (!PhotonNetwork.isMasterClient)
            {
                AddLineRC("Error: not masterclient");
                return;
            }
            switch (args[1])
            {
            case "kdr":
                RCSettings.asoPreservekdr = RCSettings.asoPreservekdr == 0 ? 1 : 0;
                AddLineRC("KDRs will " + (RCSettings.asoPreservekdr == 1 ? " " : "not ") + "be preserved from disconnects.");
                break;

            case "racing":
                RCSettings.racingStatic = RCSettings.racingStatic == 0 ? 1 : 0;
                AddLineRC("Racing will " + (RCSettings.asoPreservekdr == 1 ? " " : "not ") + "end on finish.");
                break;
            }
            return;

        case "pause":
        case "unpause":
            if (!PhotonNetwork.isMasterClient)
            {
                AddLineRC("Error: not masterclient");
                return;
            }
            FengGameManagerMKII.instance.SetPause();
            return;

        case "checklevel":
            foreach (PhotonPlayer player in PhotonNetwork.playerList)
            {
                AddLine(RCextensions.returnStringFromObject(player.customProperties[PhotonPlayerProperty.currentLevel]));
            }
            return;

        case "isrc":
            AddLineRC((FengGameManagerMKII.masterRC ? "is" : "not") + " RC");
            return;

        case "ignorelist":
            foreach (int id in FengGameManagerMKII.ignoreList)
            {
                AddLine(id.ToString());
            }
            return;

        case "room":
            if (!PhotonNetwork.isMasterClient)
            {
                AddLineRC("Error: not masterclient");
                return;
            }
            int roomValue = Convert.ToInt32(args[2]);
            switch (args[1])
            {
            case "max":
                PhotonNetwork.room.maxPlayers = roomValue;
                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("Max players changed to " + roomValue + "!"), "" });
                break;

            case "time":
                FengGameManagerMKII.instance.addTime(roomValue);
                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(roomValue + " seconds added to the clock."), "" });
                break;
            }
            return;

        case "resetkd":
            PhotonNetwork.player.SetCustomProperties(new Hashtable()
            {
                { "kills", 0 }, { "deaths", 0 }, { "max_dmg", 0 }, { "total_dmg", 0 }
            });
            AddLineRC("Your stats have been reset.");
            return;

        case "resetkdall":
        {
            if (!PhotonNetwork.isMasterClient)
            {
                AddLine("Error: not masterclient");
                return;
            }
            Hashtable hash = new Hashtable()
            {
                { "kills", 0 }, { "deaths", 0 }, { "max_dmg", 0 }, { "total_dmg", 0 }
            };
            foreach (PhotonPlayer player in PhotonNetwork.playerList)
            {
                player.SetCustomProperties(hash);
            }
            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("All stats have been reset"), "" });
        }
            return;

        case "revive":
        {
            PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
            FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player, new object[0]);
            AddLineRC("Player [" + player.ID + "] has been revived");
        }
            return;

        case "reviveall":
            FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", PhotonTargets.All, new object[0]);
            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("All player have been revived"), "" });
            return;

        case "pm":
        {
            PhotonPlayer player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
            string       msg    = "";
            for (int i = 2; i < args.Length; i++)
            {
                msg += args[i] + (i == args.Length - 1 ? "" : " ");
            }
            string myName   = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties["name"]).hexColor();
            string sendName = "";
            switch (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties["RCteam"]))
            {
            case 1:
                sendName = "<color=cyan>" + myName + "</color>";
                break;

            case 2:
                sendName = "<color=magenta>" + myName + "</color>";
                break;

            default:
                sendName = myName;
                break;
            }
            FengGameManagerMKII.instance.photonView.RPC("ChatPM", player, new object[] { sendName, msg });
            AddLine(RCLine("Sent PM [" + player.ID + "] " + msg));
        }
            return;

        case "team":
            if (RCSettings.teamMode != 1)
            {
                AddLineRC("Error: teams are locked or disabled");
                return;
            }
            int    teamValue   = 0;
            string newTeamName = "Individuals";
            switch (args[1])
            {
            case "0":
            case "individual":
                break;

            case "1":
            case "cyan":
                teamValue   = 1;
                newTeamName = "Cyan";
                break;

            case "2":
            case "magenta":
                teamValue   = 2;
                newTeamName = "Magenta";
                break;

            default:
                AddLineRC("Error: invalid team code/name.(use 0, 1, 2)");
                return;
            }
            FengGameManagerMKII.instance.photonView.RPC("setTeamRPC", PhotonNetwork.player, new object[] { teamValue });
            AddLineRC("You have joined to team " + newTeamName);
            foreach (object obj in FengGameManagerMKII.instance.getPlayers())
            {
                HERO her = (HERO)obj;
                if (her.photonView.isMine)
                {
                    her.markDie();
                    her.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "Team Switch" });
                    break;
                }
            }
            return;

        case "kick":
        {
            int num8 = Convert.ToInt32(args[1]);
            if (num8 == PhotonNetwork.player.ID)
            {
                this.AddLine("error:can't kick yourself.");
            }
            else if (!(FengGameManagerMKII.OnPrivateServer || PhotonNetwork.isMasterClient))
            {
                FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { "/kick #" + Convert.ToString(num8), LoginFengKAI.player.name });
            }
            else
            {
                foreach (PhotonPlayer player3 in PhotonNetwork.playerList)
                {
                    if (num8 == player3.ID)
                    {
                        if (FengGameManagerMKII.OnPrivateServer)
                        {
                            FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                        }
                        else if (PhotonNetwork.isMasterClient)
                        {
                            FengGameManagerMKII.instance.kickPlayerRC(player3, false, "");
                            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine(RCextensions.returnStringFromObject(player3.customProperties[PhotonPlayerProperty.name]) + " has been kicked from the server!"), string.Empty });
                        }
                    }
                }
                if (PhotonPlayer.Find(num8) == null)
                {
                    this.AddLine("error:no such player.");
                }
            }
        }
            return;

        case "restart":
            if (!PhotonNetwork.isMasterClient)
            {
                AddLineRC("Error: not masterclient");
                return;
            }
            FengGameManagerMKII.instance.restartGame(false);
            FengGameManagerMKII.instance.photonView.RPC("Chat", PhotonTargets.All, new object[] { RCLine("MasterClient has restarted the game."), "" });
            return;

        case "specmode":
            if (((int)FengGameManagerMKII.settings[0xf5]) == 0)
            {
                FengGameManagerMKII.settings[0xf5] = 1;
                FengGameManagerMKII.instance.EnterSpecMode(true);
                AddLineRC("You have entered spectator mode.");
            }
            else
            {
                FengGameManagerMKII.settings[0xf5] = 0;
                FengGameManagerMKII.instance.EnterSpecMode(false);
                AddLineRC("You have exited spectator mode.");
            }
            return;

        case "fov":
            int num6 = Convert.ToInt32(args[1]);
            Camera.main.fieldOfView = num6;
            AddLineRC("Field of vision set to " + num6.ToString() + ".");
            return;

        case "colliders":
            int num7 = 0;
            foreach (TITAN titan in FengGameManagerMKII.instance.getTitans())
            {
                if (titan.myTitanTrigger.isCollide)
                {
                    num7++;
                }
            }
            AddLine(num7.ToString());
            return;

        case "spectate":
        {
            int num8 = Convert.ToInt32(args[1]);
            foreach (GameObject obj5 in GameObject.FindGameObjectsWithTag("Player"))
            {
                if (obj5.GetPhotonView().owner.ID == num8)
                {
                    Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setMainObject(obj5, true, false);
                    Camera.main.GetComponent <IN_GAME_MAIN_CAMERA>().setSpectorMode(false);
                }
            }
        }
            return;

        case "rules":
        {
            AddLineRC("Currently activated gamemodes:");
            if (RCSettings.bombMode > 0)
            {
                AddLineRC("Bomb mode is on.");
            }
            if (RCSettings.teamMode > 0)
            {
                if (RCSettings.teamMode == 1)
                {
                    AddLineRC("Team mode is on (no sort).");
                }
                else if (RCSettings.teamMode == 2)
                {
                    AddLineRC("Team mode is on (sort by size).");
                }
                else if (RCSettings.teamMode == 3)
                {
                    AddLineRC("Team mode is on (sort by skill).");
                }
            }
            if (RCSettings.pointMode > 0)
            {
                AddLineRC("Point mode is on (" + Convert.ToString(RCSettings.pointMode) + ").");
            }
            if (RCSettings.disableRock > 0)
            {
                AddLineRC("Punk Rock-Throwing is disabled.");
            }
            if (RCSettings.spawnMode > 0)
            {
                AddLineRC("Custom spawn rate is on (" + RCSettings.nRate.ToString("F2") + "% Normal, " + RCSettings.aRate.ToString("F2") + "% Abnormal, " + RCSettings.jRate.ToString("F2") + "% Jumper, " + RCSettings.cRate.ToString("F2") + "% Crawler, " + RCSettings.pRate.ToString("F2") + "% Punk");
            }
            if (RCSettings.explodeMode > 0)
            {
                AddLineRC("Titan explode mode is on (" + Convert.ToString(RCSettings.explodeMode) + ").");
            }
            if (RCSettings.healthMode > 0)
            {
                AddLineRC("Titan health mode is on (" + Convert.ToString(RCSettings.healthLower) + "-" + Convert.ToString(RCSettings.healthUpper) + ").");
            }
            if (RCSettings.infectionMode > 0)
            {
                AddLineRC("Infection mode is on (" + Convert.ToString(RCSettings.infectionMode) + ").");
            }
            if (RCSettings.damageMode > 0)
            {
                AddLineRC("Minimum nape damage is on (" + Convert.ToString(RCSettings.damageMode) + ").");
            }
            if (RCSettings.moreTitans > 0)
            {
                AddLineRC("Custom titan # is on (" + Convert.ToString(RCSettings.moreTitans) + ").");
            }
            if (RCSettings.sizeMode > 0)
            {
                AddLineRC("Custom titan size is on (" + RCSettings.sizeLower.ToString("F2") + "," + RCSettings.sizeUpper.ToString("F2") + ").");
            }
            if (RCSettings.banEren > 0)
            {
                AddLineRC("Anti-Eren is on. Using Titan eren will get you kicked.");
            }
            if (RCSettings.waveModeOn == 1)
            {
                AddLineRC("Custom wave mode is on (" + Convert.ToString(RCSettings.waveModeNum) + ").");
            }
            if (RCSettings.friendlyMode > 0)
            {
                AddLineRC("Friendly-Fire disabled. PVP is prohibited.");
            }
            if (RCSettings.pvpMode > 0)
            {
                if (RCSettings.pvpMode == 1)
                {
                    AddLineRC("AHSS/Blade PVP is on (team-based).");
                }
                else if (RCSettings.pvpMode == 2)
                {
                    AddLineRC("AHSS/Blade PVP is on (FFA).");
                }
            }
            if (RCSettings.maxWave > 0)
            {
                AddLineRC("Max Wave set to " + RCSettings.maxWave.ToString());
            }
            if (RCSettings.horseMode > 0)
            {
                AddLineRC("Horses are enabled.");
            }
            if (RCSettings.ahssReload > 0)
            {
                AddLineRC("AHSS Air-Reload disabled.");
            }
            if (RCSettings.punkWaves > 0)
            {
                AddLineRC("Punk override every 5 waves enabled.");
            }
            if (RCSettings.endlessMode > 0)
            {
                AddLineRC("Endless Respawn is enabled (" + RCSettings.endlessMode.ToString() + " seconds).");
            }
            if (RCSettings.globalDisableMinimap > 0)
            {
                AddLineRC("Minimap are disabled.");
            }
            if (RCSettings.motd != string.Empty)
            {
                AddLineRC("MOTD:" + RCSettings.motd);
            }
            if (RCSettings.deadlyCannons > 0)
            {
                AddLineRC("Cannons will kill humans.");
            }
        }
            return;

        default:
            return;
        }
    }
Example #22
0
    public void OnGUI()
    {
        if (Settings.UserInterfaceSetting || !Settings.ChatUISetting || PhotonNetwork.connectionStateDetailed != PeerStates.Joined)
        {
            return;
        }

        if (Event.current.type == EventType.KeyDown)
        {
            if ((Event.current.keyCode == KeyCode.Tab || Event.current.character == '\t') && FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] != KeyCode.Tab && GUI.GetNameOfFocusedControl() != "WelcomeMessage" && GUI.GetNameOfFocusedControl() != "LevelScript" && GUI.GetNameOfFocusedControl() != "LogicScript")
            {
                Event.current.Use();
                goto Label_219C;
            }
        }
        else if (Event.current.type == EventType.KeyUp && Event.current.keyCode != KeyCode.None && Event.current.keyCode == FengGameManagerMKII.inputRC.humanKeys[InputCodeRC.chat] && GUI.GetNameOfFocusedControl() != "ChatInput" && GUI.GetNameOfFocusedControl() != "WelcomeMessage" && GUI.GetNameOfFocusedControl() != "LevelScript" && GUI.GetNameOfFocusedControl() != "LogicScript")
        {
            inputLine = string.Empty;
            GUI.FocusControl("ChatInput");
            goto Label_219C;
        }

        if (Event.current.type == EventType.KeyDown && (Event.current.keyCode == KeyCode.KeypadEnter || Event.current.keyCode == KeyCode.Return) && GUI.GetNameOfFocusedControl() != "WelcomeMessage" && GUI.GetNameOfFocusedControl() != "LevelScript" && GUI.GetNameOfFocusedControl() != "LogicScript")
        {
            if (!string.IsNullOrEmpty(inputLine))
            {
                if (inputLine == "\t")
                {
                    inputLine = string.Empty;
                    GUI.FocusControl(string.Empty);
                    return;
                }

                if (FengGameManagerMKII.RCEvents.ContainsKey("OnChatInput"))
                {
                    var key = (string)FengGameManagerMKII.RCVariableNames["OnChatInput"];
                    if (FengGameManagerMKII.stringVariables.ContainsKey(key))
                    {
                        FengGameManagerMKII.stringVariables[key] = inputLine;
                    }
                    else
                    {
                        FengGameManagerMKII.stringVariables.Add(key, inputLine);
                    }

                    ((RCEvent)FengGameManagerMKII.RCEvents["OnChatInput"]).checkEvent();
                }

                if (!inputLine.StartsWith("/"))
                {
                    var str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]).hexColor();
                    if (str2 == string.Empty)
                    {
                        str2 = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]);
                        if (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 1)
                            {
                                str2 = "<color=#00FFFF>" + str2 + "</color>";
                            }
                            else if (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]) == 2)
                            {
                                str2 = "<color=#FF00FF>" + str2 + "</color>";
                            }
                        }
                    }

                    object[] parameters = { inputLine, str2 };
                    FengGameManagerMKII.FGM.photonView.RPC("Chat", PhotonTargets.All, parameters);
                }
                else
                {
                    CommandSwitch(inputLine.Remove(0, 1).Split(' '));
                }

                inputLine = string.Empty;
                GUI.FocusControl(string.Empty);
                return;
            }

            inputLine = "\t";
            GUI.FocusControl("ChatInput");
        }

Label_219C:
        GUI.SetNextControlName(string.Empty);

        if (chatWidth != Settings.ChatWidthSetting || chatHeight != Settings.ChatHeightSetting)
        {
            SetPosition();
        }

        if (Settings.ChatBackground)
        {
            if (chatBackground == null)
            {
                chatBackground = new Texture2D(1, 1);
                chatOpacity    = 0f;
                chatBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, chatOpacity));
                chatBackground.Apply();
            }
            if (chatRect.Contains(GUIHelpers.mousePos) || GUI.GetNameOfFocusedControl() == "ChatInput" || chatFeedRect.Contains(GUIHelpers.mousePos) && Settings.ChatFeedSeparateSetting)
            {
                chatOpacity = Mathf.Lerp(chatOpacity, Settings.ChatOpacitySetting, Time.timeScale < 1f ? 0.01f : Time.deltaTime * 1.5f);
                chatBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, chatOpacity));
                chatBackground.Apply();
            }
            else if (chatOpacity != 0f)
            {
                chatOpacity = Mathf.Lerp(chatOpacity, 0f, Time.timeScale < 1f ? 0.01f : Time.deltaTime * 1.5f);
                chatBackground.SetPixel(0, 0, new Color(0f, 0f, 0f, chatOpacity));
                chatBackground.Apply();
            }

            GUI.DrawTexture(chatRect, chatBackground, ScaleMode.StretchToFill);
            if (Settings.ChatFeedSeparateSetting && Settings.ChatFeedSetting)
            {
                GUI.DrawTexture(chatFeedRect, chatBackground, ScaleMode.StretchToFill);
            }
        }


        GUILayout.BeginArea(chatRect);
        {
            var text = string.Empty;
            text = Chat.Aggregate(text, (current, t) => current + t + "\n");
            if (Chat.Count > Settings.ChatMessagesCache)
            {
                Chat.RemoveAt(0);
            }

            chatScroll = GUILayout.BeginScrollView(chatScroll);
            {
                GUILayout.FlexibleSpace();
                GUILayout.Label(text);
            }
            GUILayout.EndScrollView();
        }
        GUILayout.EndArea();

        GUILayout.BeginArea(chatInputRect);
        {
            GUILayout.BeginHorizontal();
            {
                GUI.SetNextControlName("ChatInput");
                inputLine = GUILayout.TextField(inputLine);
            }
            GUILayout.EndHorizontal();
        }
        GUILayout.EndArea();

        if (Settings.ChatFeedSeparateSetting)
        {
            if (!Settings.ChatFeedSetting && ChatFeed.Count > 0)
            {
                ChatFeed.Clear();
            }

            GUILayout.BeginArea(chatFeedRect);
            {
                var text = string.Empty;
                text = ChatFeed.Aggregate(text, (current, t) => current + t + "\n");


                if (ChatFeed.Count > Settings.ChatMessagesCache)
                {
                    ChatFeed.RemoveAt(0);
                }

                chatFeedScroll = GUILayout.BeginScrollView(chatFeedScroll);
                {
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(text);
                }
                GUILayout.EndScrollView();
            }
            GUILayout.EndArea();
        }
    }