void EchoFilter_ServerDispatch(object sender, NetworkMessageEventArgs e)
        {
            try
            {
                if (!Settings.SettingsManager.Tinkering.AutoClickYes.Value)
                {
                    return;
                }

                if (e.Message.Type == 0xF7B0 && (int)e.Message["event"] == 0x0274 && e.Message.Value <int>("type") == 5)
                {
                    Match match = PercentConfirmation.Match(e.Message.Value <string>("text"));

                    if (match.Success)
                    {
                        int percent;

                        if (int.TryParse(match.Groups["percent"].Value, out percent) && percent >= MinimumYesPercent)
                        {
                            PostMessageTools.ClickYes();
                        }
                    }
                }
            }
            catch (Exception ex) { Debug.LogException(ex); }
        }
示例#2
0
 private void ClearFellowLandscape(NetworkMessageEventArgs e)
 {
     try
     {
        			FellowMemberList.Clear();
     } catch(Exception ex) {LogError(ex);}
 }
        public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
        {
            // When we login for the first time we get the following for messages in the following order

            if (e.Message.Type == 0xF658) // Character List (we get this when we log out a character as well)
            {
                zonename = Convert.ToString(e.Message["zonename"]);
            }

            if (e.Message.Type == 0xF7E1) // Server Name (we get this when we log out a character as well)
            {
                //getting the Server from the message, but then ignore it and set to the one we know works from the files
                server = Convert.ToString(e.Message["server"]);
                var launchInfo = LaunchControl.GetLaunchInfo();
                server = launchInfo.ServerName;
                log.WriteInfo("Server as retrieved from launchInfo: " + server);
            }

            // F7E5 - Unknown? (we only get this the first time we connect), E5 F7 00 00 01 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 01 00 00 00

            if (e.Message.Type == 0xF7EA) // Unknown? (we only get this the first time we connect), EA F7 00 0
            {
                launcherChooseCharTimer.Start();
            }
        }
示例#4
0
 private void a(object A_0, NetworkMessageEventArgs A_1)
 {
     try
     {
         if ((A_1.get_Message().get_Type() == 0xf7b0) && (((int)A_1.get_Message().get_Item("event")) == 0x2c0))
         {
             int key = (int)A_1.get_Message().Struct("fellow").get_Item("fellow");
             if (key != this.e.aw.get_CharacterFilter().get_Id())
             {
                 if (!this.i.ContainsKey(key))
                 {
                     this.i.Add(key, new eo.b());
                     if (dh.b(key))
                     {
                         this.i[key].j = PluginCore.cq.aw.get_WorldFilter().get_Item(key).get_Name();
                     }
                 }
                 this.i[key].a = DateTimeOffset.Now;
                 this.i[key].b = (int)A_1.get_Message().Struct("fellow").get_Item("maxHealth");
                 this.i[key].c = (int)A_1.get_Message().Struct("fellow").get_Item("maxStam");
                 this.i[key].d = (int)A_1.get_Message().Struct("fellow").get_Item("maxMana");
                 this.i[key].e = (int)A_1.get_Message().Struct("fellow").get_Item("curHealth");
                 this.i[key].f = (int)A_1.get_Message().Struct("fellow").get_Item("curStam");
                 this.i[key].g = (int)A_1.get_Message().Struct("fellow").get_Item("curMana");
             }
         }
     }
     catch (Exception exception)
     {
         ad.a(exception);
     }
 }
        public void Init(object sender, NetworkMessageEventArgs e)
        {
            try {
                int messageType = e.Message.Type;

                if (messageType == 63408 && e.Message.Value <int>("event") == 201)
                {
                    //_logger.Info($"MessageType: {messageType}");
                }

                if (e.Message.Type == 0xF755) // ApplyVisual, used to detect debuffs
                {
                    _processApplyVisual(e);
                }

                if (e.Message.Type == 0xF7B0) // Game Event
                {
                    _processGameEvent(e);
                }

                if (e.Message.Type == 414) // PlayerKilled
                {
                    _processPlayerKilled(e);
                }
            } catch (Exception ex) { _logger.Error(ex); }
        }
示例#6
0
 private void a(object A_0, NetworkMessageEventArgs A_1)
 {
     if ((PluginCore.cq.n.b && ((A_1.get_Message().get_Type() == 0xf7b0) && (A_1.get_Message().Value <int>("event") == 0x1c0))) && (this.a != 0))
     {
         if (!dh.a(this.a))
         {
             this.b(0);
         }
         else
         {
             int   num  = A_1.get_Message().Value <int>("object");
             float num2 = A_1.get_Message().Value <float>("health");
             if (num == this.a)
             {
                 string str = PluginCore.cq.p.d(this.a).g();
                 v      v   = PluginCore.cq.x.c["SpeciesMembers"].a(0, k.a(str));
                 if (v == null)
                 {
                     if (PluginCore.cq.p.d(num) != null)
                     {
                         PluginCore.cq.x.b(num);
                     }
                 }
                 else
                 {
                     this.f = DateTimeOffset.Now;
                     this.a((int)Math.Round((double)(num2 * k.e(v[2]))));
                 }
             }
         }
     }
 }
 public void FireServerDispatch(object sender, NetworkMessageEventArgs eventArgs)
 {
     if (this.ServerDispatch != null)
     {
         this.ServerDispatch(sender, eventArgs);
     }
 }
