Beispiel #1
0
        static void EndTO()
        {
            phase = TOPhases.None;

            ArenaClient.ForEach(c =>
            {
                ArenaClient client = (ArenaClient)c;
                if (client.Team != null || client.BaseClient.SpecWorld == world.BaseWorld)
                {
                    client.Spectate();
                }

                client.TODeaths = client.TOKills = client.TOScore = 0;
            });
            teams.Clear();

            activeTODef = null;
            world       = null;

            var stream = ArenaClient.GetScriptMessageStream();

            stream.Write((byte)ScriptMessages.TOEnd);
            ArenaClient.ForEach(c => c.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered));

            CheckStartTO();
        }
Beispiel #2
0
        public static void StartTO(TODef def)
        {
            if (def == null)
            {
                return;
            }

            if (activeTODef != null)
            {
                ArenaClient.ForEach(c =>
                {
                    ArenaClient client = (ArenaClient)c;
                    if (client.Team != null || client.BaseClient.SpecWorld == world.BaseWorld)
                    {
                        client.Spectate();
                    }

                    client.TODeaths = client.TOKills = client.TOScore = 0;
                });
                teams.Clear();

                var stream = ArenaClient.GetScriptMessageStream();
                stream.Write((byte)ScriptMessages.TOEnd);
                ArenaClient.ForEach(c => c.SendScriptMessage(stream, NetPriority.Low, NetReliability.ReliableOrdered));
            }

            world = WorldInst.List.Find(w => w.Path == def.WorldPath);
            if (world == null)
            {
                return;
            }

            activeTODef = def;
            foreach (var teamDef in activeTODef.Teams)
            {
                teams.Add(new TOTeamInst(teamDef));
            }

            PhaseWarmup();
        }