Beispiel #1
0
        private static void Prefix(Player __instance, DamageInfo di)
        {
            if (!CTF.IsActiveServer)
            {
                return;
            }

            if (!CTF.PlayerHasFlag.TryGetValue(__instance.netId, out int flag))
            {
                return;
            }

            CTF.NotifyAll(CTFEvent.CARRIER_DIED, null, __instance, flag);

            if (di.owner == null)
            {
                return;
            }

            Player attacker = di.owner.GetComponent <Player>();

            if (attacker == null || attacker.netId == __instance.netId)
            {
                return;
            }

            ServerStatLog.AddFlagEvent(attacker, "CarrierKill", MPTeams.AllTeams[flag]);
        }
Beispiel #2
0
        private static void LogEvent(CTFEvent evt, Player player, MpTeam flag)
        {
            switch (evt)
            {
            case CTFEvent.RETURN:
                ServerStatLog.AddFlagEvent(player, "Return", flag);
                break;

            case CTFEvent.PICKUP:
                ServerStatLog.AddFlagEvent(player, "Pickup", flag);
                break;

            case CTFEvent.SCORE:
                ServerStatLog.AddFlagEvent(player, "Capture", flag);
                break;
            }
        }