示例#8
0
        private void UpdateTargetVitals(NetworkMessageEventArgs e)
        {
            int         guid        = e.Message.Value <int>("object");
            WorldObject worldObject = lib.MyCore.WorldFilter[guid];

            if (worldObject == null)
            {
                return;
            }
            try
            {
                if (guid.Equals(lib.MyCore.Actions.CurrentSelection))
                {
                    bool flag = false;
                    if ((e.Message.Value <int>("flags") & 256) > 0)
                    {
                        int currentHealth  = e.Message.Value <int>("health");
                        int maxHealth      = e.Message.Value <int>("healthMax");
                        int currentStamina = e.Message.Value <int>("stamina");
                        int maxStamina     = e.Message.Value <int>("staminaMax");
                        int currentMana    = e.Message.Value <int>("mana");
                        int maxMana        = e.Message.Value <int>("manaMax");
                        TargetCache.AddOrUpdate(worldObject, currentHealth, maxHealth, currentStamina, maxStamina, currentMana, maxMana);
                        flag = true;
                    }
                    if (TargetSurface != null && flag)
                    {
                        TargetSurface.Invalidate();
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
示例#9
0
        /// <summary>
        /// Decal ServerDispatch event handler.  This is called when ac client recieves a network message.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
        {
            try {
                // see https://acemulator.github.io/protocol/ for protocol documentation
                switch (e.Message.Type)
                {
                case 0xF658:     // LoginCharacterSet S2C
                    AccountName = e.Message.Value <string>("zonename");
                    int           characterCount = e.Message.Value <int>("characterCount");
                    MessageStruct characters     = e.Message.Struct("characters");
                    Characters.Clear();

                    for (int i = 0; i < characterCount; i++)
                    {
                        int    id   = characters.Struct(i).Value <int>("character");
                        string name = characters.Struct(i).Value <string>("name");
                        Characters.Add(id, name);
                    }
                    break;

                case 0xF7E1:     // Login_WorldInfo
                    ServerName = e.Message.Value <string>("server");
                    break;
                }
            }
            catch (Exception ex) { Utils.LogException(ex); }
        }
示例#10
0
    private void b(NetworkMessageEventArgs A_0)
    {
        this.u   = new o();
        this.u.c = A_0.get_Message().Value <int>("merchant");
        this.u.d = A_0.get_Message().Value <int>("buyCategories");
        this.u.e = A_0.get_Message().Value <int>("unknown1");
        this.u.f = A_0.get_Message().Value <int>("buyValue");
        this.u.g = A_0.get_Message().Value <int>("unknown2");
        this.u.h = A_0.get_Message().Value <float>("buyRate");
        this.u.i = A_0.get_Message().Value <float>("sellRate");
        int num = A_0.get_Message().Value <int>("itemCount");

        for (int i = 0; i < num; i++)
        {
            cv            cv      = new cv();
            MessageStruct struct2 = A_0.get_Message().Struct("items").Struct(i);
            cv.u = struct2.Value <int>("count");
            cv.k = struct2.Value <int>("object");
            this.e(cv, struct2.Struct("game"));
            cv.v = true;
            this.u.a(cv);
        }
        if (this.t != null)
        {
            this.t(this, null);
        }
    }
 private void EchoCharacterSet(NetworkMessageEventArgs e)
 {
     try
     {
         _CharacterStats.Set(e);
     }catch(Exception ex){LogError(ex);}
 }
示例#12
0
 private void EchoFilter_ServerDispatch(object sender, NetworkMessageEventArgs e)
 {
     try
     {
         if (e != null && e.Message != null)
         {
             int type = e.Message.Type;
             if (type <= 63301)
             {
                 if (type == 699)
                 {
                     this.SpellCasting(e);
                 }
             }
             else if (type != 63317)
             {
                 if (type == 63408)
                 {
                     if (e.Message.Value <int>("event") == 201)
                     {
                         this.UpdateTargetVitals(e);
                     }
                 }
             }
             else if (e != null)
             {
                 this.ApplyEffect(e);
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
示例#13
0
 private void ApplyEffect(NetworkMessageEventArgs e)
 {
     try
     {
         int effect = e.Message.Value <int>("effect");
         int guid   = e.Message.Value <int>("object");
         if (lib.MyCore.WorldFilter[guid] != null)
         {
             WorldObject worldObject = lib.MyCore.WorldFilter[guid];
             bool        flag        = true;
             if (worldObject.ObjectClass == ObjectClass.Player)
             {
                 flag = false;
             }
             if (!flag)
             {
                 if (worldObject.Id != lib.MyID)
                 {
                     DebuffInfo debuff = this.DebuffDB.GetDebuff(effect);
                     if (debuff != null)
                     {
                         this.TargetCache.AddOrUpdate(worldObject, debuff.DisplayName, debuff.DefaultDuration);
                         this.MaintainDebuffIcons(worldObject.Id);
                         if (lib.MyHost.Actions.CurrentSelection == worldObject.Id && this.TargetSurface != null)
                         {
                             this.TargetSurface.Invalidate();
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex) { Repo.RecordException(ex); }
 }
示例#14
0
 /// <summary>
 /// 房间信息修改提示回调
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void roomInfoChangeNotifyCallBack(object sender, NetworkMessageEventArgs e)
 {
     Protocol.S2CSRoomInfoChangeNotify response = NetworkEvent.parseMessage <Protocol.S2CSRoomInfoChangeNotify>(e.message);
     if (response.room_id <= listView1.Items.Count)
     {
         //room id 的索引是从1开始
         ListViewItem lvi = listView1.Items[(int)response.room_id - 1];
         if (response.room_name != null)
         {
             lvi.SubItems[1].Text = response.room_name;
         }
         if (response.players_count != 0)
         {
             lvi.SubItems[2].Text = response.players_count.ToString();
         }
         if (response.@public)
         {
             lvi.SubItems[3].Text = "公开";
         }
         else
         {
             lvi.SubItems[3].Text = "不公开";
         }
     }
 }
示例#15
0
        public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
        {
            if (e.Message.Type == 0xF7C8) // Enter Game
            {
                freshLogin = true;
                try
                {
                    LaunchControl.RecordLaunchResponse(DateTime.UtcNow);
                }
                catch
                {
                    log.WriteInfo("FilterCore_ClientDispatch: Exception trying to record launch response");
                }
                Heartbeat.LaunchHeartbeat();
            }

            if (freshLogin && e.Message.Type == 0xF7B1 && Convert.ToInt32(e.Message["action"]) == 0xA1)             // Character Materialize (Any time is done portalling in, login or portal)
            {
                freshLogin = false;

                if (loginMessageQueue.Count > 0)
                {
                    sendingLastEnter = false;
                    CoreManager.Current.RenderFrame += new EventHandler <EventArgs>(Current_RenderFrame);
                }
            }
        }
示例#16
0
    private void f(NetworkMessageEventArgs A_0)
    {
        int num = A_0.get_Message().Value <int>("object");
        cv  n   = new cv();

        if ((num == this.o) && (this.n != null))
        {
            n      = this.n;
            this.n = null;
        }
        MessageStruct struct2 = A_0.get_Message().Struct("game");
        MessageStruct struct3 = A_0.get_Message().Struct("model");
        MessageStruct struct4 = A_0.get_Message().Struct("physics");

        n.k = num;
        this.e(n, struct2);
        this.d(n, struct3);
        this.c(n, struct4);
        if ((struct2.Value <int>("behavior") & 0x1000) != 0)
        {
            n.l = (struct4.Value <int>("unknown") & 4) > 0;
        }
        this.e(n);
        this.c(n);
        if (this.b != null)
        {
            this.b(n);
        }
    }
示例#17
0
 public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
 {
     if (e.Message.Type == 0xF7C8)             // Enter Game - Big Login button clicked
     {
         loginRetryTimer.Stop();
     }
 }
示例#18
0
    private void p(NetworkMessageEventArgs A_0)
    {
        int o    = this.o;
        int num2 = A_0.get_Message().Value <int>("key");
        int num3 = A_0.get_Message().Value <int>("value");

        if (this.i.ContainsKey(o))
        {
            int num4 = num2;
            dt  dt   = (dt)num2;
            if (dt == dt.f)
            {
                this.i[o].a[0xd000010] = num3;
                num4 = 0xd000010;
            }
            else
            {
                this.i[o].a[num2] = num3;
            }
            if (this.e != null)
            {
                this.e(this.i[o]);
            }
            if (this.g != null)
            {
                this.g(this.i[o], (dt)num4);
            }
        }
    }
示例#19
0
        public static void ServerDispatch_DeathFilter(object sender, NetworkMessageEventArgs e)
        {
            try
            {
                int num = e.Message.Type;
                if (num == 414)
                {
                    int killed = e.Message.Value <int>("killed");
                    int killer = e.Message.Value <int>("killer");
                    if (killed == lib.MyID)
                    {
                        WorldObject obj = lib.MyCore.WorldFilter[killer];
                        if (lib.Mode == 3)
                        {
                            if (lib.UseAlertDA == true)
                            {
                                Utility.InvokeTextA("Killed by " + obj.Name + " detected, Logging off!");
                            }
                            lib.reason = "death by " + obj.Name;
                            LogMethod.Logout();
                        }
                        else if (lib.Mode != 3)
                        {
                            if (lib.MyCore.CharacterFilter.Vitae >= 10)
                            {
                                lib.reason = "death by " + obj.Name;
                                Vitae.VitaeInit();
                                Report.LogEvent("Death");
                            }
                        }

                        if (obj.ObjectClass == ObjectClass.Player)
                        {
                            if (DthTmr1.Enabled == true)
                            {
                                DthTmr1.Tick -= DthTmr_Tick;
                                DthTmr1.Stop();
                                DthTmr1.Dispose();
                            }

                            if (DthTmr2.Enabled == true)
                            {
                                DthTmr2.Tick -= DthTmr_Tick2;
                                DthTmr2.Stop();
                                DthTmr2.Dispose();
                            }

                            if (DthTmr1.Enabled == false)
                            {
                                DthTmr1.Interval = 290000;
                                DthTmr1.Tick    += DthTmr_Tick;
                                DthTmr1.Start();
                            }
                        }
                    }
                }
            }
            catch (Exception ex) { Repo.RecordException(ex); }
        }
 private void EchoAddFellow(NetworkMessageEventArgs e)
 {
     try
     {
         _FellowInfo.AddFellow(e.Message.Struct("fellow"));
         AetherCore.Events.SendFellowChange(e);
     }catch(Exception ex){LogError(ex);}
 }
示例#21
0
 void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
 {
     try
     {
         LogMessage(MessageDirection.Inbound, e.Message);
     }
     catch { }
 }
		public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
		{
			if (loginMessageQueue.Count > 0 && e.Message.Type == 0xF7B1 && Convert.ToInt32(e.Message["action"]) == 0xA1)
			{
				sendingLastEnter = false;
				CoreManager.Current.RenderFrame += new EventHandler<EventArgs>(Current_RenderFrame);
			}
		}
示例#23
0
    private void k(NetworkMessageEventArgs A_0)
    {
        int num  = A_0.get_Message().Value <int>("object");
        int num2 = A_0.get_Message().Value <int>("key");
        int num3 = A_0.get_Message().Value <int>("value");

        this.b(num, num2, num3);
    }
示例#24
0
		public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			if (e.Message.Type == 0xF659) // One of your characters is still in the world. Please try again in a few minutes.
			{
				loginRetryTimer.Interval = 100;
				loginRetryTimer.Start();
			}
		}
示例#25
0
 private static void a(object A_0, NetworkMessageEventArgs A_1)
 {
     if ((((c && (A_1.get_Message().get_Type() == 0xf74c)) && (A_1.get_Message().Value <int>("object") == PluginCore.cg)) && (A_1.get_Message().Value <byte>("animation_type") == 0)) && (A_1.get_Message().Value <uint>("flags") == 0))
     {
         b = DateTimeOffset.Now;
         c = false;
     }
 }
示例#26
0
		public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
		{
			if (e.Message.Type == 0xF7C8) // Enter Game - Big Login button clicked
			{
				loginRetryTimer.Interval = 1;
				loginRetryTimer.Stop();
			}
		}
 public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
 {
     if (loginMessageQueue.Count > 0 && e.Message.Type == 0xF7B1 && Convert.ToInt32(e.Message["action"]) == 0xA1)
     {
         sendingLastEnter = false;
         CoreManager.Current.RenderFrame += new EventHandler <EventArgs>(Current_RenderFrame);
     }
 }
示例#28
0
    private void j(NetworkMessageEventArgs A_0)
    {
        int o    = this.o;
        int num2 = A_0.get_Message().Value <int>("key");
        int num3 = A_0.get_Message().Value <int>("value");

        this.a(o, num2, num3);
    }
 public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
 {
     if (e.Message.Type == 0xF659)             // One of your characters is still in the world. Please try again in a few minutes.
     {
         Debug.LogText("One of my characters is still in the world =(");
         loginRetryTimer.Interval = 500;
         loginRetryTimer.Start();
     }
 }
		public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			// When we logout we get the following messages in order
			// =========================================================================================
			// 0xF658 Character List (we get this when we log out a character as well)

			if (e.Message.Type == 0xF7E1) // Server Name (we get this when we log out a character as well)
				loginNextCharTimer.Start();
		}
示例#31
0
		void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
		{
			try
			{
				autoRetryLogin.FilterCore_ClientDispatch(sender, e);
				loginMessageQueueManager.FilterCore_ClientDispatch(sender, e);
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
        private void EchoCreateFellow(NetworkMessageEventArgs e)
        {
            try
            {
                _FellowInfo = new FellowInfoClass(e);

                AetherCore.Events.SendFellowChange(e);
            }catch(Exception ex){LogError(ex);}
        }
示例#33
0
        /// <summary>
        /// Parses the client messages.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
        {
            if (e.Message.Type.Equals(0xF7B1))
            {
                // Materialize character (including any portal taken)
                if (e.Message.Value <int>("action").Equals(0x00A1))
                {
                    if (Machine == null)
                    {
                        Debug.Init(Path);
                        Machine = new Machine(Core, Path);
                    }

                    if (!Machine.LoggedIn)
                    {
                        CommandLineText          += Machine.Interpreter.Command;
                        Machine.AccountCharacters = AccountCharacters;
                        Machine.Core = Core;

                        // Instantiate views
                        Machine.BotManagerView = new BotManagerView(Machine);

                        Machine.CharacterEquipment.Clear();
                        Machine.FinishedInitialScan    = false;
                        Machine.Enabled                = Machine.Utility.BotSettings.BotEnabled;
                        Machine.LoggedIn               = true;
                        Core.RenderFrame              += Machine.Clock;
                        Core.WorldFilter.ChangeObject += Machine.WorldFilter_ChangeObject;

                        Debug.ToChat($"Running ACManager {Machine.Utility.Version} by Shem of Harvestgain (now Coldeve). Check out the latest on the project at https://github.com/patri0t86/ACManager.");
                        Debug.ToChat("Scanning inventory, please wait before using the Equipment manager to build suits...");

                        using (WorldObjectCollection inventory = Core.WorldFilter.GetInventory())
                        {
                            foreach (WorldObject item in inventory)
                            {
                                if (item.ObjectClass.Equals(ObjectClass.Armor) ||
                                    item.ObjectClass.Equals(ObjectClass.Jewelry) ||
                                    item.ObjectClass.Equals(ObjectClass.Clothing) ||
                                    item.ObjectClass.Equals(ObjectClass.WandStaffOrb))
                                {
                                    Machine.CharacterEquipment.Add(item);
                                    Core.Actions.RequestId(item.Id);
                                }
                            }
                        }
                    }
                }

                // Start casting
                if (Convert.ToInt32(e.Message.Value <int>("action")).Equals(0x004A))
                {
                    Machine.CastStarted = true;
                }
            }
        }
示例#34
0
    private void b(object A_0, NetworkMessageEventArgs A_1)
    {
        if (A_1.get_Message().get_Type() == 0xf7b1)
        {
            int num2 = A_1.get_Message().Value <int>("action");
            if (num2 <= 200)
            {
                switch (num2)
                {
                case 0x53:
                case 0x54:
                case 0x55:
                case 0x56:
                case 200:
                case 8:
                case 9:
                case 0x19:
                case 0x1a:
                case 0x1b:
                    return;

                case 0x4a:
                    this.a();
                    return;

                case 10:
                    this.c = DateTimeOffset.Now;
                    return;

                case 0x35:
                    this.a();
                    return;

                case 0x36:
                    this.a();
                    return;
                }
            }
            else if (num2 <= 0x1bf)
            {
                if (((num2 == 0xcd) || (num2 == 0x1b7)) || (num2 == 0x1bf))
                {
                }
            }
            else
            {
                switch (num2)
                {
                case 0x263:
                case 0xf61c:
                case 0xf753:
                    return;
                }
            }
        }
    }
        private void _processGameEvent(NetworkMessageEventArgs e)
        {
            int gameEvent = e.Message.Value <int>("event");

            if (gameEvent == 201) // IdentifyObject
            {
                return;
            }
            //_processIndentifyObject(e);
        }
示例#36
0
 void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
 {
     try
     {
         autoRetryLogin.FilterCore_ClientDispatch(sender, e);
         loginCompleteMessageQueueManager.FilterCore_ClientDispatch(sender, e);
         afterLoginCompleteMessageQueueManager.FilterCore_ClientDispatch(sender, e);
     }
     catch (Exception ex) { Debug.LogException(ex); }
 }
        public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
        {
            if (e.Message.Type == 0xF7C8)             // Enter Game - Big Login button clicked
            {
                Debug.LogText("I hit the \"Enter Game\" Button!  Yay!");

                loginRetryTimer.Interval = 1;
                loginRetryTimer.Stop();
            }
        }
示例#38
0
    private void e(NetworkMessageEventArgs A_0)
    {
        int key = A_0.get_Message().Value <int>("object");

        if (this.i.ContainsKey(key))
        {
            cv            cv      = this.i[key];
            MessageStruct struct2 = A_0.get_Message().Struct("position");
            this.a(cv, struct2);
        }
    }
        public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
        {
            // When we logout we get the following messages in order
            // =========================================================================================
            // 0xF658 Character List (we get this when we log out a character as well)

            if (e.Message.Type == 0xF7E1)             // Server Name (we get this when we log out a character as well)
            {
                loginNextCharTimer.Start();
            }
        }
示例#40
0
 private void r(NetworkMessageEventArgs A_0)
 {
     try
     {
         this.b(A_0.get_Message().Value <int>("object"));
     }
     catch (Exception exception)
     {
         this.q(exception, null);
     }
 }
示例#41
0
		void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			try
			{
				autoRetryLogin.FilterCore_ServerDispatch(sender, e);
				loginCharacterTools.FilterCore_ServerDispatch(sender, e);

				defaultFirstCharacterManager.FilterCore_ServerDispatch(sender, e);
				loginNextCharacterManager.FilterCore_ServerDispatch(sender, e);
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
 private void EchoCharacterList(NetworkMessageEventArgs e)
 {
     try
     {
         int CharacterCount = e.Message.Value<int>("characterCount");
         MessageStruct CharacterStruct = e.Message.Struct("characters");
         _ServerInfo.ServerCharacterList.Clear();
         for(int i = 0; i < CharacterCount; i++)
         {
             _ServerInfo.ServerCharacterList.Add(new ServerInfoClass.Characters(CharacterStruct.Struct(i).Value<int>("character"), CharacterStruct.Struct(i).Value<string>("name")));
         }
     }catch(Exception ex){LogError(ex);}
 }
		public void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			// When we login for the first time we get the following for messages in the following order

			if (e.Message.Type == 0xF658) // Character List (we get this when we log out a character as well)
				zonename = Convert.ToString(e.Message["zonename"]);

			if (e.Message.Type == 0xF7E1) // Server Name (we get this when we log out a character as well)
				server = Convert.ToString(e.Message["server"]);

			// F7E5 - Unknown? (we only get this the first time we connect), E5 F7 00 00 01 00 00 00 01 00 00 00 01 00 00 00 02 00 00 00 00 00 00 00 01 00 00 00 

			if (e.Message.Type == 0xF7EA) // Unknown? (we only get this the first time we connect), EA F7 00 0
				defaultFirstCharTimer.Start();
		}
示例#44
0
 private void AddFellowLandscape(NetworkMessageEventArgs e)
 {
     try
     {
         int fellow = (int)e.Message.Struct("fellow")["fellow"];
         if(fellow != Core.CharacterFilter.Id)
         {
             if(!FellowMemberList.Any(x => x.Id == fellow))
             {
                 FellowMember fella = new FellowMember();
                 fella.Id = fellow;
                 fella.Name = (string)e.Message.Struct("fellow")["name"];
                 FellowMemberList.Add(fella);
             }
         }
     }catch(Exception ex) {LogError(ex);}
 }
        internal FellowInfoClass(NetworkMessageEventArgs e)
        {
            _FellowCount = e.Message.Value<int>("fellowCount");
            _FellowName = e.Message.Value<string>("name");
            _LeaderId = e.Message.Value<int>("leader");
            _ShareXP = e.Message.Value<bool>("shareXP");
            _OpenFellow = e.Message.Value<bool>("open");

            MessageStruct FellowMessage = e.Message.Struct("fellows");

            for(int i = 0; i < FellowMessage.Count; i++)
            {
                MessageStruct FellowStruct = FellowMessage.Struct(i).Struct("fellow");
                int FellowMemberId = FellowStruct.Value<int>("fellow");
                FellowMember CurrentMember = _FellowMembers.Find(x => x.Id == FellowMemberId);
                _FellowMembers.Add(new FellowMember(FellowStruct));
            }
        }
示例#46
0
        internal void WriteObject(NetworkMessageEventArgs obj, string eventDisplayName)
        {
            if (ActiveSettings.Instance.DebugLevel == DebugLevel.None)
                return;

            lock (this._writeLock)
            {
                using (StreamWriter stream = new StreamWriter(this._currentPath, true))
                {
                    this.LogRawMessage(this.FormatWithPrefix(eventDisplayName), stream);
                    // Format as hex so that it's easy to pair up with the decal doc
                    this.LogRawMessage(string.Format("  Message.Type = {0}", obj.Message.Type.ToString("X4")), stream);

                    //this.WriteCurrentStateStuff(stream, false);

                    this.LogRawMessage("", stream);
                }
            }
        }
示例#47
0
		internal void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			if (e.Message.Type == 0xF658) // Character List
			{
				characterSlots = Convert.ToInt32(e.Message["slotCount"]);

				characters.Clear();

				MessageStruct charactersStruct = e.Message.Struct("characters");

				for (int i = 0; i < charactersStruct.Count; i++)
				{
					int character = Convert.ToInt32(charactersStruct.Struct(i)["character"]);
					string name = Convert.ToString(charactersStruct.Struct(i)["name"]);
					int deleteTimeout = Convert.ToInt32(charactersStruct.Struct(i)["deleteTimeout"]);

					characters.Add(new Character(character, name, deleteTimeout));
				}

				characters.Sort((a, b) => String.Compare(a.Name, b.Name, StringComparison.Ordinal));
			}
		}
		void EchoFilter_ServerDispatch(object sender, NetworkMessageEventArgs e)
		{
			try
			{
				if (!Settings.SettingsManager.Tinkering.AutoClickYes.Value)
					return;

				if (e.Message.Type == 0xF7B0 && (int)e.Message["event"] == 0x0274 && e.Message.Value<int>("type") == 5)
				{
					Match match = PercentConfirmation.Match(e.Message.Value<string>("text"));

					if (match.Success)
					{
						int percent;

						if (int.TryParse(match.Groups["percent"].Value, out percent) && percent >= MinimumYesPercent)
							PostMessageTools.ClickYes();
					}
				}
			}
			catch (Exception ex) { Debug.LogException(ex); }
		}
示例#49
0
        private void CreateorJoinFellowLandscape(NetworkMessageEventArgs e)
        {
            try
               		{
               			FellowMemberList.Clear();
               			var fellowmembers = e.Message.Struct("fellows");
               			int fellowcount = (int)e.Message.Value<int>("fellowCount");
               			for(int i = 0; i < fellowcount; i++)
               			{
               				var fellow = fellowmembers.Struct(i).Struct("fellow");
               				if((string)fellow.Value<string>("name") != Core.CharacterFilter.Name)
               				{
               					FellowMember fella = new FellowMember();
               					fella.Name = (string)fellow.Value<string>("name");
               					fella.Id = (int)fellow.Value<int>("fellow");
               					if((int)fellow.Value<int>("shareLoot") == 1) {fella.Looting = true;}

               					FellowMemberList.Add(fella);
               				}
               			}

               		}catch(Exception ex) {LogError(ex);}
        }
        private void EchoChatMessage(NetworkMessageEventArgs e)
        {
            try
            {

                //LogToFile("Echo Chat Fires");
                //LogToFile("Type from .Type = " + e.Message.Type);

            //				int type = e.Message.Value<int>("type");
            //				//LogToFile("Message type = " + type);
            //				if((type & 0x1) != 0)
            //				{
            //					LogToFile("Channel = " + e.Message.Value<string>("channel") + ", Text = " + e.Message.Value<string>("text"));
            //				}
            //				if(e.Message.Value<int>("type") == 0x11) //Select Spell Messages
            //				{
            //					string Text = e.Message.Value<string>("text").Trim();
            //					Text = Text.Substring(Text.IndexOf(','));
            //					LogToFile(Text);
            //
            //					 //Irquk says, "Equin Opaj"
            //				}
            }catch(Exception ex){LogError(ex);}
        }
        public void Update(NetworkMessageEventArgs CreateMsg)
        {
            LogTime = DateTime.Now.ToString();

                MessageStruct GameData = CreateMsg.Message.Struct("game");
                StringVals.Add(new KeyString((int)StringValueKey.Name, GameData.Value<string>("name")));
                LongVals.Add(new KeyLong((int)LongValueKey.Type, GameData.Value<long>("type")));
                LongVals.Add(new KeyLong((int)LongValueKey.Icon, GameData.Value<long>("icon")));
                LongVals.Add(new KeyLong((int)LongValueKey.Category, GameData.Value<long>("category")));
                LongVals.Add(new KeyLong((int)LongValueKey.Behavior, GameData.Value<long>("behavior")));

                int flags1 = GameData.Value<int>("flags1");
                if(flags1 != 0) {LongVals.Add(new KeyLong((int)LongValueKey.CreateFlags1, flags1));}
                int flags2 = 0;
                if((GameData.Value<int>("behavior") & 0x04000000) != 0){flags2 = GameData.Value<int>("flags2");}
                if(flags2 != 0) {LongVals.Add(new KeyLong((int)LongValueKey.CreateFlags2, flags2));}

                if((flags1 & 0x1) != 0) {StringVals.Add(new KeyString((int)StringValueKey.SecondaryName, GameData.Value<string>("namePlural")));}
                if((flags1 & 0x2) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.ItemSlots, GameData.Value<long>("itemSlots")));}
                if((flags1 & 0x4) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.PackSlots, GameData.Value<long>("packSlots")));}
                if((flags1 & 0x8) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Value, GameData.Value<long>("value")));}
                if((flags1 & 0x10) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown10, GameData.Value<long>("unknown10")));}
                if((flags1 & 0x20) != 0) {DoubleVals.Add(new KeyDouble((int)DoubleValueKey.ApproachDistance, GameData.Value<double>("approachDistance")));}
                if((flags1 & 0x40) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Monarch, GameData.Value<long>("monarch")));}
                if((flags1 & 0x80) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconOutline, GameData.Value<long>("iconHighlight")));}
                if((flags1 & 0x100) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.MissileType, GameData.Value<long>("ammunition")));}
                if((flags1 & 0x200) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquipType, GameData.Value<long>("wieldType")));}
                if((flags1 & 0x400) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsesRemaining, GameData.Value<long>("uses")));}
                if((flags1 & 0x800) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsesTotal, GameData.Value<long>("usesLimit")));}
                if((flags1 & 0x1000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.StackCount, GameData.Value<long>("stack")));}
                if((flags1 & 0x2000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.StackMax, GameData.Value<long>("stackLimit")));}
                if((flags1 & 0x4000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Container, GameData.Value<long>("container")));}
                if((flags1 & 0x8000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Container, GameData.Value<long>("equipper")));}
                if((flags1 & 0x10000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquipableSlots, GameData.Value<long>("equipPossible")));}
                if((flags1 & 0x20000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquippedSlots, GameData.Value<long>("equipActual")));}
                if((flags1 & 0x40000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Coverage, GameData.Value<long>("coverage")));}
                if((flags1 & 0x80000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsageMask, GameData.Value<long>("useableOn")));}
                if((flags1 & 0x100000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown100000, GameData.Value<long>("unknown100000")));}
                if((flags1 & 0x200000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Burden, GameData.Value<long>("burden")));}
                if((flags1 & 0x400000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.AssociatedSpell, GameData.Value<long>("spell")));}
                if((flags1 & 0x800000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown800000, GameData.Value<long>("unknown800000")));}
                if((flags1 & 0x1000000) != 0) {DoubleVals.Add(new KeyDouble((int)DoubleValueKey.SalvageWorkmanship, GameData.Value<double>("workmanship")));}
                if((flags1 & 0x2000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HouseOwner, GameData.Value<long>("owner")));}
                //0x4000000 is dwelling properties for access level
                if((flags1 & 0x8000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown8000000, GameData.Value<long>("unknown8000000")));}
                if((flags1 & 0x10000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HookMask, GameData.Value<long>("hookableOn")));}
                if((flags1 & 0x20000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HookType, GameData.Value<long>("hookType")));}
                if((flags1 & 0x40000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconOverlay, GameData.Value<long>("iconOverlay")));}
                if((flags1 & 0x80000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Material, GameData.Value<long>("material")));}

                if((flags2 & 0x4000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconUnderlay, GameData.Value<long>("iconUnderlay")));}

                MessageStruct ModelData = CreateMsg.Message.Struct("model");

                int PaletteCount = ModelData.Value<int>("paletteCount");
                Palettes.Clear();

                if(PaletteCount != 0)
                {
                    MessageStruct PaletteData = ModelData.Struct("palettes");
                    for(int i = 0; i < PaletteCount; i++)
                    {
                        Palettes.Add(PaletteData.Struct(i).Value<int>("palette"));
                    }
                }

                int TextureCount = ModelData.Value<int>("textureCount");
                Textures.Clear();
                if(TextureCount != 0)
                {
                    MessageStruct TextureData = ModelData.Struct("textures");
                    for(int i = 0; i < TextureCount; i++)
                    {
                        txture tmptxture = new txture();
                        tmptxture.Index = TextureData.Struct(i).Value<int>("index");
                        tmptxture.Old = TextureData.Struct(i).Value<int>("old");
                        tmptxture.New = TextureData.Struct(i).Value<int>("new");
                        Textures.Add(tmptxture);
                    }
                }

                int ModelCount = ModelData.Value<int>("modelCount");
                Models.Clear();
                if(ModelCount != 0)
                {
                    MessageStruct modelData = ModelData.Struct("models");
                    for(int i = 0; i < ModelCount; i++)
                    {
                        model mod = new model();
                        mod.Index = modelData.Struct(i).Value<int>("index");
                        mod.Model = modelData.Struct(i).Value<int>("model");
                        Models.Add(mod);
                    }
                }

                LongVals.Add(new KeyLong((int)LongValueKey.PhysicsDataFlags, CreateMsg.Message.Struct("physics").Value<int>("flags")));
                //Physics not decoded at this time
        }
