Beispiel #1
0
        private void AddLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
        {
            string strFriendlyContextName = lvRequestedContext.Context.ToString();

            if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All)
            {
                strFriendlyContextName = this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.all");
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode)
            {
                strFriendlyContextName = this.Client.GetFriendlyGamemode(lvRequestedContext.Context.ContextTarget);
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.Level)
            {
                strFriendlyContextName = this.Client.GetFriendlyMapname(lvRequestedContext.Context.ContextTarget);
            }

            ListViewItem newItem = this.CreateVariableEffectItem(lvRequestedContext.Context.ToString(), strFriendlyContextName, this.Font);

            if (this.lsvEvaluatedEffect.Items.ContainsKey(newItem.Name) == false)
            {
                this.lsvEvaluatedEffect.Items.Add(newItem);
            }

            this.SetLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);
        }
Beispiel #2
0
        private void SetLevelVariable(LevelVariable levelVar)
        {
            object value = null;

            if (String.Compare(levelVar.VariableName, "vehiclesdisabled", true) == 0)
            {
                value = levelVar.GetValue <bool>(false);
            }
            else
            {
                value = levelVar.GetValue <decimal>(100);
            }

            string responseKey = String.Format("levelvars.set {0}", levelVar.VariableName.ToLower());

            this.OnSettingResponse(responseKey, value, true);

            if (this.AsyncSettingControls.ContainsKey(responseKey) == true)
            {
                foreach (Control enableControl in this.AsyncSettingControls[responseKey].ma_ctrlEnabledInputs)
                {
                    if ((enableControl is Label && !(enableControl is LinkLabel)) || enableControl is CheckBox)
                    {
                        enableControl.ForeColor = Color.LightSeaGreen;
                        enableControl.Font      = new Font(this.Font, FontStyle.Bold);
                    }
                }
            }
        }
Beispiel #3
0
        private bool isApplicableContext(LevelVariable lvRequestedContext)
        {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            bool returnIsApplicableContext = false;

            if (lvRequestedContext.Context.CompareTo(selectedContext) == 0)
            {
                returnIsApplicableContext = true;
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All)
            {
                returnIsApplicableContext = true;
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode &&
                     selectedContext.ContextType == LevelVariableContextType.Level)
            {
                string targetPlaylist = this.Client.GetPlaylistByMapname(selectedContext.ContextTarget);

                if (String.Compare(lvRequestedContext.Context.ContextTarget, targetPlaylist, true) == 0)
                {
                    returnIsApplicableContext = true;
                }
            }

            return(returnIsApplicableContext);
        }
        private void ValidateAddLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
        {
            this.InvokeIfRequired(() =>
            {
                LevelVariableContext selectedContext = this.GetSelectedContext();

                if (this.isApplicableContext(lvRequestedContext) == true)
                {
                    this.AddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);

                    if (lvRequestedContext.Context.CompareTo(selectedContext) == 0)
                    {
                        if (this.lsvEvaluatedEffect.Items.ContainsKey("totalEvaluatedEffects") == false)
                        {
                            this.lsvEvaluatedEffect.Items.Add(this.CreateVariableEffectItem("totalEvaluatedEffects", this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.totalEvaluatedEffects"), new Font(this.Font, FontStyle.Bold)));
                        }

                        this.UpdateTotalEffects();
                    }
                }

                foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns)
                {
                    col.Width = -2;
                }
            });
        }
Beispiel #5
0
 public override void OnLevelVariablesList(LevelVariable requestedContext, List <LevelVariable> returnedValues)
 {
     base.OnLevelVariablesList(requestedContext, returnedValues);
     Output.Information("{0}: Request VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesList", requestedContext.VariableName, requestedContext.RawValue, requestedContext.Context.ContextType, requestedContext.Context.ContextTarget);
     foreach (var returnedValue in returnedValues)
     {
         Output.Information("{0}: Return  VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesList", returnedValue.VariableName, returnedValue.RawValue, returnedValue.Context.ContextType, returnedValue.Context.ContextTarget);
     }
 }
Beispiel #6
0
        private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
        {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0)
            {
                this.SetCurrentSelectedLevelVariables(lstReturnedValues);
            }

            this.ValidateAddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);
        }
Beispiel #7
0
        private void m_prcClient_LevelVariablesClear(FrostbiteClient sender, LevelVariable lvRequestedContext)
        {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0)
            {
                this.GetSelectedLevelVariables();

                this.OnSettingResponse("levelvars.clear", true, true);
            }
        }
Beispiel #8
0
 protected virtual void Client_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
 {
     foreach (LevelVariable variable in lstReturnedValues)
     {
         if (variable.Context.ContextTarget.Length > 0)
         {
             this.AppendSetting(String.Format("levelVars.set {0} {1} {2}", variable.Context.ContextType.ToString().ToLower(), variable.Context.ContextTarget, variable.VariableName), variable.RawValue);
         }
         else
         {
             this.AppendSetting(String.Format("levelVars.set {0} {1}", variable.Context.ContextType.ToString().ToLower(), variable.VariableName), variable.RawValue);
         }
     }
 }
