diff --git a/Intersect (Core)/Config/Options.cs b/Intersect (Core)/Config/Options.cs index c3ad1b7c22..40e9cb474f 100644 --- a/Intersect (Core)/Config/Options.cs +++ b/Intersect (Core)/Config/Options.cs @@ -50,6 +50,8 @@ public class Options [JsonProperty("Player")] public PlayerOptions PlayerOpts = new PlayerOptions(); + [JsonProperty("Party")] public PartyOptions PartyOpts = new PartyOptions(); + [JsonProperty("Security")] public SecurityOptions SecurityOpts = new SecurityOptions(); public SmtpSettings SmtpSettings = new SmtpSettings(); @@ -79,9 +81,13 @@ public class Options public static int RequestTimeout => Instance.PlayerOpts.RequestTimeout; - public static int TradeRange => Instance.PlayerOpts.TradeRange; + public static int PartyInviteRange => Instance.PartyOpts.InviteRange; + + public static int PartySharedXpRange => Instance.PartyOpts.SharedXpRange; - public static int PartyRange => Instance.PlayerOpts.PartyRange; + public static int PartyStartCommonEventRange => Instance.PartyOpts.NpcDeathCommonEventStartRange; + + public static int TradeRange => Instance.PlayerOpts.TradeRange; public static int WeaponIndex => Instance.EquipmentOpts.WeaponSlot; diff --git a/Intersect (Core)/Config/PartyOptions.cs b/Intersect (Core)/Config/PartyOptions.cs new file mode 100644 index 0000000000..5aaf2894b3 --- /dev/null +++ b/Intersect (Core)/Config/PartyOptions.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Intersect.Config +{ + public class PartyOptions + { + + public int InviteRange = 40; + + public int SharedXpRange = 40; + + public int NpcDeathCommonEventStartRange = 0; + + } +} diff --git a/Intersect (Core)/Config/PlayerOptions.cs b/Intersect (Core)/Config/PlayerOptions.cs index 7e5c5ca66f..91aa3e8657 100644 --- a/Intersect (Core)/Config/PlayerOptions.cs +++ b/Intersect (Core)/Config/PlayerOptions.cs @@ -18,8 +18,6 @@ public class PlayerOptions public int MaxStat = 255; - public int PartyRange = 80; - public int RequestTimeout = 300000; public int TradeRange = 6; diff --git a/Intersect (Core)/Crypto/RsaUtils.cs b/Intersect (Core)/Crypto/RsaUtils.cs deleted file mode 100644 index 7294c7faee..0000000000 --- a/Intersect (Core)/Crypto/RsaUtils.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Intersect.Crypto -{ - - public static class RsaUtils - { - - } - -} diff --git a/Intersect (Core)/Enums/SwitchVariableTypes.cs b/Intersect (Core)/Enums/SwitchVariableTypes.cs index 73a2b55483..ebba45a7ed 100644 --- a/Intersect (Core)/Enums/SwitchVariableTypes.cs +++ b/Intersect (Core)/Enums/SwitchVariableTypes.cs @@ -23,6 +23,8 @@ public enum VariableTypes } + //Should properly seperate static value, player & global vars into a seperate enum. + //But technical debt :/ public enum VariableMods { @@ -50,6 +52,29 @@ public enum VariableMods Replace, + Multiply, + + MultiplyPlayerVar, + + MultiplyGlobalVar, + + Divide, + + DividePlayerVar, + + DivideGlobalVar, + + LeftShift, + + LeftShiftPlayerVar, + + LeftShiftGlobalVar, + + RightShift, + + RightShiftPlayerVar, + + RightShiftGlobalVar } public enum VariableComparators diff --git a/Intersect (Core)/GameObjects/Events/EventMoveRoute.cs b/Intersect (Core)/GameObjects/Events/EventMoveRoute.cs index f200ec51b0..fbc597cc23 100644 --- a/Intersect (Core)/GameObjects/Events/EventMoveRoute.cs +++ b/Intersect (Core)/GameObjects/Events/EventMoveRoute.cs @@ -8,11 +8,6 @@ namespace Intersect.GameObjects.Events public class EventMoveRoute { - - public EventMoveRoute() - { - } - public List Actions { get; set; } = new List(); public bool IgnoreIfBlocked { get; set; } diff --git a/Intersect (Core)/GameObjects/Maps/MapAttribute.cs b/Intersect (Core)/GameObjects/Maps/MapAttribute.cs index 1ba68866bb..2d8cc51d22 100644 --- a/Intersect (Core)/GameObjects/Maps/MapAttribute.cs +++ b/Intersect (Core)/GameObjects/Maps/MapAttribute.cs @@ -9,11 +9,6 @@ namespace Intersect.GameObjects.Maps public abstract class MapAttribute { - - public MapAttribute() - { - } - public abstract MapAttributes Type { get; } public static MapAttribute CreateAttribute(MapAttributes type) diff --git a/Intersect (Core)/Intersect (Core).csproj b/Intersect (Core)/Intersect (Core).csproj index c6f3dd3c68..faa4aba3aa 100644 --- a/Intersect (Core)/Intersect (Core).csproj +++ b/Intersect (Core)/Intersect (Core).csproj @@ -192,6 +192,7 @@ + @@ -219,7 +220,6 @@ - diff --git a/Intersect (Core)/Logging/Formatting/DefaultFormatter.cs b/Intersect (Core)/Logging/Formatting/DefaultFormatter.cs index de6aab053e..578c3f7c05 100644 --- a/Intersect (Core)/Logging/Formatting/DefaultFormatter.cs +++ b/Intersect (Core)/Logging/Formatting/DefaultFormatter.cs @@ -120,7 +120,6 @@ private string FormatPrefix([NotNull] LogConfiguration configuration, LogLevel l } var innerException = exception; - ; while ((innerException = innerException.InnerException) != null) { builder.AppendLine(@"Caused By"); diff --git a/Intersect (Core)/Network/CerasPacket.cs b/Intersect (Core)/Network/CerasPacket.cs index 35353346dd..8272849bdc 100644 --- a/Intersect (Core)/Network/CerasPacket.cs +++ b/Intersect (Core)/Network/CerasPacket.cs @@ -10,13 +10,8 @@ namespace Intersect.Network public abstract class CerasPacket : IPacket { - [NotNull] private static readonly Ceras sCerasInstance = new Ceras(true); - protected CerasPacket() - { - } - /// public virtual void Dispose() { diff --git a/Intersect (Core)/Network/NetworkStatus.cs b/Intersect (Core)/Network/NetworkStatus.cs index 702c57874e..9064078ea4 100644 --- a/Intersect (Core)/Network/NetworkStatus.cs +++ b/Intersect (Core)/Network/NetworkStatus.cs @@ -16,7 +16,7 @@ public enum NetworkStatus VersionMismatch, ServerFull, - + HandshakeFailure, Quitting, diff --git a/Intersect (Core)/Properties/AssemblyInfo.cs b/Intersect (Core)/Properties/AssemblyInfo.cs index c6ce518186..99e5698bbb 100644 --- a/Intersect (Core)/Properties/AssemblyInfo.cs +++ b/Intersect (Core)/Properties/AssemblyInfo.cs @@ -38,5 +38,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Client.Framework/File Management/GameContentManager.cs b/Intersect.Client.Framework/File Management/GameContentManager.cs index 38ce3612d8..ffdc0f9886 100644 --- a/Intersect.Client.Framework/File Management/GameContentManager.cs +++ b/Intersect.Client.Framework/File Management/GameContentManager.cs @@ -5,6 +5,7 @@ using Intersect.Client.Framework.Audio; using Intersect.Client.Framework.Graphics; +using Intersect.Logging; namespace Intersect.Client.Framework.File_Management { @@ -400,8 +401,9 @@ public virtual void SaveUIJson(UI stage, string name, string json, string resolu { File.WriteAllText(path, json); } - catch (Exception) + catch (Exception exception) { + Log.Debug(exception); } return; @@ -413,8 +415,9 @@ public virtual void SaveUIJson(UI stage, string name, string json, string resolu { File.WriteAllText(path, json); } - catch (Exception) + catch (Exception exception) { + Log.Debug(exception); } } diff --git a/Intersect.Client.Framework/GenericClasses/OpenFileDialog.cs b/Intersect.Client.Framework/GenericClasses/OpenFileDialog.cs index 4e7a845592..1c4622c45d 100644 --- a/Intersect.Client.Framework/GenericClasses/OpenFileDialog.cs +++ b/Intersect.Client.Framework/GenericClasses/OpenFileDialog.cs @@ -10,11 +10,6 @@ public enum DialogResult public class OpenFileDialog { - - public OpenFileDialog() - { - } - public string Title { get; set; } public string InitialDirectory { get; set; } diff --git a/Intersect.Client.Framework/GenericClasses/SaveFileDialog.cs b/Intersect.Client.Framework/GenericClasses/SaveFileDialog.cs index 391d62ef3e..ed155a30cf 100644 --- a/Intersect.Client.Framework/GenericClasses/SaveFileDialog.cs +++ b/Intersect.Client.Framework/GenericClasses/SaveFileDialog.cs @@ -3,11 +3,6 @@ public class SaveFileDialog { - - public SaveFileDialog() - { - } - public string Title { get; set; } public string InitialDirectory { get; set; } diff --git a/Intersect.Client.Framework/Gwen/Control/Base.cs b/Intersect.Client.Framework/Gwen/Control/Base.cs index fb7ac0382b..afb6eb6998 100644 --- a/Intersect.Client.Framework/Gwen/Control/Base.cs +++ b/Intersect.Client.Framework/Gwen/Control/Base.cs @@ -11,6 +11,9 @@ using Intersect.Client.Framework.Gwen.ControlInternal; using Intersect.Client.Framework.Gwen.DragDrop; using Intersect.Client.Framework.Gwen.Input; +#if DEBUG +using Intersect.Logging; +#endif using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -1097,8 +1100,7 @@ private bool HasNamedChildren() #if DEBUG ~Base() { - //throw new InvalidOperationException(String.Format("IDisposable object finalized [{1:X}]: {0}", this, GetHashCode())); - ////debug.print(String.Format("IDisposable object finalized: {0}", GetType())); + Log.Debug($"IDisposable object finalized: {GetType()}"); } #endif diff --git a/Intersect.Client.Framework/Gwen/Renderer/Base.cs b/Intersect.Client.Framework/Gwen/Renderer/Base.cs index 2021a793dd..cf9b92f402 100644 --- a/Intersect.Client.Framework/Gwen/Renderer/Base.cs +++ b/Intersect.Client.Framework/Gwen/Renderer/Base.cs @@ -1,7 +1,10 @@ -using System; - -using Intersect.Client.Framework.GenericClasses; +using Intersect.Client.Framework.GenericClasses; using Intersect.Client.Framework.Graphics; +#if DEBUG +using Intersect.Logging; +#endif + +using System; namespace Intersect.Client.Framework.Gwen.Renderer { @@ -96,8 +99,7 @@ public virtual void Dispose() #if DEBUG ~Base() { - //throw new InvalidOperationException(String.Format("IDisposable object finalized: {0}", GetType())); - ////debug.print(String.Format("IDisposable object finalized: {0}", GetType())); + Log.Debug($"IDisposable object finalized: {GetType()}"); } #endif diff --git a/Intersect.Client.Framework/Gwen/Skin/Base.cs b/Intersect.Client.Framework/Gwen/Skin/Base.cs index d058341eb3..8ac4bd3abe 100644 --- a/Intersect.Client.Framework/Gwen/Skin/Base.cs +++ b/Intersect.Client.Framework/Gwen/Skin/Base.cs @@ -1,8 +1,12 @@ -using System; - -using Intersect.Client.Framework.GenericClasses; +using Intersect.Client.Framework.GenericClasses; using Intersect.Client.Framework.Graphics; +using System; + +#if DEBUG +using Intersect.Logging; +#endif + namespace Intersect.Client.Framework.Gwen.Skin { @@ -56,8 +60,7 @@ public virtual void Dispose() #if DEBUG ~Base() { - //throw new InvalidOperationException(String.Format("IDisposable object finalized: {0}", GetType())); - ////debug.print(String.Format("IDisposable object finalized: {0}", GetType())); + Log.Debug($"IDisposable object finalized: {GetType()}"); } #endif diff --git a/Intersect.Client.Framework/Properties/AssemblyInfo.cs b/Intersect.Client.Framework/Properties/AssemblyInfo.cs index 7581d8fcf2..9f5c897cbe 100644 --- a/Intersect.Client.Framework/Properties/AssemblyInfo.cs +++ b/Intersect.Client.Framework/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Client/Interface/Game/Draggable.cs b/Intersect.Client/Interface/Game/Draggable.cs index cf4585c929..2b23a278a3 100644 --- a/Intersect.Client/Interface/Game/Draggable.cs +++ b/Intersect.Client/Interface/Game/Draggable.cs @@ -61,7 +61,6 @@ public void Dispose() Active = null; } - ; Interface.GameUi.GameCanvas.RemoveChild(mPnl, false); } diff --git a/Intersect.Client/Items/Item.cs b/Intersect.Client/Items/Item.cs index 815f612939..be2daa4210 100644 --- a/Intersect.Client/Items/Item.cs +++ b/Intersect.Client/Items/Item.cs @@ -17,10 +17,6 @@ public class Item public int[] StatBuffs = new int[(int) Stats.StatCount]; - public Item() - { - } - public ItemBase Base => ItemBase.Get(ItemId); public void Load(Guid id, int quantity, Guid? bagId, int[] statBuffs) diff --git a/Intersect.Client/MonoGame/Graphics/MonoTileBuffer.cs b/Intersect.Client/MonoGame/Graphics/MonoTileBuffer.cs index 60f9b33899..1b80c0c1cb 100644 --- a/Intersect.Client/MonoGame/Graphics/MonoTileBuffer.cs +++ b/Intersect.Client/MonoGame/Graphics/MonoTileBuffer.cs @@ -176,16 +176,11 @@ public override bool SetData() public override void Dispose() { - if (vertexBuffer != null) - { - ; - } - - vertexBuffer.Dispose(); + vertexBuffer?.Dispose(); vertexBuffer = null; - indexBuffer.Dispose(); - TileBufferCount--; + indexBuffer?.Dispose(); indexBuffer = null; + TileBufferCount--; disposed = true; } diff --git a/Intersect.Client/MonoGame/Network/MonoSocket.cs b/Intersect.Client/MonoGame/Network/MonoSocket.cs index b49103fcd3..5c859c77e5 100644 --- a/Intersect.Client/MonoGame/Network/MonoSocket.cs +++ b/Intersect.Client/MonoGame/Network/MonoSocket.cs @@ -21,10 +21,6 @@ public class MonoSocket : GameSocket public static ConcurrentQueue> PacketQueue = new ConcurrentQueue>(); - public MonoSocket() - { - } - public override void Connect(string host, int port) { if (ClientLidgrenNetwork != null) diff --git a/Intersect.Client/Properties/AssemblyInfo.cs b/Intersect.Client/Properties/AssemblyInfo.cs index f9c52ff2f7..310c0395da 100644 --- a/Intersect.Client/Properties/AssemblyInfo.cs +++ b/Intersect.Client/Properties/AssemblyInfo.cs @@ -38,5 +38,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs b/Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs index b3497aa0d3..6137148339 100644 --- a/Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs +++ b/Intersect.Editor/Forms/Editors/Events/CommandPrinter.cs @@ -1079,6 +1079,22 @@ private static string GetVariableModText(SetVariableCommand command, IntegerVari case Enums.VariableMods.Subtract: varvalue = Strings.EventCommandList.subtractvariable.ToString(mod.Value); + break; + case Enums.VariableMods.Multiply: + varvalue = Strings.EventCommandList.multiplyvariable.ToString(mod.Value); + + break; + case Enums.VariableMods.Divide: + varvalue = Strings.EventCommandList.dividevariable.ToString(mod.Value); + + break; + case Enums.VariableMods.LeftShift: + varvalue = Strings.EventCommandList.leftshiftvariable.ToString(mod.Value); + + break; + case Enums.VariableMods.RightShift: + varvalue = Strings.EventCommandList.rightshiftvariable.ToString(mod.Value); + break; case Enums.VariableMods.Random: varvalue = Strings.EventCommandList.randvariable.ToString(mod.Value, mod.HighValue); @@ -1123,6 +1139,54 @@ private static string GetVariableModText(SetVariableCommand command, IntegerVari ServerVariableBase.GetName(mod.DuplicateVariableId) ); + break; + case Enums.VariableMods.MultiplyPlayerVar: + varvalue = Strings.EventCommandList.multiplyplayervariable.ToString( + PlayerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.MultiplyGlobalVar: + varvalue = Strings.EventCommandList.multiplyglobalvariable.ToString( + ServerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.DividePlayerVar: + varvalue = Strings.EventCommandList.divideplayervariable.ToString( + PlayerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.DivideGlobalVar: + varvalue = Strings.EventCommandList.divideglobalvariable.ToString( + ServerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.LeftShiftPlayerVar: + varvalue = Strings.EventCommandList.leftshiftplayervariable.ToString( + PlayerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.LeftShiftGlobalVar: + varvalue = Strings.EventCommandList.leftshiftglobalvariable.ToString( + ServerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.RightShiftPlayerVar: + varvalue = Strings.EventCommandList.rightshiftplayervariable.ToString( + PlayerVariableBase.GetName(mod.DuplicateVariableId) + ); + + break; + case Enums.VariableMods.RightShiftGlobalVar: + varvalue = Strings.EventCommandList.rightshiftglobalvariable.ToString( + ServerVariableBase.GetName(mod.DuplicateVariableId) + ); + break; } diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs index c17cd77097..e236aef297 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_ConditionalBranch.Designer.cs @@ -592,14 +592,14 @@ private void InitializeComponent() this.nudVariableValue.ForeColor = System.Drawing.Color.Gainsboro; this.nudVariableValue.Location = new System.Drawing.Point(115, 48); this.nudVariableValue.Maximum = new decimal(new int[] { - 1000000000, - 0, - 0, + -1, + -1, + -1, 0}); this.nudVariableValue.Minimum = new decimal(new int[] { - 1000000000, - 0, - 0, + -1, + -1, + -1, -2147483648}); this.nudVariableValue.Name = "nudVariableValue"; this.nudVariableValue.Size = new System.Drawing.Size(125, 20); diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.Designer.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.Designer.cs index 20ec2a8ab3..0b67b2fb0e 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.Designer.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.Designer.cs @@ -40,8 +40,17 @@ private void InitializeComponent() this.btnCancel = new DarkUI.Controls.DarkButton(); this.btnSave = new DarkUI.Controls.DarkButton(); this.grpStringVariable = new DarkUI.Controls.DarkGroupBox(); - this.txtStringValue = new DarkUI.Controls.DarkTextBox(); + this.lblStringTextVariables = new System.Windows.Forms.Label(); + this.grpStringReplace = new DarkUI.Controls.DarkGroupBox(); + this.txtStringReplace = new DarkUI.Controls.DarkTextBox(); + this.txtStringFind = new DarkUI.Controls.DarkTextBox(); + this.lblStringReplace = new System.Windows.Forms.Label(); + this.lblStringFind = new System.Windows.Forms.Label(); + this.optReplaceString = new DarkUI.Controls.DarkRadioButton(); this.optStaticString = new DarkUI.Controls.DarkRadioButton(); + this.grpStringSet = new DarkUI.Controls.DarkGroupBox(); + this.lblStringValue = new System.Windows.Forms.Label(); + this.txtStringValue = new DarkUI.Controls.DarkTextBox(); this.grpBooleanVariable = new DarkUI.Controls.DarkGroupBox(); this.cmbBooleanCloneGlobalVar = new DarkUI.Controls.DarkComboBox(); this.cmbBooleanClonePlayerVar = new DarkUI.Controls.DarkComboBox(); @@ -67,18 +76,15 @@ private void InitializeComponent() this.nudLow = new DarkUI.Controls.DarkNumericUpDown(); this.lblNumericRandomHigh = new System.Windows.Forms.Label(); this.lblNumericRandomLow = new System.Windows.Forms.Label(); - this.optReplaceString = new DarkUI.Controls.DarkRadioButton(); - this.grpStringReplace = new DarkUI.Controls.DarkGroupBox(); - this.lblStringReplace = new System.Windows.Forms.Label(); - this.lblStringFind = new System.Windows.Forms.Label(); - this.lblStringValue = new System.Windows.Forms.Label(); - this.txtStringFind = new DarkUI.Controls.DarkTextBox(); - this.txtStringReplace = new DarkUI.Controls.DarkTextBox(); - this.grpStringSet = new DarkUI.Controls.DarkGroupBox(); - this.lblStringTextVariables = new System.Windows.Forms.Label(); + this.optNumericMultiply = new DarkUI.Controls.DarkRadioButton(); + this.optNumericDivide = new DarkUI.Controls.DarkRadioButton(); + this.optNumericLeftShift = new DarkUI.Controls.DarkRadioButton(); + this.optNumericRightShift = new DarkUI.Controls.DarkRadioButton(); this.grpSetVariable.SuspendLayout(); this.grpSelectVariable.SuspendLayout(); this.grpStringVariable.SuspendLayout(); + this.grpStringReplace.SuspendLayout(); + this.grpStringSet.SuspendLayout(); this.grpBooleanVariable.SuspendLayout(); this.grpNumericVariable.SuspendLayout(); this.grpNumericValues.SuspendLayout(); @@ -86,8 +92,6 @@ private void InitializeComponent() this.grpNumericRandom.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudHigh)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudLow)).BeginInit(); - this.grpStringReplace.SuspendLayout(); - this.grpStringSet.SuspendLayout(); this.SuspendLayout(); // // grpSetVariable @@ -97,9 +101,9 @@ private void InitializeComponent() this.grpSetVariable.Controls.Add(this.grpSelectVariable); this.grpSetVariable.Controls.Add(this.btnCancel); this.grpSetVariable.Controls.Add(this.btnSave); + this.grpSetVariable.Controls.Add(this.grpNumericVariable); this.grpSetVariable.Controls.Add(this.grpStringVariable); this.grpSetVariable.Controls.Add(this.grpBooleanVariable); - this.grpSetVariable.Controls.Add(this.grpNumericVariable); this.grpSetVariable.ForeColor = System.Drawing.Color.Gainsboro; this.grpSetVariable.Location = new System.Drawing.Point(3, 3); this.grpSetVariable.Name = "grpSetVariable"; @@ -216,15 +220,82 @@ private void InitializeComponent() this.grpStringVariable.Text = "String Variable:"; this.grpStringVariable.Visible = false; // - // txtStringValue + // lblStringTextVariables // - this.txtStringValue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); - this.txtStringValue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtStringValue.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.txtStringValue.Location = new System.Drawing.Point(71, 25); - this.txtStringValue.Name = "txtStringValue"; - this.txtStringValue.Size = new System.Drawing.Size(207, 20); - this.txtStringValue.TabIndex = 62; + this.lblStringTextVariables.AutoSize = true; + this.lblStringTextVariables.BackColor = System.Drawing.Color.Transparent; + this.lblStringTextVariables.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblStringTextVariables.ForeColor = System.Drawing.SystemColors.MenuHighlight; + this.lblStringTextVariables.Location = new System.Drawing.Point(6, 159); + this.lblStringTextVariables.Name = "lblStringTextVariables"; + this.lblStringTextVariables.Size = new System.Drawing.Size(249, 13); + this.lblStringTextVariables.TabIndex = 68; + this.lblStringTextVariables.Text = "Text variables work with strings. Click here for a list!"; + this.lblStringTextVariables.Click += new System.EventHandler(this.lblStringTextVariables_Click); + // + // grpStringReplace + // + this.grpStringReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.grpStringReplace.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); + this.grpStringReplace.Controls.Add(this.txtStringReplace); + this.grpStringReplace.Controls.Add(this.txtStringFind); + this.grpStringReplace.Controls.Add(this.lblStringReplace); + this.grpStringReplace.Controls.Add(this.lblStringFind); + this.grpStringReplace.ForeColor = System.Drawing.Color.Gainsboro; + this.grpStringReplace.Location = new System.Drawing.Point(6, 55); + this.grpStringReplace.Name = "grpStringReplace"; + this.grpStringReplace.Size = new System.Drawing.Size(284, 90); + this.grpStringReplace.TabIndex = 65; + this.grpStringReplace.TabStop = false; + this.grpStringReplace.Text = "Replace"; + // + // txtStringReplace + // + this.txtStringReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); + this.txtStringReplace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtStringReplace.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.txtStringReplace.Location = new System.Drawing.Point(77, 52); + this.txtStringReplace.Name = "txtStringReplace"; + this.txtStringReplace.Size = new System.Drawing.Size(201, 20); + this.txtStringReplace.TabIndex = 64; + // + // txtStringFind + // + this.txtStringFind.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); + this.txtStringFind.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtStringFind.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.txtStringFind.Location = new System.Drawing.Point(77, 20); + this.txtStringFind.Name = "txtStringFind"; + this.txtStringFind.Size = new System.Drawing.Size(201, 20); + this.txtStringFind.TabIndex = 63; + // + // lblStringReplace + // + this.lblStringReplace.AutoSize = true; + this.lblStringReplace.Location = new System.Drawing.Point(9, 54); + this.lblStringReplace.Name = "lblStringReplace"; + this.lblStringReplace.Size = new System.Drawing.Size(47, 13); + this.lblStringReplace.TabIndex = 39; + this.lblStringReplace.Text = "Replace"; + // + // lblStringFind + // + this.lblStringFind.AutoSize = true; + this.lblStringFind.Location = new System.Drawing.Point(11, 27); + this.lblStringFind.Name = "lblStringFind"; + this.lblStringFind.Size = new System.Drawing.Size(27, 13); + this.lblStringFind.TabIndex = 40; + this.lblStringFind.Text = "Find"; + // + // optReplaceString + // + this.optReplaceString.AutoSize = true; + this.optReplaceString.Location = new System.Drawing.Point(62, 19); + this.optReplaceString.Name = "optReplaceString"; + this.optReplaceString.Size = new System.Drawing.Size(65, 17); + this.optReplaceString.TabIndex = 63; + this.optReplaceString.Text = "Replace"; + this.optReplaceString.CheckedChanged += new System.EventHandler(this.optReplaceString_CheckedChanged); // // optStaticString // @@ -236,6 +307,39 @@ private void InitializeComponent() this.optStaticString.Text = "Set"; this.optStaticString.CheckedChanged += new System.EventHandler(this.optStaticString_CheckedChanged); // + // grpStringSet + // + this.grpStringSet.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); + this.grpStringSet.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); + this.grpStringSet.Controls.Add(this.lblStringValue); + this.grpStringSet.Controls.Add(this.txtStringValue); + this.grpStringSet.ForeColor = System.Drawing.Color.Gainsboro; + this.grpStringSet.Location = new System.Drawing.Point(6, 55); + this.grpStringSet.Name = "grpStringSet"; + this.grpStringSet.Size = new System.Drawing.Size(284, 90); + this.grpStringSet.TabIndex = 67; + this.grpStringSet.TabStop = false; + this.grpStringSet.Text = "Set"; + // + // lblStringValue + // + this.lblStringValue.AutoSize = true; + this.lblStringValue.Location = new System.Drawing.Point(6, 28); + this.lblStringValue.Name = "lblStringValue"; + this.lblStringValue.Size = new System.Drawing.Size(37, 13); + this.lblStringValue.TabIndex = 66; + this.lblStringValue.Text = "Value:"; + // + // txtStringValue + // + this.txtStringValue.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); + this.txtStringValue.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.txtStringValue.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); + this.txtStringValue.Location = new System.Drawing.Point(71, 25); + this.txtStringValue.Name = "txtStringValue"; + this.txtStringValue.Size = new System.Drawing.Size(207, 20); + this.txtStringValue.TabIndex = 62; + // // grpBooleanVariable // this.grpBooleanVariable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); @@ -336,6 +440,10 @@ private void InitializeComponent() // this.grpNumericVariable.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); this.grpNumericVariable.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); + this.grpNumericVariable.Controls.Add(this.optNumericRightShift); + this.grpNumericVariable.Controls.Add(this.optNumericLeftShift); + this.grpNumericVariable.Controls.Add(this.optNumericDivide); + this.grpNumericVariable.Controls.Add(this.optNumericMultiply); this.grpNumericVariable.Controls.Add(this.optNumericSet); this.grpNumericVariable.Controls.Add(this.optNumericAdd); this.grpNumericVariable.Controls.Add(this.optNumericRandom); @@ -364,7 +472,7 @@ private void InitializeComponent() // optNumericAdd // this.optNumericAdd.AutoSize = true; - this.optNumericAdd.Location = new System.Drawing.Point(57, 19); + this.optNumericAdd.Location = new System.Drawing.Point(50, 19); this.optNumericAdd.Name = "optNumericAdd"; this.optNumericAdd.Size = new System.Drawing.Size(44, 17); this.optNumericAdd.TabIndex = 25; @@ -374,7 +482,7 @@ private void InitializeComponent() // optNumericRandom // this.optNumericRandom.AutoSize = true; - this.optNumericRandom.Location = new System.Drawing.Point(178, 19); + this.optNumericRandom.Location = new System.Drawing.Point(116, 42); this.optNumericRandom.Name = "optNumericRandom"; this.optNumericRandom.Size = new System.Drawing.Size(65, 17); this.optNumericRandom.TabIndex = 23; @@ -384,7 +492,7 @@ private void InitializeComponent() // optNumericSubtract // this.optNumericSubtract.AutoSize = true; - this.optNumericSubtract.Location = new System.Drawing.Point(107, 19); + this.optNumericSubtract.Location = new System.Drawing.Point(98, 19); this.optNumericSubtract.Name = "optNumericSubtract"; this.optNumericSubtract.Size = new System.Drawing.Size(65, 17); this.optNumericSubtract.TabIndex = 24; @@ -393,9 +501,9 @@ private void InitializeComponent() // // optNumericSystemTime // - this.optNumericSystemTime.Location = new System.Drawing.Point(9, 42); + this.optNumericSystemTime.Location = new System.Drawing.Point(181, 42); this.optNumericSystemTime.Name = "optNumericSystemTime"; - this.optNumericSystemTime.Size = new System.Drawing.Size(125, 17); + this.optNumericSystemTime.Size = new System.Drawing.Size(109, 17); this.optNumericSystemTime.TabIndex = 39; this.optNumericSystemTime.Text = "System Time (Ms)"; this.optNumericSystemTime.CheckedChanged += new System.EventHandler(this.optNumericSystemTime_CheckedChanged); @@ -423,14 +531,14 @@ private void InitializeComponent() this.nudNumericValue.ForeColor = System.Drawing.Color.Gainsboro; this.nudNumericValue.Location = new System.Drawing.Point(143, 9); this.nudNumericValue.Maximum = new decimal(new int[] { - 1000000000, - 0, - 0, + -1, + -1, + -1, 0}); this.nudNumericValue.Minimum = new decimal(new int[] { - 1000000000, - 0, - 0, + -1, + -1, + -1, -2147483648}); this.nudNumericValue.Name = "nudNumericValue"; this.nudNumericValue.Size = new System.Drawing.Size(125, 20); @@ -596,105 +704,45 @@ private void InitializeComponent() this.lblNumericRandomLow.TabIndex = 40; this.lblNumericRandomLow.Text = "Low"; // - // optReplaceString - // - this.optReplaceString.AutoSize = true; - this.optReplaceString.Location = new System.Drawing.Point(62, 19); - this.optReplaceString.Name = "optReplaceString"; - this.optReplaceString.Size = new System.Drawing.Size(65, 17); - this.optReplaceString.TabIndex = 63; - this.optReplaceString.Text = "Replace"; - this.optReplaceString.CheckedChanged += new System.EventHandler(this.optReplaceString_CheckedChanged); - // - // grpStringReplace - // - this.grpStringReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); - this.grpStringReplace.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); - this.grpStringReplace.Controls.Add(this.txtStringReplace); - this.grpStringReplace.Controls.Add(this.txtStringFind); - this.grpStringReplace.Controls.Add(this.lblStringReplace); - this.grpStringReplace.Controls.Add(this.lblStringFind); - this.grpStringReplace.ForeColor = System.Drawing.Color.Gainsboro; - this.grpStringReplace.Location = new System.Drawing.Point(6, 55); - this.grpStringReplace.Name = "grpStringReplace"; - this.grpStringReplace.Size = new System.Drawing.Size(284, 90); - this.grpStringReplace.TabIndex = 65; - this.grpStringReplace.TabStop = false; - this.grpStringReplace.Text = "Replace"; - // - // lblStringReplace - // - this.lblStringReplace.AutoSize = true; - this.lblStringReplace.Location = new System.Drawing.Point(9, 54); - this.lblStringReplace.Name = "lblStringReplace"; - this.lblStringReplace.Size = new System.Drawing.Size(47, 13); - this.lblStringReplace.TabIndex = 39; - this.lblStringReplace.Text = "Replace"; - // - // lblStringFind - // - this.lblStringFind.AutoSize = true; - this.lblStringFind.Location = new System.Drawing.Point(11, 27); - this.lblStringFind.Name = "lblStringFind"; - this.lblStringFind.Size = new System.Drawing.Size(27, 13); - this.lblStringFind.TabIndex = 40; - this.lblStringFind.Text = "Find"; - // - // lblStringValue - // - this.lblStringValue.AutoSize = true; - this.lblStringValue.Location = new System.Drawing.Point(6, 28); - this.lblStringValue.Name = "lblStringValue"; - this.lblStringValue.Size = new System.Drawing.Size(37, 13); - this.lblStringValue.TabIndex = 66; - this.lblStringValue.Text = "Value:"; - // - // txtStringFind - // - this.txtStringFind.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); - this.txtStringFind.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtStringFind.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.txtStringFind.Location = new System.Drawing.Point(77, 20); - this.txtStringFind.Name = "txtStringFind"; - this.txtStringFind.Size = new System.Drawing.Size(201, 20); - this.txtStringFind.TabIndex = 63; - // - // txtStringReplace - // - this.txtStringReplace.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(69)))), ((int)(((byte)(73)))), ((int)(((byte)(74))))); - this.txtStringReplace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtStringReplace.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(220)))), ((int)(((byte)(220)))), ((int)(((byte)(220))))); - this.txtStringReplace.Location = new System.Drawing.Point(77, 52); - this.txtStringReplace.Name = "txtStringReplace"; - this.txtStringReplace.Size = new System.Drawing.Size(201, 20); - this.txtStringReplace.TabIndex = 64; - // - // grpStringSet - // - this.grpStringSet.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(60)))), ((int)(((byte)(63)))), ((int)(((byte)(65))))); - this.grpStringSet.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90))))); - this.grpStringSet.Controls.Add(this.lblStringValue); - this.grpStringSet.Controls.Add(this.txtStringValue); - this.grpStringSet.ForeColor = System.Drawing.Color.Gainsboro; - this.grpStringSet.Location = new System.Drawing.Point(6, 55); - this.grpStringSet.Name = "grpStringSet"; - this.grpStringSet.Size = new System.Drawing.Size(284, 90); - this.grpStringSet.TabIndex = 67; - this.grpStringSet.TabStop = false; - this.grpStringSet.Text = "Set"; - // - // lblStringTextVariables - // - this.lblStringTextVariables.AutoSize = true; - this.lblStringTextVariables.BackColor = System.Drawing.Color.Transparent; - this.lblStringTextVariables.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblStringTextVariables.ForeColor = System.Drawing.SystemColors.MenuHighlight; - this.lblStringTextVariables.Location = new System.Drawing.Point(6, 159); - this.lblStringTextVariables.Name = "lblStringTextVariables"; - this.lblStringTextVariables.Size = new System.Drawing.Size(249, 13); - this.lblStringTextVariables.TabIndex = 68; - this.lblStringTextVariables.Text = "Text variables work with strings. Click here for a list!"; - this.lblStringTextVariables.Click += new System.EventHandler(this.lblStringTextVariables_Click); + // optNumericMultiply + // + this.optNumericMultiply.AutoSize = true; + this.optNumericMultiply.Location = new System.Drawing.Point(169, 19); + this.optNumericMultiply.Name = "optNumericMultiply"; + this.optNumericMultiply.Size = new System.Drawing.Size(60, 17); + this.optNumericMultiply.TabIndex = 40; + this.optNumericMultiply.Text = "Multiply"; + this.optNumericMultiply.CheckedChanged += new System.EventHandler(this.optNumericMultiply_CheckedChanged); + // + // optNumericDivide + // + this.optNumericDivide.AutoSize = true; + this.optNumericDivide.Location = new System.Drawing.Point(235, 19); + this.optNumericDivide.Name = "optNumericDivide"; + this.optNumericDivide.Size = new System.Drawing.Size(55, 17); + this.optNumericDivide.TabIndex = 41; + this.optNumericDivide.Text = "Divide"; + this.optNumericDivide.CheckedChanged += new System.EventHandler(this.optNumericDivide_CheckedChanged); + // + // optNumericLeftShift + // + this.optNumericLeftShift.AutoSize = true; + this.optNumericLeftShift.Location = new System.Drawing.Point(9, 42); + this.optNumericLeftShift.Name = "optNumericLeftShift"; + this.optNumericLeftShift.Size = new System.Drawing.Size(52, 17); + this.optNumericLeftShift.TabIndex = 42; + this.optNumericLeftShift.Text = "LShift"; + this.optNumericLeftShift.CheckedChanged += new System.EventHandler(this.optNumericLeftShift_CheckedChanged); + // + // optNumericRightShift + // + this.optNumericRightShift.AutoSize = true; + this.optNumericRightShift.Location = new System.Drawing.Point(62, 42); + this.optNumericRightShift.Name = "optNumericRightShift"; + this.optNumericRightShift.Size = new System.Drawing.Size(54, 17); + this.optNumericRightShift.TabIndex = 43; + this.optNumericRightShift.Text = "RShift"; + this.optNumericRightShift.CheckedChanged += new System.EventHandler(this.optNumericRightShift_CheckedChanged); // // EventCommandVariable // @@ -710,6 +758,10 @@ private void InitializeComponent() this.grpSelectVariable.PerformLayout(); this.grpStringVariable.ResumeLayout(false); this.grpStringVariable.PerformLayout(); + this.grpStringReplace.ResumeLayout(false); + this.grpStringReplace.PerformLayout(); + this.grpStringSet.ResumeLayout(false); + this.grpStringSet.PerformLayout(); this.grpBooleanVariable.ResumeLayout(false); this.grpBooleanVariable.PerformLayout(); this.grpNumericVariable.ResumeLayout(false); @@ -721,10 +773,6 @@ private void InitializeComponent() this.grpNumericRandom.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudHigh)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudLow)).EndInit(); - this.grpStringReplace.ResumeLayout(false); - this.grpStringReplace.PerformLayout(); - this.grpStringSet.ResumeLayout(false); - this.grpStringSet.PerformLayout(); this.ResumeLayout(false); } @@ -776,5 +824,9 @@ private void InitializeComponent() private DarkRadioButton optStaticString; private DarkGroupBox grpStringSet; private System.Windows.Forms.Label lblStringTextVariables; + internal DarkRadioButton optNumericRightShift; + internal DarkRadioButton optNumericLeftShift; + internal DarkRadioButton optNumericDivide; + internal DarkRadioButton optNumericMultiply; } } diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.cs index 847c2ad276..48072b7bfc 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Variable.cs @@ -69,6 +69,10 @@ private void InitLocalization() optNumericSet.Text = Strings.EventSetVariable.numericset; optNumericAdd.Text = Strings.EventSetVariable.numericadd; optNumericSubtract.Text = Strings.EventSetVariable.numericsubtract; + optNumericMultiply.Text = Strings.EventSetVariable.numericmultiply; + optNumericDivide.Text = Strings.EventSetVariable.numericdivide; + optNumericLeftShift.Text = Strings.EventSetVariable.numericleftshift; + optNumericRightShift.Text = Strings.EventSetVariable.numericrightshift; optNumericRandom.Text = Strings.EventSetVariable.numericrandom; optNumericSystemTime.Text = Strings.EventSetVariable.numericsystemtime; optNumericClonePlayerVar.Text = Strings.EventSetVariable.numericcloneplayervariablevalue; @@ -343,6 +347,8 @@ private void TryLoadNumericMod(VariableMod varMod) { var mod = (IntegerVariableMod) varMod; + //Should properly seperate static value, player & global vars into a seperate enum. + //But technical debt :/ switch (mod.ModType) { case VariableMods.Set: @@ -366,6 +372,34 @@ private void TryLoadNumericMod(VariableMod varMod) break; + case VariableMods.Multiply: + optNumericMultiply.Checked = true; + optNumericStaticVal.Checked = true; + nudNumericValue.Value = mod.Value; + + break; + + case VariableMods.Divide: + optNumericDivide.Checked = true; + optNumericStaticVal.Checked = true; + nudNumericValue.Value = mod.Value; + + break; + + case VariableMods.LeftShift: + optNumericLeftShift.Checked = true; + optNumericStaticVal.Checked = true; + nudNumericValue.Value = mod.Value; + + break; + + case VariableMods.RightShift: + optNumericRightShift.Checked = true; + optNumericStaticVal.Checked = true; + nudNumericValue.Value = mod.Value; + + break; + case VariableMods.Random: optNumericRandom.Checked = true; nudLow.Value = mod.Value; @@ -418,6 +452,62 @@ private void TryLoadNumericMod(VariableMod varMod) optNumericCloneGlobalVar.Checked = true; cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId); + break; + + case VariableMods.MultiplyPlayerVar: + optNumericMultiply.Checked = true; + optNumericClonePlayerVar.Checked = true; + cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.MultiplyGlobalVar: + optNumericMultiply.Checked = true; + optNumericCloneGlobalVar.Checked = true; + cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.DividePlayerVar: + optNumericDivide.Checked = true; + optNumericClonePlayerVar.Checked = true; + cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.DivideGlobalVar: + optNumericDivide.Checked = true; + optNumericCloneGlobalVar.Checked = true; + cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.LeftShiftPlayerVar: + optNumericLeftShift.Checked = true; + optNumericClonePlayerVar.Checked = true; + cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.LeftShiftGlobalVar: + optNumericLeftShift.Checked = true; + optNumericCloneGlobalVar.Checked = true; + cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.RightShiftPlayerVar: + optNumericRightShift.Checked = true; + optNumericClonePlayerVar.Checked = true; + cmbNumericClonePlayerVar.SelectedIndex = PlayerVariableBase.ListIndex(mod.DuplicateVariableId); + + break; + + case VariableMods.RightShiftGlobalVar: + optNumericRightShift.Checked = true; + optNumericCloneGlobalVar.Checked = true; + cmbNumericCloneGlobalVar.SelectedIndex = ServerVariableBase.ListIndex(mod.DuplicateVariableId); + break; } } @@ -426,7 +516,8 @@ private void TryLoadNumericMod(VariableMod varMod) private void UpdateNumericFormElements() { grpNumericRandom.Visible = optNumericRandom.Checked; - grpNumericValues.Visible = optNumericAdd.Checked | optNumericSubtract.Checked | optNumericSet.Checked; + grpNumericValues.Visible = optNumericAdd.Checked | optNumericSubtract.Checked | optNumericSet.Checked | optNumericMultiply.Checked | + optNumericDivide.Checked | optNumericLeftShift.Checked | optNumericRightShift.Checked; } private void optNumericSet_CheckedChanged(object sender, EventArgs e) @@ -444,6 +535,26 @@ private void optNumericSubtract_CheckedChanged(object sender, EventArgs e) UpdateNumericFormElements(); } + private void optNumericMultiply_CheckedChanged(object sender, EventArgs e) + { + UpdateNumericFormElements(); + } + + private void optNumericDivide_CheckedChanged(object sender, EventArgs e) + { + UpdateNumericFormElements(); + } + + private void optNumericLeftShift_CheckedChanged(object sender, EventArgs e) + { + UpdateNumericFormElements(); + } + + private void optNumericRightShift_CheckedChanged(object sender, EventArgs e) + { + UpdateNumericFormElements(); + } + private void optNumericRandom_CheckedChanged(object sender, EventArgs e) { UpdateNumericFormElements(); @@ -482,6 +593,26 @@ private IntegerVariableMod GetNumericVariableMod() mod.ModType = VariableMods.Subtract; mod.Value = (int) nudNumericValue.Value; } + else if (optNumericMultiply.Checked && optNumericStaticVal.Checked) + { + mod.ModType = VariableMods.Multiply; + mod.Value = (int)nudNumericValue.Value; + } + else if (optNumericDivide.Checked && optNumericStaticVal.Checked) + { + mod.ModType = VariableMods.Divide; + mod.Value = (int)nudNumericValue.Value; + } + else if (optNumericLeftShift.Checked && optNumericStaticVal.Checked) + { + mod.ModType = VariableMods.LeftShift; + mod.Value = (int)nudNumericValue.Value; + } + else if (optNumericRightShift.Checked && optNumericStaticVal.Checked) + { + mod.ModType = VariableMods.RightShift; + mod.Value = (int)nudNumericValue.Value; + } else if (optNumericRandom.Checked) { mod.ModType = VariableMods.Random; @@ -508,10 +639,26 @@ private IntegerVariableMod GetNumericVariableMod() { mod.ModType = VariableMods.AddPlayerVar; } - else + else if (optNumericSubtract.Checked) { mod.ModType = VariableMods.SubtractPlayerVar; } + else if (optNumericMultiply.Checked) + { + mod.ModType = VariableMods.MultiplyPlayerVar; + } + else if (optNumericDivide.Checked) + { + mod.ModType = VariableMods.DividePlayerVar; + } + else if (optNumericLeftShift.Checked) + { + mod.ModType = VariableMods.LeftShiftPlayerVar; + } + else + { + mod.ModType = VariableMods.RightShiftPlayerVar; + } mod.DuplicateVariableId = PlayerVariableBase.IdFromList(cmbNumericClonePlayerVar.SelectedIndex); } @@ -525,10 +672,26 @@ private IntegerVariableMod GetNumericVariableMod() { mod.ModType = VariableMods.AddGlobalVar; } - else + else if (optNumericSubtract.Checked) { mod.ModType = VariableMods.SubtractGlobalVar; } + else if (optNumericMultiply.Checked) + { + mod.ModType = VariableMods.MultiplyGlobalVar; + } + else if (optNumericDivide.Checked) + { + mod.ModType = VariableMods.DivideGlobalVar; + } + else if (optNumericLeftShift.Checked) + { + mod.ModType = VariableMods.LeftShiftGlobalVar; + } + else + { + mod.ModType = VariableMods.RightShiftGlobalVar; + } mod.DuplicateVariableId = ServerVariableBase.IdFromList(cmbNumericCloneGlobalVar.SelectedIndex); } @@ -610,7 +773,6 @@ private void optReplaceString_CheckedChanged(object sender, EventArgs e) } #endregion - } } diff --git a/Intersect.Editor/Localization/Strings.cs b/Intersect.Editor/Localization/Strings.cs index 7432fe66ef..d21c0a94a5 100644 --- a/Intersect.Editor/Localization/Strings.cs +++ b/Intersect.Editor/Localization/Strings.cs @@ -1423,6 +1423,8 @@ public struct EventCommandList public static LocalizedString despawnnpcs = @"Despawn NPCs"; + public static LocalizedString dividevariable = @"Divide {00}"; + public static LocalizedString dupglobalvariable = @"Global Variable: {00}'s Value"; public static LocalizedString dupplayervariable = @"Player Variable: {00}'s Value"; @@ -1435,6 +1437,22 @@ public struct EventCommandList public static LocalizedString subtractplayervariable = @"Subtract Player Variable: {00}'s Value"; + public static LocalizedString multiplyglobalvariable = @"Multiply Global Variable: {00}'s Value"; + + public static LocalizedString multiplyplayervariable = @"Multiply Player Variable: {00}'s Value"; + + public static LocalizedString divideglobalvariable = @"Divide Global Variable: {00}'s Value"; + + public static LocalizedString divideplayervariable = @"Divide Player Variable: {00}'s Value"; + + public static LocalizedString leftshiftglobalvariable = @"Left Bit Shift Global Variable: {00}'s Value"; + + public static LocalizedString leftshiftplayervariable = @"Left Bit Shift Player Variable: {00}'s Value"; + + public static LocalizedString rightshiftglobalvariable = @"Right Bit Shift Global Variable: {00}'s Value"; + + public static LocalizedString rightshiftplayervariable = @"Right Bit Shift Player Variable: {00}'s Value"; + public static LocalizedString enditemchange = @"End Item Change"; public static LocalizedString endoptions = @"End Options"; @@ -1481,6 +1499,8 @@ public struct EventCommandList public static LocalizedString label = @"Label: {00}"; + public static LocalizedString leftshiftvariable = @"Left Bit Shift {00}"; + public static LocalizedString levelup = @"Level Up Player"; public static LocalizedString linestart = @"@>"; @@ -1497,6 +1517,8 @@ public struct EventCommandList public static LocalizedString moverouteplayer = @"Player"; + public static LocalizedString multiplyvariable = @"Multiply {00}"; + public static LocalizedString notcommon = @"Cannot use this command in common events."; public static LocalizedString notcommoncaption = @"Common Event Warning!"; @@ -1534,6 +1556,8 @@ public struct EventCommandList public static LocalizedString restorempby = @"Adjust Player MP ({00})"; + public static LocalizedString rightshiftvariable = @"Right Bit Shift {00}"; + public static LocalizedString runcompletionevent = @"Running Completion Event"; public static LocalizedString selfswitch = @"Set Self Switch {00} to {01}"; @@ -2469,10 +2493,16 @@ public struct EventSetVariable public static LocalizedString numericadd = @"Add"; + public static LocalizedString numericdivide = @"Divide"; + + public static LocalizedString numericleftshift = @"LShift"; + public static LocalizedString numericcloneglobalvariablevalue = @"Global Variable Value: "; public static LocalizedString numericcloneplayervariablevalue = @"Player Variable Value: "; + public static LocalizedString numericmultiply = @"Multiply"; + public static LocalizedString numericrandom = @"Random"; public static LocalizedString numericrandomhigh = @"High:"; @@ -2481,6 +2511,8 @@ public struct EventSetVariable public static LocalizedString numericrandomdesc = @"Random Number:"; + public static LocalizedString numericrightshift = @"RShift"; + public static LocalizedString numericset = @"Set"; public static LocalizedString numericsubtract = @"Subtract"; diff --git a/Intersect.Editor/Properties/AssemblyInfo.cs b/Intersect.Editor/Properties/AssemblyInfo.cs index 294e3dc85b..bb98d9d33e 100644 --- a/Intersect.Editor/Properties/AssemblyInfo.cs +++ b/Intersect.Editor/Properties/AssemblyInfo.cs @@ -38,5 +38,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Network/ClientNetwork.cs b/Intersect.Network/ClientNetwork.cs index 3808b36aa9..83ee9b4d0a 100644 --- a/Intersect.Network/ClientNetwork.cs +++ b/Intersect.Network/ClientNetwork.cs @@ -5,6 +5,7 @@ using Intersect.Logging; using Intersect.Network.Events; +using Intersect.Network.Lidgren; using JetBrains.Annotations; diff --git a/Intersect.Network/Intersect.Network.csproj b/Intersect.Network/Intersect.Network.csproj index 7bb56f63fc..7ab8109b88 100644 --- a/Intersect.Network/Intersect.Network.csproj +++ b/Intersect.Network/Intersect.Network.csproj @@ -73,9 +73,9 @@ - - - + + + @@ -89,5 +89,6 @@ Intersect %28Core%29 + \ No newline at end of file diff --git a/Intersect.Network/LidgrenBuffer.cs b/Intersect.Network/Lidgren/LidgrenBuffer.cs similarity index 99% rename from Intersect.Network/LidgrenBuffer.cs rename to Intersect.Network/Lidgren/LidgrenBuffer.cs index f4ad88d1d6..521f702c07 100644 --- a/Intersect.Network/LidgrenBuffer.cs +++ b/Intersect.Network/Lidgren/LidgrenBuffer.cs @@ -5,7 +5,7 @@ using Lidgren.Network; -namespace Intersect.Network +namespace Intersect.Network.Lidgren { public class LidgrenBuffer : IBuffer diff --git a/Intersect.Network/LidgrenConnection.cs b/Intersect.Network/Lidgren/LidgrenConnection.cs similarity index 99% rename from Intersect.Network/LidgrenConnection.cs rename to Intersect.Network/Lidgren/LidgrenConnection.cs index 4b171f8fbf..a395c929cd 100644 --- a/Intersect.Network/LidgrenConnection.cs +++ b/Intersect.Network/Lidgren/LidgrenConnection.cs @@ -7,7 +7,7 @@ using Lidgren.Network; -namespace Intersect.Network +namespace Intersect.Network.Lidgren { public sealed class LidgrenConnection : AbstractConnection diff --git a/Intersect.Network/LidgrenInterface.cs b/Intersect.Network/Lidgren/LidgrenInterface.cs similarity index 99% rename from Intersect.Network/LidgrenInterface.cs rename to Intersect.Network/Lidgren/LidgrenInterface.cs index 359b92fe0e..ce44b7e3c1 100644 --- a/Intersect.Network/LidgrenInterface.cs +++ b/Intersect.Network/Lidgren/LidgrenInterface.cs @@ -15,7 +15,7 @@ using Lidgren.Network; -namespace Intersect.Network +namespace Intersect.Network.Lidgren { public sealed class LidgrenInterface : INetworkLayerInterface diff --git a/Intersect.Network/Properties/AssemblyInfo.cs b/Intersect.Network/Properties/AssemblyInfo.cs index 96c498904f..cc43036dab 100644 --- a/Intersect.Network/Properties/AssemblyInfo.cs +++ b/Intersect.Network/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Server/Database/GameData/Migrations/Beta6Migration.cs b/Intersect.Server/Database/GameData/Migrations/Beta6Migration.cs index f797d15ead..6bdb7f0100 100644 --- a/Intersect.Server/Database/GameData/Migrations/Beta6Migration.cs +++ b/Intersect.Server/Database/GameData/Migrations/Beta6Migration.cs @@ -204,11 +204,12 @@ private static void ParseJson(JToken obj) { try { - var newJson = FixJson(property.Value.ToString()); + var newJson = FixJson(property.Value?.ToString()); property.Value = newJson; } - catch (Exception ex) + catch { + // Not important to abort or log } } } @@ -695,7 +696,6 @@ private static byte[] ReencodeTileData(byte[] tileData) } return mCeras.Compress(Layers); - ; } private static byte[] Decompress(byte[] data) diff --git a/Intersect.Server/Entities/Events/CommandProcessing.cs b/Intersect.Server/Entities/Events/CommandProcessing.cs index 9cc0a7342c..0bf63d3d95 100644 --- a/Intersect.Server/Entities/Events/CommandProcessing.cs +++ b/Intersect.Server/Entities/Events/CommandProcessing.cs @@ -1507,6 +1507,25 @@ Event instance case Enums.VariableMods.Subtract: value.Integer -= mod.Value; + break; + case Enums.VariableMods.Multiply: + value.Integer *= mod.Value; + + break; + case Enums.VariableMods.Divide: + if (mod.Value != 0) //Idiot proofing divide by 0 LOL + { + value.Integer /= mod.Value; + } + + break; + case Enums.VariableMods.LeftShift: + value.Integer = value.Integer << (int)mod.Value; + + break; + case Enums.VariableMods.RightShift: + value.Integer = value.Integer >> (int)mod.Value; + break; case Enums.VariableMods.Random: //TODO: Fix - Random doesnt work with longs lolz @@ -1555,6 +1574,60 @@ Event instance value.Integer -= ssv.Value.Integer; } + break; + case Enums.VariableMods.MultiplyPlayerVar: + value.Integer *= player.GetVariableValue(mod.DuplicateVariableId).Integer; + + break; + case Enums.VariableMods.MultiplyGlobalVar: + var msv = ServerVariableBase.Get(mod.DuplicateVariableId); + if (msv != null) + { + value.Integer *= msv.Value.Integer; + } + + break; + case Enums.VariableMods.DividePlayerVar: + if (player.GetVariableValue(mod.DuplicateVariableId).Integer != 0) //Idiot proofing divide by 0 LOL + { + value.Integer /= player.GetVariableValue(mod.DuplicateVariableId).Integer; + } + + break; + case Enums.VariableMods.DivideGlobalVar: + var dsv = ServerVariableBase.Get(mod.DuplicateVariableId); + if (dsv != null) + { + if (dsv.Value != 0) //Idiot proofing divide by 0 LOL + { + value.Integer /= dsv.Value.Integer; + } + } + + break; + case Enums.VariableMods.LeftShiftPlayerVar: + value.Integer = value.Integer << (int)player.GetVariableValue(mod.DuplicateVariableId).Integer; + + break; + case Enums.VariableMods.LeftShiftGlobalVar: + var lhsv = ServerVariableBase.Get(mod.DuplicateVariableId); + if (lhsv != null) + { + value.Integer = value.Integer << (int)lhsv.Value.Integer; + } + + break; + case Enums.VariableMods.RightShiftPlayerVar: + value.Integer = value.Integer >> (int)player.GetVariableValue(mod.DuplicateVariableId).Integer; + + break; + case Enums.VariableMods.RightShiftGlobalVar: + var rhsv = ServerVariableBase.Get(mod.DuplicateVariableId); + if (rhsv != null) + { + value.Integer = value.Integer >> (int)rhsv.Value.Integer; + } + break; } diff --git a/Intersect.Server/Entities/Player.cs b/Intersect.Server/Entities/Player.cs index 62c97db995..feca3c026e 100644 --- a/Intersect.Server/Entities/Player.cs +++ b/Intersect.Server/Entities/Player.cs @@ -59,8 +59,6 @@ public partial class Player : Entity #endregion - public Player() { } - public static int OnlineCount => OnlinePlayers.Count; [JsonProperty("MaxVitals"), NotMapped] diff --git a/Intersect.Server/Networking/Helpers/PortChecker.cs b/Intersect.Server/Networking/Helpers/PortChecker.cs index f0038092e1..67566ca507 100644 --- a/Intersect.Server/Networking/Helpers/PortChecker.cs +++ b/Intersect.Server/Networking/Helpers/PortChecker.cs @@ -2,6 +2,8 @@ using System.Linq; using System.Net; +using Intersect.Logging; + using WebSocketSharp; namespace Intersect.Server.Networking.Helpers @@ -41,8 +43,9 @@ public static bool CanYouSeeMe(int port, out string externalIp) } } } - catch (Exception ex) + catch (Exception exception) { + Log.Debug(exception); } return false; diff --git a/Intersect.Server/Networking/Lidgren/ServerNetwork.cs b/Intersect.Server/Networking/Lidgren/ServerNetwork.cs index f83e09f1ef..0bc3e7d696 100644 --- a/Intersect.Server/Networking/Lidgren/ServerNetwork.cs +++ b/Intersect.Server/Networking/Lidgren/ServerNetwork.cs @@ -6,6 +6,7 @@ using Intersect.Logging; using Intersect.Network; using Intersect.Network.Events; +using Intersect.Network.Lidgren; using Intersect.Server.Entities; using JetBrains.Annotations; diff --git a/Intersect.Server/Networking/PacketHandler.cs b/Intersect.Server/Networking/PacketHandler.cs index 5f32d22a63..831504ca0a 100644 --- a/Intersect.Server/Networking/PacketHandler.cs +++ b/Intersect.Server/Networking/PacketHandler.cs @@ -1448,7 +1448,7 @@ public void HandlePacket(Client client, Player player, PartyInvitePacket packet) var target = Player.FindOnline(packet.TargetId); - if (target != null && target.Id != player.Id && player.InRangeOf(target, Options.PartyRange)) + if (target != null && target.Id != player.Id && player.InRangeOf(target, Options.PartyInviteRange)) { target.InviteToParty(player); diff --git a/Intersect.Server/Properties/AssemblyInfo.cs b/Intersect.Server/Properties/AssemblyInfo.cs index e881ac39c4..5de6cc8a7f 100644 --- a/Intersect.Server/Properties/AssemblyInfo.cs +++ b/Intersect.Server/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ // Revision // -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")] diff --git a/Intersect.Server/Web/RestApi/Attributes/ConfigurableAuthorizeAttribute.cs b/Intersect.Server/Web/RestApi/Attributes/ConfigurableAuthorizeAttribute.cs index a6981d8cd5..7b110a988a 100644 --- a/Intersect.Server/Web/RestApi/Attributes/ConfigurableAuthorizeAttribute.cs +++ b/Intersect.Server/Web/RestApi/Attributes/ConfigurableAuthorizeAttribute.cs @@ -18,11 +18,6 @@ namespace Intersect.Server.Web.RestApi.Attributes [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)] internal class ConfigurableAuthorizeAttribute : AuthorizeAttribute { - - public ConfigurableAuthorizeAttribute() : base() - { - } - [NotNull] protected IEnumerable InternalRoles => Roles?.Split(',').Where(role => !string.IsNullOrWhiteSpace(role)).Select(role => role.Trim()) ?? diff --git a/Intersect.Utilities/Properties/AssemblyInfo.cs b/Intersect.Utilities/Properties/AssemblyInfo.cs index d305dd269d..f15060d56f 100644 --- a/Intersect.Utilities/Properties/AssemblyInfo.cs +++ b/Intersect.Utilities/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.1.0")] -[assembly: AssemblyFileVersion("0.6.1.0")] +[assembly: AssemblyVersion("0.6.2.0")] +[assembly: AssemblyFileVersion("0.6.2.0")]