示例#52
0
 internal void SendCharChange(NetworkMessageEventArgs e)
 {
     OnCharacterStatsChanged(e);
 }
示例#53
0
        private void RemoveFellowLandscape(NetworkMessageEventArgs e)
        {
            try
            {
                int fellow = (int)e.Message.Value<int>("fellow");

                if(fellow == Core.CharacterFilter.Id)
                {
                    FellowMemberList.Clear();
                }
                else
                {
                    FellowMemberList.RemoveAll(x => x.Id == fellow);
                }
            } catch(Exception ex){LogError(ex);}
        }
示例#54
0
 internal void SendWOSChange(int ObjectId, NetworkMessageEventArgs e)
 {
     OnWorldObjectSerialChanged(ObjectId, e);
 }
示例#55
0
 private void ServerDispatchFellow(object sender, NetworkMessageEventArgs e)
 {
     int iEvent = 0;
     try
     {
         if(e.Message.Type == EchoConstants.AC_GAME_EVENT)
         {
             try
             {
                 iEvent = (int)e.Message["event"];
             }
             catch{}
             if(iEvent == EchoConstants.GE_ADD_FELLOWMEMBER)
             {
                 AddFellowLandscape(e);
             }
             if(iEvent == EchoConstants.GE_FELLOWSHIP_MEMBER_QUIT || iEvent == EchoConstants.GE_FELLOWSHIP_MEMBER_DISMISSED)
             {
                 RemoveFellowLandscape(e);
             }
             if(iEvent == EchoConstants.GE_DISBAND_FELLOWSHIP)
             {
                 ClearFellowLandscape(e);
             }
             if(iEvent == EchoConstants.GE_CREATE_FELLOWSHIP)
             {
                 CreateorJoinFellowLandscape(e);
             }
         }
     }
     catch (Exception ex){LogError(ex);}
 }
        public void Set(NetworkMessageEventArgs e)
        {
            int key;
                int vital;
                KeyLong LongKey;
                KeyBool BoolKey;
                KeyString StringKey;
                KeyQuad QuadKey;
                KeySkill SkillKey;
                CharKeyAttribute AttribKey;

                switch(e.Message.Type)
                {
                    case MessageType.AC_SET_CHARACTER_DWORD:
                        key =  e.Message.Value<int>("key");
                        LongKey = LongVals.Where(x => x.Key == key).FirstOrDefault();
                        if(LongKey != null) {LongKey.Val = e.Message.Value<long>("value");}
                        else{LongVals.Add(new KeyLong(key, e.Message.Value<long>("value")));}
                        return;

                    case MessageType.AC_SET_CHARACTER_QWORD:
                        key =  e.Message.Value<int>("key");
                        QuadKey = QuadVals.Where(x => x.Key == key).FirstOrDefault();
                        if(QuadKey != null) {QuadKey.Val = e.Message.Value<long>("value");}
                        else{QuadVals.Add(new KeyQuad(key, e.Message.Value<long>("value")));}
                        return;

                    case MessageType.AC_SET_CHARACTER_BOOLEAN:
                        key =  e.Message.Value<int>("key");
                        BoolKey = BoolVals.Where(x => x.Key == key).FirstOrDefault();
                        if(BoolKey != null) {BoolKey.Val = e.Message.Value<bool>("value");}
                        else{BoolVals.Add(new KeyBool(key, e.Message.Value<bool>("value")));}
                        return;

                    case MessageType.AC_SET_CHARACTER_SKILL_LEVEL:
                        key = e.Message.Value<int>("key");
                        MessageStruct SkillStruct = e.Message.Struct("value");
                        SkillKey = SkillVals.Where(x => x.Key == key).FirstOrDefault();
                        if(SkillKey == null){SkillVals.Add(new KeySkill(key)); SkillKey = SkillVals.Where(x => x.Key == key).First();}
                        SkillKey.Raised = SkillStruct.Value<int>("raised");
                        SkillKey.Unk1 = SkillStruct.Value<int>("unknown1");
                        SkillKey.State = SkillStruct.Value<int>("state");
                        SkillKey.XP = SkillStruct.Value<int>("xp");
                        SkillKey.Bonus = SkillStruct.Value<int>("bonus");
                        SkillKey.Diff = SkillStruct.Value<int>("diff");
                        SkillKey.Unk2 = SkillStruct.Value<double>("unknown2");
                        return;

                    case MessageType.AC_SET_CHARACTER_SKILL_STATE:
                        key = e.Message.Value<int>("key");
                        SkillKey = SkillVals.Where(x => x.Key == key).FirstOrDefault();
                        if(SkillKey != null){SkillKey.State = e.Message.Value<int>("value");}
                        else{SkillVals.Add(new KeySkill(key, e.Message.Value<int>("value")));}
                        return;

                    case MessageType.AC_SET_CHARACTER_ATTRIBUTE:
                        key = e.Message.Value<int>("key");
                        MessageStruct AttribStruct = e.Message.Struct("value");
                        AttribKey = AttributeVals.Where(x => x.Key == key).FirstOrDefault();
                        if(AttribKey == null)
                        {
                            AttributeVals.Add(new CharKeyAttribute(key));
                            AttribKey = AttributeVals.Where(x => x.Key == key).First();
                        }
                        AttribKey.Raised = AttribStruct.Value<int>("raised");
                        AttribKey.Innate = AttribStruct.Value<int>("innate");
                        AttribKey.XP = AttribStruct.Value<long>("xp");
                        return;

                        //Max values
                    case MessageType.AC_SET_CHARACTER_VITAL:
                        key = 0;
                        vital = e.Message.Value<int>("key");
                        if(vital == 1) key = (int)ACharAttributeKeys.Health;
                        if(vital == 3) key = (int)ACharAttributeKeys.Stamina;
                        if(vital == 5) key = (int)ACharAttributeKeys.Mana;
                        if(key == 0){return;}
                        MessageStruct VitalStruct = e.Message.Struct("value");
                        AttribKey = AttributeVals.Where(x => x.Key == key).FirstOrDefault();
                        if(AttribKey != null)
                        {
                            AttribKey.Update(VitalStruct.Value<int>("raised"), 0, VitalStruct.Value<long>("xp"), VitalStruct.Value<int>("current"));

                        }else{AttributeVals.Add(new CharKeyAttribute(key, VitalStruct.Value<int>("raised"), 0, VitalStruct.Value<long>("xp"), VitalStruct.Value<int>("current")));}
                        return;

                        //current values
                    case MessageType.AC_SET_CHARACTER_CURRENT_VITAL:
                        key = 0;
                        vital = e.Message.Value<int>("key");
                        if(vital == 2) key = (int)ACharAttributeKeys.Health;
                        if(vital == 4) key = (int)ACharAttributeKeys.Stamina;
                        if(vital == 6) key = (int)ACharAttributeKeys.Mana;
                        if(key == 0){return;}
                        AttribKey = AttributeVals.Where(x => x.Key == key).FirstOrDefault();
                        if(AttribKey != null){AttribKey.UpdateCurrent(e.Message.Value<int>("value"));}
                        else{AttributeVals.Add(new CharKeyAttribute(key, 0, 0, 0, e.Message.Value<int>("value")));}
                        return;

                    case MessageType.AC_SET_OBJECT_RESOURCE:
                        key =  e.Message.Value<int>("key");
                        KeyResource ResourceKey = ResourceVals.Where(x => x.Key == key).FirstOrDefault();
                        if(ResourceKey != null) {ResourceKey.Val = e.Message.Value<int>("value");}
                        else{ResourceVals.Add(new KeyResource(key, e.Message.Value<int>("value")));}
                        return;

                    case MessageType.AC_SET_CHARACTER_LINK:
                        key =  e.Message.Value<int>("key");
            //						if(key == (int)LinkPropertyIds.AllegianceObject){}
                        if(key == (int)LinkPropertyIds.Container || key == (int)LinkPropertyIds.EquippedBy)
                        {
                            LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                            if(LongKey != null){LongKey.Val = e.Message.Value<long>("value");}
                            else{LongVals.Add(new KeyLong((int)LongValueKey.Container, e.Message.Value<long>("value")));}
                        }
            //						if(key == (int)LinkPropertyIds.LastAttacker){}
                        if(key == (int)LinkPropertyIds.Monarch)
                        {
                            StringKey = StringVals.Where(x => x.Key == (int)StringValueKey.MonarchName).FirstOrDefault();
                            if(StringKey != null) {StringKey.Val = e.Message.Value<string>("value");}
                            else{StringVals.Add(new KeyString((int)StringValueKey.MonarchName, e.Message.Value<string>("value")));}
                        }
                        if(key == (int)LinkPropertyIds.OwnedBy || key == (int)LinkPropertyIds.Patron)
                        {
                            StringKey = StringVals.Where(x => x.Key == (int)StringValueKey.Patron).FirstOrDefault();
                            if(StringKey != null) {StringKey.Val = e.Message.Value<string>("value");}
                            else{StringVals.Add(new KeyString((int)StringValueKey.Patron, e.Message.Value<string>("value")));}
                        }
                        return;

                    case MessageType.AC_ADJUST_STACK:
                        LongKey = LongVals.Where(x => x.Key ==(int)LongValueKey.StackCount).FirstOrDefault();
                        if(LongKey != null) {LongKey.Val = e.Message.Value<long>("count");}
                        else{LongVals.Add(new KeyLong((int)LongValueKey.StackCount, e.Message.Value<long>("count")));}
                        return;

                    case MessageType.AC_WIELD_OBJECT:
                        LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                        if(LongKey != null) {LongKey.Val = e.Message.Value<long>("owner");}
                        else{LongVals.Add(new KeyLong((int)LongValueKey.Container, e.Message.Value<long>("owner")));}
                        return;

                    case MessageType.AC_GAME_EVENT:
                        int Event = e.Message.Value<int>("event");
                        switch(Event)
                        {
                            case GameEvent.GE_INSERT_INVENTORY_ITEM:
                            case GameEvent.GE_SETPACK_CONTENTS:
                                LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                                if(LongKey != null) {LongKey.Val = e.Message.Value<long>("container");}
                                else{LongVals.Add(new KeyLong((int)LongValueKey.Container, e.Message.Value<long>("container")));}
                                return;

                            case GameEvent.GE_UPDATE_HEALTH:
                                FractionalHealth = e.Message.Value<double>("health");
                                return;

                            case GameEvent.GE_UPDATE_MANA_BAR:
                                FractionalMana = e.Message.Value<double>("mana");
                                return;
                        }
                        return;
                }
        }
        public AetherStats(NetworkMessageEventArgs e)
        {
            int key;
                KeyLong LongKey;
                KeyString StringKey;
                KeyResource ResourceKey;
                KeyQuad QuadKey;

                LogTime = DateTime.Now.ToString();
                Id = e.Message.Value<int>("character");
                MessageStruct EventStruct = e.Message.Struct("event");
                MessageStruct PropertyStruct = EventStruct.Struct("properties");

                int PropertyFlags = PropertyStruct.Value<int>("flags");
                if((PropertyFlags & (int)CharDecalFlags.LongValues) != 0)
                {
                    MessageStruct lMsg = PropertyStruct.Struct("dwords");
                    for(int i = 0; i < lMsg.Count; i++)
                    {
                        key = lMsg.Struct(i).Value<int>("key");
                        LongKey = LongVals.Where(x => x.Key == key).FirstOrDefault();
                        if(LongKey != null){LongKey.Val = lMsg.Struct(i).Value<long>("value");}
                        else{LongVals.Add(new KeyLong(key, lMsg.Struct(i).Value<long>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.BooleanValues) != 0)
                {
                    MessageStruct bMsg = PropertyStruct.Struct("booleans");
                    for(int i = 0; i < bMsg.Count; i++)
                    {
                        key = bMsg.Struct(i).Value<int>("key");
                        KeyBool BoolKey = BoolVals.Where(x => x.Key == key).FirstOrDefault();
                        if(BoolKey != null){BoolKey.Val = bMsg.Struct(i).Value<bool>("value");}
                        else{BoolVals.Add(new KeyBool(key, bMsg.Struct(i).Value<bool>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.DoubleValues) != 0)
                {
                    MessageStruct dMsg = PropertyStruct.Struct("doubles");
                    for(int i = 0; i < dMsg.Count; i++)
                    {
                        key = dMsg.Struct(i).Value<int>("key");
                        KeyDouble DoubleKey = DoubleVals.Where(x => x.Key == key).FirstOrDefault();
                        if(DoubleKey != null){DoubleKey.Val = dMsg.Struct(i).Value<double>("value");}
                        else{DoubleVals.Add(new KeyDouble(key, dMsg.Struct(i).Value<double>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.LinkValues) != 0)
                {
                    MessageStruct linkMsg = PropertyStruct.Struct("links");
                    for(int i = 0; i < linkMsg.Count; i++)
                    {
                        key = linkMsg.Struct(i).Value<int>("key");
            //						if(key == (int)LinkPropertyIds.AllegianceObject){}
                        if(key == (int)LinkPropertyIds.Container || key == (int)LinkPropertyIds.EquippedBy)
                        {
                            LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                            if(LongKey != null){LongKey.Val =  linkMsg.Struct(i).Value<long>("value");}
                            else{LongVals.Add(new KeyLong((int)LongValueKey.Container,  linkMsg.Struct(i).Value<long>("value")));}
                        }
            //						if(key == (int)LinkPropertyIds.LastAttacker){}
                        if(key == (int)LinkPropertyIds.Monarch)
                        {
                            StringKey = StringVals.Where(x => x.Key == (int)StringValueKey.MonarchName).FirstOrDefault();
                            if(StringKey != null) {StringKey.Val =  linkMsg.Struct(i).Value<string>("value");}
                            else{StringVals.Add(new KeyString((int)StringValueKey.MonarchName,  linkMsg.Struct(i).Value<string>("value")));}
                        }
                        if(key == (int)LinkPropertyIds.OwnedBy || key == (int)LinkPropertyIds.Patron)
                        {
                            StringKey = StringVals.Where(x => x.Key == (int)StringValueKey.Patron).FirstOrDefault();
                            if(StringKey != null) {StringKey.Val =  linkMsg.Struct(i).Value<string>("value");}
                            else{StringVals.Add(new KeyString((int)StringValueKey.Patron,  linkMsg.Struct(i).Value<string>("value")));}
                        }
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.StringValues) != 0)
                {
                    MessageStruct sMsg = PropertyStruct.Struct("strings");
                    for(int i = 0; i < sMsg.Count; i++)
                    {
                        key = sMsg.Struct(i).Value<int>("key");
                        StringKey = StringVals.Where(x => x.Key == key).FirstOrDefault();
                        if(StringKey != null){StringKey.Val = sMsg.Struct(i).Value<string>("value");}
                        else{StringVals.Add(new KeyString(key, sMsg.Struct(i).Value<string>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.ResourceValues) != 0)
                {
                    MessageStruct rMsg = PropertyStruct.Struct("resources");
                    for(int i = 0; i < rMsg.Count; i++)
                    {
                        key = rMsg.Struct(i).Value<int>("key");
                        ResourceKey = ResourceVals.Where(x => x.Key == key).FirstOrDefault();
                        if(ResourceKey != null){ResourceKey.Val = rMsg.Struct(i).Value<int>("value");}
                        else{ResourceVals.Add(new KeyResource(key, rMsg.Struct(i).Value<int>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.QuadValues) != 0)
                {
                    MessageStruct qMsg = PropertyStruct.Struct("qwords");
                    for(int i = 0; i < qMsg.Count; i++)
                    {
                        key = qMsg.Struct(i).Value<int>("key");
                        QuadKey = QuadVals.Where(x => x.Key == key).FirstOrDefault();
                        if(QuadKey != null){QuadKey.Val = qMsg.Struct(i).Value<long>("value");}
                        else{QuadVals.Add(new KeyQuad(key, qMsg.Struct(i).Value<long>("value")));}
                    }
                }

                if((PropertyFlags & (int)CharDecalFlags.PositionValues) != 0)
                {
                    MessageStruct PositionStruct = PropertyStruct.Struct("positions");
                    LastCorpsePosition = new PositionData(PositionStruct.Value<int>("landcell"), PositionStruct.Value<float>("x"), PositionStruct.Value<float>("y"), PositionStruct.Value<float>("z"));
                }

                MessageStruct VectorStruct = EventStruct.Struct("vectors");
                int VectorFlags = VectorStruct.Value<int>("flags");

                if((VectorFlags & (int)CharVectorFlags.AttributeValues) != 0)
                {
                    MessageStruct AttribStruct;
                    int AttributeFlags = VectorStruct.Value<int>("attributeFlags");
                    if((AttributeFlags & (int)CharAttributeFlags.Strength) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("strength");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Strength).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Strength, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Endurance) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("endurance");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Endurance).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Endurance, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Quickness) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("quickness");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Quickness).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Quickness, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Coordination) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("coordination");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Coordination).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Coordination, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Focus) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("focus");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Focus).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Focus, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Self) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("self");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Self).FirstOrDefault();
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp"));}
                        else{AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Self, AttribStruct.Value<int>("raised"), AttribStruct.Value<int>("innate"), AttribStruct.Value<int>("xp")));}
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Health) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("health");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Health).FirstOrDefault();
                        CharKeyAttribute EndKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Endurance).FirstOrDefault();
                        int innate = 0;
                        if(EndKey != null) {innate = Convert.ToInt32((double)EndKey.Innate/2);}
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")); AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));}
                        else
                        {
                            AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Health, AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")));
                            AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));
                        }
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Stamina) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("stamina");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Stamina).FirstOrDefault();
                        CharKeyAttribute EndKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Endurance).FirstOrDefault();
                        int innate = 0;
                        if(EndKey != null) {innate = EndKey.Innate;}
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")); AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));}
                        else
                        {
                            AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Stamina, AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")));
                            AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));
                        }
                    }
                    if((AttributeFlags & (int)CharAttributeFlags.Mana) != 0)
                    {
                        AttribStruct = VectorStruct.Struct("mana");
                        CharKeyAttribute AttribKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Mana).FirstOrDefault();
                        CharKeyAttribute SelfKey = AttributeVals.Where(x => x.Key == (int)ACharAttributeKeys.Self).FirstOrDefault();
                        int innate = 0;
                        if(SelfKey != null) {innate = SelfKey.Innate;}
                        if(AttribKey != null){AttribKey.Update(AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")); AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));}
                        else
                        {
                            AttributeVals.Add(new CharKeyAttribute((int)ACharAttributeKeys.Mana, AttribStruct.Value<int>("raised"), innate, AttribStruct.Value<int>("xp")));
                            AttribKey.UpdateCurrent(AttribStruct.Value<int>("current"));
                        }
                    }
                }

            //				MessageStruct GameData = CreateMsg.Message.Struct("game");
            //				StringVals.Add(new KeyString((int)StringValueKey.Name, GameData.Value<string>("name")));
            //				LongVals.Add(new KeyLong((int)LongValueKey.Type, GameData.Value<int>("type")));
            //				LongVals.Add(new KeyLong((int)LongValueKey.Icon, GameData.Value<int>("icon")));
            //				LongVals.Add(new KeyLong((int)LongValueKey.Category, GameData.Value<int>("category")));
            //				LongVals.Add(new KeyLong((int)LongValueKey.Behavior, GameData.Value<int>("behavior")));
            //
            //				int flags1 = GameData.Value<int>("flags1");
            //				if(flags1 != 0) {LongVals.Add(new KeyLong((int)LongValueKey.CreateFlags1, flags1));}
            //				int flags2 = 0;
            //				if((GameData.Value<int>("behavior") & 0x04000000) != 0){flags2 = GameData.Value<int>("flags2");}
            //				if(flags2 != 0) {LongVals.Add(new KeyLong((int)LongValueKey.CreateFlags2, flags2));}
            //
            //				if((flags1 & 0x1) != 0) {StringVals.Add(new KeyString((int)StringValueKey.SecondaryName, GameData.Value<string>("namePlural")));}
            //				if((flags1 & 0x2) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.ItemSlots, GameData.Value<int>("itemSlots")));}
            //				if((flags1 & 0x4) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.PackSlots, GameData.Value<int>("packSlots")));}
            //				if((flags1 & 0x8) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Value, GameData.Value<int>("value")));}
            //				if((flags1 & 0x10) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown10, GameData.Value<int>("unknown10")));}
            //				if((flags1 & 0x20) != 0) {DoubleVals.Add(new KeyDouble((int)DoubleValueKey.ApproachDistance, GameData.Value<double>("approachDistance")));}
            //				if((flags1 & 0x40) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Monarch, GameData.Value<int>("monarch")));}
            //				if((flags1 & 0x80) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconOutline, GameData.Value<int>("iconHighlight")));}
            //				if((flags1 & 0x100) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.MissileType, GameData.Value<int>("ammunition")));}
            //				if((flags1 & 0x200) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquipType, GameData.Value<int>("wieldType")));}
            //				if((flags1 & 0x400) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsesRemaining, GameData.Value<int>("uses")));}
            //				if((flags1 & 0x800) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsesTotal, GameData.Value<int>("usesLimit")));}
            //				if((flags1 & 0x1000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.StackCount, GameData.Value<int>("stack")));}
            //
            //				if((flags1 & 0x2000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.StackMax, GameData.Value<int>("stackLimit")));}
            //				if((flags1 & 0x4000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Container, GameData.Value<int>("container")));}
            //				if((flags1 & 0x8000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Container, GameData.Value<int>("equipper")));}
            //				if((flags1 & 0x10000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquipableSlots, GameData.Value<int>("equipPossible")));}
            //				if((flags1 & 0x20000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.EquippedSlots, GameData.Value<int>("equipActual")));}
            //				if((flags1 & 0x40000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Coverage, GameData.Value<int>("coverage")));}
            //				if((flags1 & 0x80000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.UsageMask, GameData.Value<int>("useableOn")));}
            //				if((flags1 & 0x100000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown100000, GameData.Value<int>("unknown100000")));}
            //				if((flags1 & 0x200000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Burden, GameData.Value<int>("burden")));}
            //				if((flags1 & 0x400000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.AssociatedSpell, GameData.Value<int>("spell")));}
            //				if((flags1 & 0x800000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown800000, GameData.Value<int>("unknown800000")));}
            //				if((flags1 & 0x1000000) != 0) {DoubleVals.Add(new KeyDouble((int)DoubleValueKey.SalvageWorkmanship, GameData.Value<double>("workmanship")));}
            //				if((flags1 & 0x2000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HouseOwner, GameData.Value<int>("owner")));}
            //				//0x4000000 is dwelling properties for access level
            //				if((flags1 & 0x8000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Unknown8000000, GameData.Value<int>("unknown8000000")));}
            //				if((flags1 & 0x10000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HookMask, GameData.Value<int>("hookableOn")));}
            //				if((flags1 & 0x20000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.HookType, GameData.Value<int>("hookType")));}
            //				if((flags1 & 0x40000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconOverlay, GameData.Value<int>("iconOverlay")));}
            //				if((flags1 & 0x80000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.Material, GameData.Value<int>("material")));}
            //
            //				if((flags2 & 0x4000000) != 0) {LongVals.Add(new KeyLong((int)LongValueKey.IconUnderlay, GameData.Value<int>("iconUnderlay")));}
            //
            //
            //				MessageStruct ModelData = CreateMsg.Message.Struct("model");
            //
            //				int PaletteCount = ModelData.Value<int>("paletteCount");
            //
            //				if(PaletteCount != 0)
            //				{
            //					MessageStruct PaletteData = ModelData.Struct("palettes");
            //					for(int i = 0; i < PaletteCount; i++)
            //					{
            //						Palettes.Add(PaletteData.Struct(i).Value<int>("palette"));
            //					}
            //				}
            //
            //				int TextureCount = ModelData.Value<int>("textureCount");
            //				if(TextureCount != 0)
            //				{
            //					MessageStruct TextureData = ModelData.Struct("textures");
            //					for(int i = 0; i < TextureCount; i++)
            //					{
            //						txture tmptxture = new txture();
            //						tmptxture.Index = TextureData.Struct(i).Value<int>("index");
            //						tmptxture.Old = TextureData.Struct(i).Value<int>("old");
            //						tmptxture.New = TextureData.Struct(i).Value<int>("new");
            //						Textures.Add(tmptxture);
            //					}
            //				}
            //
            //				int ModelCount = ModelData.Value<int>("modelCount");
            //				if(ModelCount != 0)
            //				{
            //					MessageStruct modelData = ModelData.Struct("models");
            //					for(int i = 0; i < ModelCount; i++)
            //					{
            //						model mod = new model();
            //						mod.Index = modelData.Struct(i).Value<int>("index");
            //						mod.Model = modelData.Struct(i).Value<int>("model");
            //						Models.Add(mod);
            //					}
            //				}
            ////
            ////
            //				LongVals.Add(new KeyLong((int)LongValueKey.PhysicsDataFlags, CreateMsg.Message.Struct("physics").Value<int>("flags")));
            //				//Physics not decoded at this time
        }
        public void Set(NetworkMessageEventArgs e, int ContainerId)
        {
            KeyLong LongKey;
                switch(e.Message.Type)
                {
                    case MessageType.AC_MOVE_OBJECT_INTO_INVENTORY:
                        LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                        if(LongKey != null){LongKey.Val = ContainerId;}
                        else{LongVals.Add(new KeyLong((int)LongValueKey.Container, ContainerId));}
                        return;

                    case MessageType.AC_GAME_EVENT:
                        int Event = e.Message.Value<int>("event");
                        switch(Event)
                        {

                            case GameEvent.GE_WEAR_ITEM:
                            case GameEvent.GE_DROP_FROM_INVENTORY:
                                LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.Container).FirstOrDefault();
                                if(LongKey != null){LongKey.Val = ContainerId;}
                                else{LongVals.Add(new KeyLong((int)LongValueKey.Container, ContainerId));}
                                return;
                        }
                        return;
                }
        }
