Exemple #1
0
 protected Sink(ISinkOwner owner, string name, int order) : base(owner)
 {
     m_Levels = new LevelsList();
     Name     = name.IsNullOrWhiteSpace() ? "{0}.{1}".Args(GetType().Name, FID.Generate().ID.ToString("X")) : name;
     m_Order  = order;
     ((ISinkOwnerRegistration)owner).Register(this);
 }
Exemple #2
0
        /// <summary>
        /// Override to perform derivative-specific configuration
        /// </summary>
        protected virtual void DoConfigure(IConfigSectionNode node)
        {
            var expr = node.AttrByName(CONFIG_FILTER_ATTR).Value;

            if (!string.IsNullOrWhiteSpace(expr))
            {
                m_Filter = new MessageFilterExpression(expr);
            }

            m_Levels = ParseLevels(node.AttrByName(CONFIG_LEVELS_ATTR).Value);
        }
Exemple #3
0
        public void ApplyToServer()
        {
            ZombieGameProps.ChangeLevels = ChangeLevels;
            string list = IgnoredLevelsList.Replace(" ", "");

            if (list == "")
            {
                ZombieGameProps.IgnoredLevelList = new List <string>();
            }
            else
            {
                ZombieGameProps.IgnoredLevelList = new List <string>(list.Replace(" ", "").Split(','));
            }

            list = LevelsList.Replace(" ", "");
            if (list == "")
            {
                ZombieGameProps.LevelList = new List <string>();
            }
            else
            {
                ZombieGameProps.LevelList = new List <string>(list.Replace(" ", "").Split(','));
            }
            ZombieGameProps.SaveLevelBlockchanges = SaveLevelChanges;
            ZombieGameProps.IgnorePersonalWorlds  = IgnorePersonalWorlds;

            ZombieGameProps.NoPillaring      = !Pillaring;
            ZombieGameProps.NoRespawn        = !Respawning;
            ZombieGameProps.SetMainLevel     = SetMainLevel;
            ZombieGameProps.StartImmediately = StartImmediately;

            ZombieGameProps.MaxMoveDistance       = MaxMoveDistance;
            ZombieGameProps.HitboxPrecision       = HitboxPrecision;
            ZombieGameProps.IncludeMapInHeartbeat = IncludeMapInHeartbeat;

            ZombieGameProps.ZombieName  = Name.Trim();
            ZombieGameProps.ZombieModel = Model.Trim();
            if (ZombieGameProps.ZombieModel == "")
            {
                ZombieGameProps.ZombieModel = "zombie";
            }
            ZombieGameProps.InvisibilityDuration       = InvisibilityDuration;
            ZombieGameProps.InvisibilityPotions        = InvisibilityPotions;
            ZombieGameProps.ZombieInvisibilityDuration = ZInvisibilityDuration;
            ZombieGameProps.ZombieInvisibilityPotions  = ZInvisibilityPotions;

            ZombieGameProps.ReviveChance         = Chance;
            ZombieGameProps.ReviveNoTime         = InsufficientTime;
            ZombieGameProps.ReviveNoTimeMessage  = InsufficientTimeMessage;
            ZombieGameProps.ReviveTooSlow        = ExpiryTime;
            ZombieGameProps.ReviveFailureMessage = FailureMessage;
            ZombieGameProps.ReviveSuccessMessage = SuccessMessage;
        }
 public PlanFormDisplay()
 {
     LevelsList = Enumerable.Range(4, 3).Select(x => new SelectListItem {
         Text = $"{x}", Value = $"{x}"
     }).ToList();
     LevelsList.Insert(0, new SelectListItem {
         Text = "Alle Klassen", Value = "0", Selected = true
     });
     Days = Globals.Days.Select(x => new Day
     {
         Name = x
     }).ToList();
 }
        public void ApplyToServer()
        {
            ZSConfig.ChangeLevels = ChangeLevels;
            string list = IgnoredLevelsList.Replace(" ", "");

            if (list.Length == 0)
            {
                ZSConfig.IgnoredLevelList = new List <string>();
            }
            else
            {
                ZSConfig.IgnoredLevelList = new List <string>(list.Replace(" ", "").Split(','));
            }

            list = LevelsList.Replace(" ", "");
            if (list.Length == 0)
            {
                ZSConfig.LevelList = new List <string>();
            }
            else
            {
                ZSConfig.LevelList = new List <string>(list.Replace(" ", "").Split(','));
            }

            ZSConfig.NoPillaring      = !Pillaring;
            ZSConfig.SetMainLevel     = SetMainLevel;
            ZSConfig.StartImmediately = StartImmediately;

            ZSConfig.MaxMoveDistance       = MaxMoveDistance;
            ZSConfig.HitboxPrecision       = HitboxPrecision;
            ZSConfig.IncludeMapInHeartbeat = IncludeMapInHeartbeat;

            ZSConfig.ZombieName  = Name.Trim();
            ZSConfig.ZombieModel = Model.Trim();
            if (ZSConfig.ZombieModel.Length == 0)
            {
                ZSConfig.ZombieModel = "zombie";
            }
            ZSConfig.InvisibilityDuration       = InvisibilityDuration;
            ZSConfig.InvisibilityPotions        = InvisibilityPotions;
            ZSConfig.ZombieInvisibilityDuration = ZInvisibilityDuration;
            ZSConfig.ZombieInvisibilityPotions  = ZInvisibilityPotions;

            ZSConfig.ReviveChance         = Chance;
            ZSConfig.ReviveNoTime         = InsufficientTime;
            ZSConfig.ReviveNoTimeMessage  = InsufficientTimeMessage;
            ZSConfig.ReviveTooSlow        = ExpiryTime;
            ZSConfig.ReviveFailureMessage = FailureMessage;
            ZSConfig.ReviveSuccessMessage = SuccessMessage;
        }