Beispiel #9
0
        private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext)
        {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            // If they are an exact match (we or another account is editing what we are editing)
            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0)
            {
                this.SetLevelVariable(lvRequestedContext);
            }

            // If the variable applies to our currently editing context.
            if (this.isApplicableContext(lvRequestedContext) == true)
            {
                this.SetLevelVariablesToEffects(lvRequestedContext, new List <LevelVariable>()
                {
                    lvRequestedContext
                });
            }
        }
Beispiel #10
0
        private void SetLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
        {
            if (this.lsvEvaluatedEffect.Items.ContainsKey(lvRequestedContext.Context.ToString()) == true)
            {
                ListViewItem item = this.lsvEvaluatedEffect.Items[lvRequestedContext.Context.ToString()];
                foreach (LevelVariable variable in lstReturnedValues)
                {
                    if (item.SubItems.ContainsKey(variable.VariableName) == true)
                    {
                        item.SubItems[variable.VariableName].Text = variable.RawValue;
                    }
                }

                foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns)
                {
                    col.Width = -2;
                }

                this.UpdateTotalEffects();
            }
        }
 void Client_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues)
 {
     foreach (LevelVariable variable in lstReturnedValues) {
         if (variable.Context.ContextTarget.Length > 0) {
             this.AppendSetting(String.Format("levelVars.set {0} {1} {2}", variable.Context.ContextType.ToString().ToLower(), variable.Context.ContextTarget, variable.VariableName), variable.RawValue);
         }
         else {
             this.AppendSetting(String.Format("levelVars.set {0} {1}", variable.Context.ContextType.ToString().ToLower(), variable.VariableName), variable.RawValue);
         }
     }
 }
        private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext) {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            // If they are an exact match (we or another account is editing what we are editing)
            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) {
                this.SetLevelVariable(lvRequestedContext);
            }

            // If the variable applies to our currently editing context.
            if (this.isApplicableContext(lvRequestedContext) == true) {
                this.SetLevelVariablesToEffects(lvRequestedContext, new List<LevelVariable>() { lvRequestedContext });
            }
        }
Beispiel #13
0
 public virtual void OnLevelVariablesSet(LevelVariable requestedContext)
 {
 }
Beispiel #14
0
 public void OnLevelVariablesClear(LevelVariable lvRequestedContext)
 {
 }
Beispiel #15
0
 public void OnLevelVariablesGet(LevelVariable lvRequestedContext, LevelVariable lvReturnedValue)
 {
 }
Beispiel #16
0
 private void m_prcClient_LevelVariablesGet(FrostbiteClient sender, LevelVariable lvRequestedContext, LevelVariable lvReturnedValue) {
     InvokeOnAllEnabled("OnLevelVariablesGet", new object[] {lvRequestedContext, lvReturnedValue});
 }
        private void SetLevelVariable(LevelVariable levelVar) {

            object value = null;

            if (String.Compare(levelVar.VariableName, "vehiclesdisabled", true) == 0) {
                value = levelVar.GetValue<bool>(false);
            }
            else {
                value = levelVar.GetValue<decimal>(100);
            }

            string responseKey = String.Format("levelvars.set {0}", levelVar.VariableName.ToLower());

            this.OnSettingResponse(responseKey, value, true);

            if (this.AsyncSettingControls.ContainsKey(responseKey) == true) {
                foreach (Control enableControl in this.AsyncSettingControls[responseKey].ma_ctrlEnabledInputs) {
                    if ((enableControl is Label && !(enableControl is LinkLabel)) || enableControl is CheckBox) {
                        enableControl.ForeColor = Color.LightSeaGreen;
                        enableControl.Font = new Font(this.Font, FontStyle.Bold);
                    }
                }
            }
        }
Beispiel #18
0
        public void OnLevelVariablesSet(LevelVariable lvRequestedContext) {

        }
Beispiel #19
0
        public void OnLevelVariablesGet(LevelVariable lvRequestedContext, LevelVariable lvReturnedValue) {

        }
Beispiel #20
0
 private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {
     this.InvokeOnAllEnabled("OnLevelVariablesList", new object[] { lvRequestedContext, lstReturnedValues });
 }
Beispiel #21
0
 public override void OnLevelVariablesEvaluate(LevelVariable requestedContext, LevelVariable returnedValue)
 {
     base.OnLevelVariablesEvaluate(requestedContext, returnedValue);
     Output.Information("{0}: Request VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesEvaluate", requestedContext.VariableName, requestedContext.RawValue, requestedContext.Context.ContextType, requestedContext.Context.ContextTarget);
     Output.Information("{0}: Return  VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesEvaluate", returnedValue.VariableName, returnedValue.RawValue, returnedValue.Context.ContextType, returnedValue.Context.ContextTarget);
 }
Beispiel #22
0
        protected virtual void DispatchLevelVarsEvaluateResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket)
        {
            if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) {

                LevelVariable request = new LevelVariable(new LevelVariableContext(String.Empty, String.Empty), cpRequestPacket.Words[1], cpRecievedPacket.Words[1]);

                if (this.LevelVariablesEvaluate != null) {
                    FrostbiteConnection.RaiseEvent(this.LevelVariablesEvaluate.GetInvocationList(), this, request);
                }
            }
        }