示例#59
0
 internal void SendFellowChange(NetworkMessageEventArgs e)
 {
     OnFellowshipChanged(e);
 }
        public void Identify(NetworkMessageEventArgs IdentMsg)
        {
            int key;

                LogTime = DateTime.Now.ToString();

                int flags = IdentMsg.Message.Value<int>("flags");

                if((flags & (int)ObjectIdentFlags.LongValues) != 0)
                {
                    MessageStruct lMsg = IdentMsg.Message.Struct("dwords");
                    for(int i = 0; i < lMsg.Count; i++)
                    {
                        key = lMsg.Struct(i).Value<int>("key");
                        KeyLong LongKey = LongVals.Where(x => x.Key == key).FirstOrDefault();
                        if(LongKey != null){LongKey.Val = lMsg.Struct(i).Value<long>("value");}
                        else{LongVals.Add(new KeyLong(key, lMsg.Struct(i).Value<long>("value")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.BooleanValues) != 0)
                {
                    MessageStruct bMsg = IdentMsg.Message.Struct("booleans");
                    for(int i = 0; i < bMsg.Count; i++)
                    {
                        key = bMsg.Struct(i).Value<int>("key");
                        KeyBool BoolKey = BoolVals.Where(x => x.Key == key).FirstOrDefault();
                        if(BoolKey != null){BoolKey.Val = bMsg.Struct(i).Value<bool>("value");}
                        else{BoolVals.Add(new KeyBool(key, bMsg.Struct(i).Value<bool>("value")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.DoubleValues) != 0)
                {
                    MessageStruct dMsg = IdentMsg.Message.Struct("doubles");
                    for(int i = 0; i < dMsg.Count; i++)
                    {
                        key = dMsg.Struct(i).Value<int>("key");
                        KeyDouble DoubleKey = DoubleVals.Where(x => x.Key == key).FirstOrDefault();
                        if(DoubleKey != null){DoubleKey.Val = dMsg.Struct(i).Value<double>("value");}
                        else{DoubleVals.Add(new KeyDouble(key, dMsg.Struct(i).Value<double>("value")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.StringValues) != 0)
                {
                    MessageStruct sMsg = IdentMsg.Message.Struct("strings");
                    for(int i = 0; i < sMsg.Count; i++)
                    {
                        key = sMsg.Struct(i).Value<int>("key");
                        KeyString StringKey = StringVals.Where(x => x.Key == key).FirstOrDefault();
                        if(StringKey != null){StringKey.Val = sMsg.Struct(i).Value<string>("value");}
                        else{StringVals.Add(new KeyString(key, sMsg.Struct(i).Value<string>("value")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.SpellValues) != 0)
                {
                    MessageStruct splMsg = IdentMsg.Message.Struct("spells");
                    for(int i = 0; i < splMsg.Count; i++)
                    {
                        key = splMsg.Struct(i).Value<int>("spell");
                        spell spl = SpellVals.Where(x => x.SpellId == key).FirstOrDefault();
                        if(spl != null){spl.Flags = splMsg.Struct(i).Value<int>("flags");}
                        else{SpellVals.Add(new spell(key, splMsg.Struct(i).Value<int>("flags")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.DoubleProts) != 0)
                {
                    KeyDouble ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.SlashProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protSlashing");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.SlashProt, IdentMsg.Message.Value<double>("protSlashing")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.PierceProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protPiercing");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.PierceProt,IdentMsg.Message.Value<double>("protPiercing")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.BludgeonProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protBludgeoning");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.BludgeonProt, IdentMsg.Message.Value<double>("protBludgeoning")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.ColdProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protCold");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.ColdProt, IdentMsg.Message.Value<double>("protCold")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.FireProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protFire");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.FireProt, IdentMsg.Message.Value<double>("protFire")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.AcidProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protAcid");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.AcidProt, IdentMsg.Message.Value<double>("protAcid")));}

                    ProtKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.LightningProt).FirstOrDefault();
                    if(ProtKey != null){ProtKey.Val = IdentMsg.Message.Value<double>("protLightning");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.LightningProt, IdentMsg.Message.Value<double>("protLightning")));}
                }

                if((flags & (int)ObjectIdentFlags.ResourceValues) != 0)
                {
                    MessageStruct rMsg = IdentMsg.Message.Struct("resources");
                    for(int i = 0; i < rMsg.Count; i++)
                    {
                        key = rMsg.Struct(i).Value<int>("key");
                        KeyResource ResourceKey = ResourceVals.Where(x => x.Key == key).FirstOrDefault();
                        if(ResourceKey != null){ResourceKey.Val = rMsg.Struct(i).Value<int>("value");}
                        else{ResourceVals.Add(new KeyResource(key, rMsg.Struct(i).Value<int>("value")));}
                    }
                }

                if((flags & (int)ObjectIdentFlags.QuadValues) != 0)
                {
                    MessageStruct qMsg = IdentMsg.Message.Struct("qwords");
                    for(int i = 0; i < qMsg.Count; i++)
                    {
                        key = qMsg.Struct(i).Value<int>("key");
                        KeyQuad QuadKey = QuadVals.Where(x => x.Key == key).FirstOrDefault();
                        if(QuadKey != null){QuadKey.Val = qMsg.Struct(i).Value<long>("value");}
                        else{QuadVals.Add(new KeyQuad(key, qMsg.Struct(i).Value<long>("value")));}
                    }
                }

            //				if((flags & (int)ObjectIdentFlags.AttributeValues) != 0)
            //				{
            //					int flags1 = IdentMsg.Message.Value<int>("flags1");
            //					KeyAttribute AttribKey;
            //
            //					if((flags1 & (int)ObjectIdentFlags.Flags1AttributeValues) != 0)
            //					{
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentStrength).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("strength");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.BaseStrength, IdentMsg.Message.Value<int>("strength")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentEndurance).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("endurance");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentEndurance, IdentMsg.Message.Value<int>("endurance")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentQuickness).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("quickness");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentQuickness, IdentMsg.Message.Value<int>("quickness")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentCoordination).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("coordination");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentCoordination, IdentMsg.Message.Value<int>("coordination")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentFocus).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("focus");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentFocus, IdentMsg.Message.Value<int>("focus")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentSelf).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("self");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentSelf, IdentMsg.Message.Value<int>("self")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentStamina).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("stamina");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentStamina, IdentMsg.Message.Value<int>("stamina")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentMana).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("mana");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentMana, IdentMsg.Message.Value<int>("mana")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.BaseStamina).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("staminaMax");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.BaseStamina, IdentMsg.Message.Value<int>("staminaMax")));}
            //
            //						AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.BaseMana).FirstOrDefault();
            //						if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("manaMax");}
            //						else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.BaseMana, IdentMsg.Message.Value<int>("manaMax")));}
            //					}
            //
            //					AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.CurrentHealth).FirstOrDefault();
            //					if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("health");}
            //					else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.CurrentHealth, IdentMsg.Message.Value<int>("health")));}
            //
            //					AttribKey = AttributeVals.Where(x => x.Key == (int)AttributeValueKey.BaseHealth).FirstOrDefault();
            //					if(AttribKey != null){AttribKey.Val = IdentMsg.Message.Value<int>("healthMax");}
            //					else{AttributeVals.Add(new KeyAttribute((int)AttributeValueKey.BaseHealth, IdentMsg.Message.Value<int>("healthMax")));}
            //				}

                if((flags & (int)ObjectIdentFlags.DamageValues) != 0)
                {
                    KeyLong LongKey;  KeyDouble DoubleKey;
                    LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.DamageType).FirstOrDefault();
                    if(LongKey != null){LongKey.Val = IdentMsg.Message.Value<long>("weapType");}
                    else{LongVals.Add(new KeyLong((int)LongValueKey.DamageType, IdentMsg.Message.Value<long>("weapType")));}

                    LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.WeapSpeed).FirstOrDefault();
                    if(LongKey != null){LongKey.Val = IdentMsg.Message.Value<long>("weapSpeed");}
                    else{LongVals.Add(new KeyLong((int)LongValueKey.WeapSpeed, IdentMsg.Message.Value<long>("weapSpeed")));}

                    LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.EquipSkill).FirstOrDefault();
                    if(LongKey != null){LongKey.Val = IdentMsg.Message.Value<long>("weapSkill");}
                    else{LongVals.Add(new KeyLong((int)LongValueKey.EquipSkill, IdentMsg.Message.Value<long>("weapSkill")));}

                    LongKey = LongVals.Where(x => x.Key == (int)LongValueKey.MaxDamage).FirstOrDefault();
                    if(LongKey != null){LongKey.Val = IdentMsg.Message.Value<long>("weapDamage");}
                    else{LongVals.Add(new KeyLong((int)LongValueKey.MaxDamage, IdentMsg.Message.Value<long>("weapDamage")));}

                    DoubleKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.Variance).FirstOrDefault();
                    if(DoubleKey != null){DoubleKey.Val = IdentMsg.Message.Value<double>("weapVariance");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.Variance, IdentMsg.Message.Value<int>("weapVariance")));}

                    DoubleKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.DamageBonus).FirstOrDefault();
                    if(DoubleKey != null){DoubleKey.Val = IdentMsg.Message.Value<double>("weapModifier");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.DamageBonus, IdentMsg.Message.Value<int>("weapModifier")));}

                    DoubleKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.Range).FirstOrDefault();
                    if(DoubleKey != null){DoubleKey.Val = IdentMsg.Message.Value<double>("weapPower");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.Range, IdentMsg.Message.Value<int>("weapPower")));}

                    DoubleKey = DoubleVals.Where(x => x.Key == (int)DoubleValueKey.AttackBonus).FirstOrDefault();
                    if(DoubleKey != null){DoubleKey.Val = IdentMsg.Message.Value<double>("weapAttack");}
                    else{DoubleVals.Add(new KeyDouble((int)DoubleValueKey.AttackBonus, IdentMsg.Message.Value<int>("weapAttack")));}
                }
                HasIdData = true;
        }