Exemple #6
0
        /// <summary>
        /// Parses levels into a tuple list of level ranges
        /// </summary>
        /// <param name="levels">String representation of levels using ',' or ';' or '|'
        /// as range group delimiters, and '-' as range indicators.  If first/second bound of the range
        /// is empty, the min/max value of that bound is assumed.
        /// Examples: "Debug-DebugZ | Error", "-DebugZ | Info | Warning", "Info-", "DebugB-DebugC, Error"</param>
        public static LevelsList ParseLevels(string levels)
        {
            var result = new LevelsList();

            if (!string.IsNullOrWhiteSpace(levels))
            {
                foreach (var p in levels.Split(',', ';', '|'))
                {
                    var minmax = p.Split(new char[] { '-' }, 2).Select(s => s.Trim()).ToArray();

                    if (minmax.Length == 0)
                    {
                        throw new NFXException(StringConsts.INVALID_ARGUMENT_ERROR + "levels: " + p);
                    }

                    MessageType min, max;

                    if (string.IsNullOrWhiteSpace(minmax[0]))
                    {
                        min = MessageType.Debug;
                    }
                    else if (!Enum.TryParse(minmax[0], true, out min))
                    {
                        throw new NFXException(StringConsts.INVALID_ARGUMENT_ERROR +
                                               "levels: {0} (error parsing: {1})".Args(p, minmax[0]));
                    }

                    if (minmax.Length < 2)
                    {
                        max = min;
                    }
                    else if (string.IsNullOrWhiteSpace(minmax[1]))
                    {
                        max = MessageType.CatastrophicError;
                    }
                    else if (!Enum.TryParse(minmax[1], true, out max))
                    {
                        throw new NFXException(StringConsts.INVALID_ARGUMENT_ERROR +
                                               "levels: {0} (error parsing: {1})".Args(p, minmax[1]));
                    }

                    result.Add(new Tuple <MessageType, MessageType>(min, max));
                }
            }

            return(result);
        }
Exemple #7
0
        public void ApplyToServer()
        {
            ZombieGame.ChangeLevels = ChangeLevels;
            string list = IgnoredLevelsList.Replace(" ", "");

            if (list == "")
            {
                ZombieGame.IgnoredLevelList = new List <string>();
            }
            else
            {
                ZombieGame.IgnoredLevelList = new List <string>(list.Replace(" ", "").Split(','));
            }

            list = LevelsList.Replace(" ", "");
            if (list == "")
            {
                ZombieGame.LevelList = new List <string>();
            }
            else
            {
                ZombieGame.LevelList = new List <string>(list.Replace(" ", "").Split(','));
            }
            ZombieGame.SaveLevelBlockchanges = SaveZombieLevelChanges;
            ZombieGame.IgnorePersonalWorlds  = IgnorePersonalWorlds;

            ZombieGame.noPillaring      = !Pillaring;
            ZombieGame.noRespawn        = !Respawning;
            ZombieGame.SetMainLevel     = SetMainLevel;
            ZombieGame.StartImmediately = StartImmediately;

            ZombieGame.MaxMoveDistance       = MaxMoveDistance;
            ZombieGame.HitboxPrecision       = HitboxPrecision;
            ZombieGame.IncludeMapInHeartbeat = IncludeMapInHeartbeat;

            ZombieGame.ZombieName  = Name.Trim();
            ZombieGame.ZombieModel = Model.Trim();
            if (ZombieGame.ZombieModel == "")
            {
                ZombieGame.ZombieModel = "zombie";
            }
            ZombieGame.InvisibilityDuration = InvisibilityDuration;
            ZombieGame.InvisibilityPotions  = InvisibilityPotions;
        }
Exemple #8
0
    public void SetValues(LevelsList levels)
    {
        m_levelsListObj = levels;

        //SelectLevel(0);
        Answer ansRus = new Answer("", AnswerLang.Russian);
        Answer ansEng = new Answer("", AnswerLang.English);

        m_currentLevelAnswer    = new Answer[2];
        m_currentLevelAnswer[0] = ansRus;
        m_currentLevelAnswer[1] = ansEng;

        SetLevelOptionsString();

        if (m_levelsListObj.m_levels.Count > 0)
        {
            SelectLevel(0);
        }
    }
Exemple #9
0
 public Destination(string name)
 {
     m_Name   = name;
     m_Levels = new LevelsList();
 }
Exemple #10
0
 internal Sink(ISinkOwner owner, bool _) : base(owner)
 {
     m_Levels = new LevelsList();
     //this overload purposely does not do registration with owner
 }
Exemple #11
0
 private void OnEnable()
 {
     m_levels = (LevelsList)target;
 }
Exemple #12
0
 public Sink(string name)
 {
     m_Name   = name;
     m_Levels = new LevelsList();
 }
Exemple #13
0
        public Map()
        {
            LevelsList levelsList = new LevelsList();

            levelsList.PlayLevel(Stats.Player.ProgressLevel);
        }