示例#1
0
        public static void ScheduleCommand(ScheduledCommand cmd)
        {
            MpLog.Log($"Cmd: {cmd.type}, faction: {cmd.factionId}, map: {cmd.mapId}, ticks: {cmd.ticks}");
            cachedMapCmds.GetOrAddNew(cmd.mapId).Add(cmd);

            if (Current.ProgramState != ProgramState.Playing)
            {
                return;
            }

            if (cmd.mapId == ScheduledCommand.Global)
            {
                Multiplayer.WorldComp.cmds.Enqueue(cmd);
            }
            else
            {
                cmd.GetMap()?.AsyncTime().cmds.Enqueue(cmd);
            }
        }