Beispiel #23
0
 public virtual void OnLevelVariablesGet(LevelVariable requestedContext, LevelVariable returnedValue)
 {
 }
Beispiel #24
0
        protected virtual void DispatchLevelVarsEvaluateResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) {
            if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) {
                var request = new LevelVariable(new LevelVariableContext(String.Empty, String.Empty), cpRequestPacket.Words[1], cpRecievedPacket.Words[1]);

                if (LevelVariablesEvaluate != null) {
                    this.LevelVariablesEvaluate(this, request, null);
                }
            }
        }
Beispiel #25
0
 public virtual void OnLevelVariablesSet(LevelVariable requestedContext) { }
Beispiel #26
0
 private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext) {
     InvokeOnAllEnabled("OnLevelVariablesSet", new object[] {lvRequestedContext});
 }
Beispiel #27
0
 public void OnLevelVariablesList(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues)
 {
 }
Beispiel #28
0
        public void OnLevelVariablesClear(LevelVariable lvRequestedContext) {

        }
        private void ValidateAddLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            if (this.isApplicableContext(lvRequestedContext) == true) {
                this.AddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);

                if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) {

                    if (this.lsvEvaluatedEffect.Items.ContainsKey("totalEvaluatedEffects") == false) {
                        this.lsvEvaluatedEffect.Items.Add(this.CreateVariableEffectItem("totalEvaluatedEffects", this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.totalEvaluatedEffects"), new Font(this.Font, FontStyle.Bold)));
                    }

                    this.UpdateTotalEffects();
                }
            }

            foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) {
                col.Width = -2;
            }
        }
Beispiel #30
0
        public void OnLevelVariablesList(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {

        }
        private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) {

                this.SetCurrentSelectedLevelVariables(lstReturnedValues);
            }

            this.ValidateAddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);
        }
Beispiel #32
0
 public void OnLevelVariablesSet(LevelVariable lvRequestedContext)
 {
 }
        private void m_prcClient_LevelVariablesClear(FrostbiteClient sender, LevelVariable lvRequestedContext) {

            LevelVariableContext selectedContext = this.GetSelectedContext();

            if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) {
                this.GetSelectedLevelVariables();

                this.OnSettingResponse("levelvars.clear", true, true);
            }
        }
        private void SetLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {

            if (this.lsvEvaluatedEffect.Items.ContainsKey(lvRequestedContext.Context.ToString()) == true) {
                ListViewItem item = this.lsvEvaluatedEffect.Items[lvRequestedContext.Context.ToString()];
                foreach (LevelVariable variable in lstReturnedValues) {
                    if (item.SubItems.ContainsKey(variable.VariableName) == true) {
                        item.SubItems[variable.VariableName].Text = variable.RawValue;
                    }
                }

                foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) {
                    col.Width = -2;
                }

                this.UpdateTotalEffects();
            }
        }
Beispiel #35
0
 public virtual void OnLevelVariablesList(LevelVariable requestedContext, List <LevelVariable> returnedValues)
 {
 }
Beispiel #36
0
 public virtual void OnLevelVariablesList(LevelVariable requestedContext, List<LevelVariable> returnedValues) { }
        private void AddLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) {

            string strFriendlyContextName = lvRequestedContext.Context.ToString();

            if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) {
                strFriendlyContextName = this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.all");
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode) {
                strFriendlyContextName = this.Client.GetFriendlyGamemode(lvRequestedContext.Context.ContextTarget);
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.Level) {
                strFriendlyContextName = this.Client.GetFriendlyMapname(lvRequestedContext.Context.ContextTarget);
            }

            ListViewItem newItem = this.CreateVariableEffectItem(lvRequestedContext.Context.ToString(), strFriendlyContextName, this.Font);

            if (this.lsvEvaluatedEffect.Items.ContainsKey(newItem.Name) == false) {
                this.lsvEvaluatedEffect.Items.Add(newItem);
            }

            this.SetLevelVariablesToEffects(lvRequestedContext, lstReturnedValues);
        }
Beispiel #38
0
 public virtual void OnLevelVariablesGet(LevelVariable requestedContext, LevelVariable returnedValue) { }
        private bool isApplicableContext(LevelVariable lvRequestedContext) {
            LevelVariableContext selectedContext = this.GetSelectedContext();

            bool returnIsApplicableContext = false;

            if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) {
                returnIsApplicableContext = true;
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) {
                returnIsApplicableContext = true;
            }
            else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode &&
                selectedContext.ContextType == LevelVariableContextType.Level) {

                string targetPlaylist = this.Client.GetPlaylistByMapname(selectedContext.ContextTarget);

                if (String.Compare(lvRequestedContext.Context.ContextTarget, targetPlaylist, true) == 0) {
                    returnIsApplicableContext = true;
                }
            }

            return returnIsApplicableContext;
        }