示例#1
0
    private static string[] generateEndStrings(FengGameManagerMKII gm)
    {
        string[] res = new string[6];
        foreach (PhotonPlayer player2 in PhotonNetwork.playerList)
        {
            if (player2 != null)
            {
                res[0] += player2.customProperties[PhotonPlayerProperty.name] + "\n";
                res[1] += player2.customProperties[PhotonPlayerProperty.kills] + "\n";
                res[2] += player2.customProperties[PhotonPlayerProperty.deaths] + "\n";
                res[3] += player2.customProperties[PhotonPlayerProperty.max_dmg] + "\n";
                res[4] += player2.customProperties[PhotonPlayerProperty.total_dmg] + "\n";
            }
        }

        if (IN_GAME_MAIN_CAMERA.gamemode == GAMEMODE.SURVIVE_MODE)
        {
            FieldInfo waveField = gm.GetType().GetField("highestwave", BindingFlags.NonPublic | BindingFlags.Instance);
            res[5] = "Highest Wave : " + waveField.GetValue(gm);
        }
        else
        {
            FieldInfo humanScoreField = gm.GetType().GetField("humanScore", BindingFlags.NonPublic | BindingFlags.Instance);
            FieldInfo titanScoreField = gm.GetType().GetField("titanScore", BindingFlags.NonPublic | BindingFlags.Instance);
            res[5] = string.Concat(new object[] { "Humanity ", humanScoreField.GetValue(gm), " : Titan ", titanScoreField.GetValue(gm) });
        }

        return(res);
    }
示例#2
0
 private void updateLosingFieldInGM(FengGameManagerMKII gm)
 {
     lock (gm){
         FieldInfo isLosingField = gm.GetType().GetField("isLosing", BindingFlags.Instance | BindingFlags.NonPublic);
         isLosingField.SetValue(gm, false);
     }
 }
示例#3
0
    private void doTime(string[] args, FengGameManagerMKII gm)
    {
        //set time <time>
        //set time -1
        FieldInfo serverTimeField = gm.GetType().GetField("timeTotalServer", BindingFlags.NonPublic | BindingFlags.Instance);
        float     time            = float.Parse(args[1]);

        if (time >= 0)
        {
            serverTimeField.SetValue(gm, time);
        }
        else
        {
            FieldInfo timeField = gm.GetType().GetField("time", BindingFlags.NonPublic | BindingFlags.Instance);
            int       val       = (int)timeField.GetValue(gm);
            serverTimeField.SetValue(gm, (float)val);
        }
    }
示例#4
0
    public bool cmd(string[] args, FengGameManagerMKII gm)
    {
        if (args.Length == 0)
        {
            FieldInfo lastCharacterField = gm.GetType().GetField("myLastHero", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase);
            ModMain.instance.log("MyLastHero: " + lastCharacterField.GetValue(gm));

            gm.SpawnPlayer((string)lastCharacterField.GetValue(gm), "playerRespawn");
            return(true);
        }
        else if (args[0].Equals("*"))
        {
            ModMain.instance.getGameManager().photonView.RPC("respawnHeroInNewRound", PhotonTargets.All, new object[0]);
            return(true);
        }
        else
        {
            PhotonPlayer target = null;
            foreach (PhotonPlayer p in PhotonNetwork.playerList)
            {
                if ("" + p.ID == args[0])
                {
                    target = p;
                    break;
                }
            }

            if (target != null)
            {
                gm.photonView.RPC("respawnHeroInNewRound", target, new object[0]);
                return(true);
            }

            return(false);
        }
    }
示例#5
0
    private void kickPlayer(string name, FengGameManagerMKII gm)
    {
        MethodInfo mInfo = gm.GetType().GetMethod("kickPhotonPlayer", BindingFlags.Instance | BindingFlags.NonPublic);

        mInfo.Invoke(gm, new object[] { name });
    }
示例#6
0
    private void setHeroField(FengGameManagerMKII gm, int i)
    {
        FieldInfo lastCharacterField = gm.GetType().GetField("myLastHero", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase);

        lastCharacterField.SetValue(gm, "SET " + i);
    }