Пример #1
0
        /// <summary>
        /// Load and Initialize Game Components
        /// </summary>
        public override void LoadContent()
        {
            //Adjust DWM frame settings
            int[] margins = new int[] { 0, 0, ScreenManager.maxWidth, ScreenManager.maxHeight };
            User32.DwmExtendFrameIntoClientArea(ScreenManager.Game.Window.Handle, ref margins);

            DepthStencilState depthState = new DepthStencilState();

            depthState.DepthBufferEnable      = false;
            depthState.DepthBufferWriteEnable = false;
            ScreenManager.GraphicsDevice.DepthStencilState = depthState;

            //Hook the interceptKeys module
            InterceptKeys.Hook();

            bciControl = new WowControl(ScreenManager.Game);
            ScreenManager.Game.Components.Add(bciControl);

            ssvepDX = new SSVEP_DirectX_Advanced_V2(ScreenManager.Game);
            ssvepDX.Initialize(ScreenManager.form, ScreenManager.SpriteBatch);
            ScreenManager.Game.Components.Add(ssvepDX);
        }
Пример #2
0
        public void Read()
        {
            try
            {
                try
                {
                    playerbase = wow.ReadUInt(wow.ReadUInt(wow.ReadUInt((uint)Globals.s_PlayerBase) + 0x34) + 0x24);
                    if (playerbase != 0)
                    {
                        Online = true;
                    }
                    else
                    {
                        Online = false;
                    }
                } //this is the player base
                catch (Exception) { Online = false; }
                BgStatus  = wow.ReadUInt((uint)Globals.BGStatus);
                IsIndoors = wow.ReadUInt((uint)Globals.IsIndoors);
                LastError = ReadRealName(wow.ReadBytes((uint)Globals.LastError, 120));
                BattlefieldInstanceExpiration = 0;                //wow.ReadUInt(0xC55A24) & 1;
                Combopoints = Convert.ToInt16(wow.ReadByte((uint)Globals.s_ComboPoint));
                CharCount   = Convert.ToInt16(wow.ReadByte((uint)Globals.CharCount));
                CharNo      = Convert.ToInt16(wow.ReadByte((uint)Globals.CharNo));
                String WOWBuild = ReadRealName(wow.ReadBytes(0x00A30BE6, 10));
                byte[] TT       = wow.ReadBytes(0x00A30BE6, 10);
                LoginState   = wow.ReadASCIIString(0xB6A9E0, 40);
                RealmName    = ReadRealName(wow.ReadBytes((uint)Globals.s_RealmName, 120));
                LoadingState = (int)wow.ReadUInt((uint)Globals.s_IsLoadingOrConnecting);
                WowControl.CheckLastError(LastError);
                ObjectInfo Target     = new ObjectInfo();
                byte[]     UnitFields = wow.ReadBytes(wow.ReadUInt(playerbase + 0x8) + (0x17 * 4), 4);
                PlayerForm = Convert.ToInt32(UnitFields[3]);
                Objects.Clear();
                IsMounted  = wow.ReadUInt(playerbase + 0x9C0);// &1;
                Temp       = new ObjectInfo();
                Temp.Auras = getAuras(playerbase);
                WowControl.PlayerBuffs.Clear();
                for (int i = 0; i < Temp.Auras.Count; i++)
                {
                    WowControl.PlayerBuffs.Add(Temp.Auras[i].auraId);
                }
                Temp.Name   = ReadRealName(wow.ReadBytes((uint)Globals.s_PlayerName, 120));
                Temp.Level  = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x36 * 4)); // Reads players level
                Temp.Health = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x18 * 4)); // Reads players health
                PowerList.Clear();
                Temp.Power     = GetUnitPower(playerbase);
                Temp.MaxHealth = wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x20 * 4)); // Reads players maxhealth
                if ((Location != null) & (Location != ""))
                {
                    if (Location != ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60)))
                    {
                        WowControl.LocationChangeTime = DateTime.Now;
                        Location = ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60));
                        WowControl.BadObjects.Clear();
                        if (BgStatus == 3)
                        {
                            WowControl.WaitTime = DateTime.Now.AddSeconds(20);
                        }
                        else
                        {
                            WowControl.WaitTime = DateTime.Now.AddSeconds(1);
                        }
                        return;
                    }
                }
                else
                {
                    Location = ReadRealName(wow.ReadBytes(wow.ReadUInt((uint)Globals.LocationName), 60));
                }
                Temp.X = wow.ReadFloat(playerbase + 0x798); // Read players xlocation
                Temp.Y = wow.ReadFloat(playerbase + 0x79C); // Read players ylocation
                Temp.Z = wow.ReadFloat(playerbase + 0x7A0); // Read players zlocation
                double Time = (DateTime.Now - LastRead).TotalMilliseconds;
                Speed           = WowControl.CheckPoint(Temp.X, Temp.Y, Temp.Z, X, Y, Z) / Time;
                X               = Temp.X;
                Y               = Temp.Y;
                Z               = Temp.Z;
                Temp.R          = wow.ReadFloat(playerbase + 0x7A8);                                     // Read players rotation
                Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(playerbase + 208) + 212) >> 19) & 1;
                Temp.Faction    = GetFaction(wow.ReadUInt(wow.ReadUInt(playerbase + 0x8) + (0x37 * 4))); //Faction
                Temp.Type       = 4;
                Temp.GUID       = wow.ReadUInt64(playerbase + 0x30);
                Objects.Add(Temp);
                LastRead = DateTime.Now;
                uint   s_curMgr   = wow.ReadUInt(wow.ReadUInt((uint)ObjectManager.CurMgrPointer) + (uint)ObjectManager.CurMgrOffset);
                uint   curObj     = wow.ReadUInt(s_curMgr + 0xAC);
                uint   nextObj    = curObj;
                UInt64 playerGUID = wow.ReadUInt64((uint)Globals.PlayerGUID);
                UInt64 targetGUID = wow.ReadUInt64((uint)Globals.TargetGUID);
                UInt64 localGUID  = wow.ReadUInt64(s_curMgr + 0xC0);
                while (curObj != 0 && (curObj & 1) == 0)
                {
                    UInt64 type  = wow.ReadUInt(curObj + 0x14);
                    UInt64 cGUID = wow.ReadUInt64(curObj + 0x30);
                    Temp.Type = Convert.ToUInt32(type);
                    if (Temp.Type == 7)
                    {
                        Temp.Type = 7;
                    }
                    Temp.GUID = cGUID;
                    switch (type)
                    {
                    case 3:
                        Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(curObj + 208) + 212) >> 19) & 1;
                        Temp.IsPlayer   = false;
                        Temp.IsTarget   = false;
                        Temp.Name       = "Unit";
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                        }
                        Temp.X          = wow.ReadFloat(curObj + 0x7D4);
                        Temp.Y          = wow.ReadFloat(curObj + 0x7D8);
                        Temp.Z          = wow.ReadFloat(curObj + 0x7DC);
                        Temp.R          = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Health     = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x18 * 4)); // Reads health
                        Temp.MaxHealth  = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x20 * 4)); // Reads maxhealth
                        Temp.Level      = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x36 * 4)); // Reads level
                        Temp.Name       = ReadRealName(wow.ReadBytes(wow.ReadUInt(wow.ReadUInt(curObj + 0x964) + 0x5c), 60));
                        Temp.Faction    = "Mob";
                        Temp.IsLootable = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x4F * 4));
                        Temp.Auras      = getAuras(curObj);
                        Temp.Power      = GetUnitPower(curObj);
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                            Target        = Temp;
                            Target.Auras  = getAuras(curObj);
                        }
                        Objects.Add(Temp);
                        break;

                    case 4:
                        Temp.IsInCombat = (wow.ReadUInt(wow.ReadUInt(curObj + 208) + 212) >> 19) & 1;
                        Temp.IsTarget   = false;
                        Temp.IsPlayer   = false;
                        Temp.Name       = GetPlayerNameByGuid(cGUID);
                        Temp.X          = wow.ReadFloat(curObj + 0x7D4);
                        Temp.Y          = wow.ReadFloat(curObj + 0x7D8);
                        Temp.Z          = wow.ReadFloat(curObj + 0x7DC);
                        Temp.R          = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Health     = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x18 * 4));             // Reads health
                        Temp.MaxHealth  = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x20 * 4));             // Reads maxhealth
                        Temp.Level      = wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x36 * 4));             // Reads level
                        Temp.Faction    = GetFaction(wow.ReadUInt(wow.ReadUInt(curObj + 0x8) + (0x37 * 4))); //Faction
                        Temp.Auras      = getAuras(curObj);
                        Temp.Power      = GetUnitPower(curObj);
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                            Target        = Temp;
                            Target.Auras  = getAuras(curObj);
                        }
                        else if (cGUID == playerGUID)
                        {
                            break;
                        }
                        if (Objects[0].GUID != Temp.GUID)
                        {
                            Objects.Add(Temp);
                        }
                        break;

                    case 5:
                        Temp.Faction    = "Object";
                        Temp.IsInCombat = 0;
                        Temp.Name       = "";
                        Temp.IsPlayer   = false;
                        Temp.IsTarget   = false;
                        if (cGUID == targetGUID)
                        {
                            Temp.IsTarget = true;
                        }
                        Temp.Level     = 0;
                        Temp.Health    = 0;
                        Temp.MaxHealth = 0;
                        Temp.X         = wow.ReadFloat(curObj + 0xE8);
                        Temp.Y         = wow.ReadFloat(curObj + 0xEC);
                        Temp.Z         = wow.ReadFloat(curObj + 0xF0);
                        Temp.R         = wow.ReadFloat(curObj + 0x7A8);
                        Temp.Name      = ReadRealName(wow.ReadBytes(wow.ReadUInt(wow.ReadUInt(curObj + 0x1A4) + 0x90), 60));
                        Temp.Power     = GetUnitPower(curObj);
                        Objects.Add(Temp);
                        break;
                    }
                    nextObj = wow.ReadUInt(curObj + 0x3C);
                    if (nextObj == curObj)
                    {
                        break;
                    }
                    else
                    {
                        curObj = nextObj;
                    }
                }
                Objects.Add(Target);
                WowControl.TargetBuffs.Clear();
                if (Target.Auras != null)
                {
                    for (int i = 0; i < Target.Auras.Count; i++)
                    {
                        WowControl.TargetBuffs.Add(Target.Auras[i].auraId);
                    }
                }
                if (LastError == "Нет места.")
                {
                    WowControl.FullBag = true;
                }
            }
            catch (Exception)
            {
                //WowControl.UpdateStatus("Error. " + E.Message);
                InitMemory();
            }
        }
Пример #3
0
        public void ReadChat()
        {
            String NewString;

            for (uint i = 0; i < 59; i++)
            {
                String str = ReadRealName(wow.ReadBytes(((uint)WoWChat.ChatBufferStart + (i * (uint)WoWChat.NextMessage)) + 0x3c, 1500));
                if (str == "")
                {
                    return;
                }
                int    Type       = Convert.ToInt32(GetTextFromChatString(str, "Type"));
                String Channel    = GetTextFromChatString(str, "Channel");
                String PlayerName = GetTextFromChatString(str, "Player Name");
                String Text       = GetTextFromChatString(str, "Text");
                if (Type == 1)//Say
                {
                    if (Objects[0].Name == PlayerName)
                    {
                        WowControl.ChatBug     = true;
                        WowControl.ChatBugTime = DateTime.Now;
                    }
                    NewString = " [" + PlayerName + "] " + Text;
                    if (WowControl.SayChat[i] != NewString)
                    {
                        WowControl.SayChat[i] = NewString;
                        WowControl.SayChatParsed.Add(WowControl.GetTimeStr() + NewString);
                    }
                }
                else if ((Type == 7) || (Type == 23) || (Type == 9))//Whisper
                {
                    NewString = " [" + PlayerName + "] " + Text;
                    if (WowControl.WisperChat[i] != NewString)
                    {
                        WowControl.WisperChat[i] = NewString;
                        switch (Type)
                        {
                        case 7:
                            NewString = " [" + PlayerName + "] <== " + Text;
                            WowControl.WisperChatParsed.Add(WowControl.GetTimeStr() + NewString);
                            break;

                        case 23:
                            NewString = " [" + PlayerName + "] <" + Text + ">";
                            WowControl.WisperChatParsed.Add(WowControl.GetTimeStr() + NewString);
                            break;

                        case 9:
                            NewString = " [" + PlayerName + "] ==> " + Text;
                            WowControl.WisperChatParsed.Add(WowControl.GetTimeStr() + NewString);
                            break;
                        }
                    }
                }
                else//All
                {
                    NewString = " [" + PlayerName + "] " + Text;
                    if (WowControl.AllChat[i] != NewString)
                    {
                        WowControl.AllChat[i] = NewString;
                        WowControl.AllChatParsed.Add(WowControl.GetTimeStr() + NewString);
                    }
                }
            }
        }
Пример #4
0
        //Initialize
        protected override void Initialize()
        {
            System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.RealTime;

            //Set the windows forms, and directX graphics buffer to match the screen of the host computer
            int             maxHeight = 0; int maxWidth = 0; // vars to choose the max width and height
            GraphicsAdapter g = graphics.GraphicsDevice.Adapter;

            foreach (DisplayMode dm in g.SupportedDisplayModes)
            {
                if (maxHeight < dm.Height)
                {
                    maxHeight = dm.Height;
                }
                if (maxWidth < dm.Width)
                {
                    maxWidth = dm.Width;
                }
            }
            graphics.PreferredBackBufferHeight = maxHeight;
            graphics.PreferredBackBufferWidth  = maxWidth;

            //Configure DirectX graphics device
            graphics.GraphicsDevice.DepthStencilState = DepthStencilState.None;
            graphics.PreferMultiSampling = false;  //Set to true to have smooth texture edges
            GraphicsDevice.PresentationParameters.PresentationInterval = PresentInterval.One;
            graphics.ApplyChanges();

            //Merge directX drawing buffer with GDI+ drawing surface
            int[] margins = new int[] { 0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight };
            User32.DwmExtendFrameIntoClientArea(Window.Handle, ref margins);
            //xna game form
            form                   = System.Windows.Forms.Control.FromHandle(Window.Handle).FindForm();
            form.Visible           = true;
            form.AllowTransparency = true;
            //form.BackColor = System.Drawing.Color.Transparent;
            form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            form.TransparencyKey = form.BackColor;
            form.TopMost         = true;
            form.DesktopLocation = new System.Drawing.Point(0, 0);
            form.ClientSize      = new System.Drawing.Size(GraphicsDevice.DisplayMode.Width, GraphicsDevice.DisplayMode.Height);

            //Create a new directX spritebatch
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Initialize SSVEP (Using DirectX)
            SSVEP_DirectX_Advanced_V2 ssvepDX = new SSVEP_DirectX_Advanced_V2(this);

            ssvepDX.Initialize(form, spriteBatch);
            Components.Add(ssvepDX);

            switch (selectedApp)
            {
            case 0:
                var appControl = new BCI_Logic.BCI2000_Control.AnyApp.AdvancedControl(this);
                Components.Add(appControl);
                break;

            case 1:
                var appControl1 = new BCI_Logic.BCI2000_Control.AnyApp.BasicControl(this);
                Components.Add(appControl1);
                break;

            case 2:
                var appControl2 = new WowControl(this, "World Of Warcraft");
                Components.Add(appControl2);
                break;

            case 3:
                var appControl3 = new SpecificAppControl(this, "Google Earth");
                Components.Add(appControl3);
                break;

            case 4:
                var appControl4 = new CursorControl(this);
                Components.Add(appControl4);
                break;

            case 5:
                var appControl5 = new BCI_Logic.BCI2000_Control.AnyApp.AdvancedControl(this);
                Components.Add(appControl5);
                break;
            }


            //Cursor practice
            // InitCursor();
            //mousePos.X=GraphicsDevice.Viewport.Width / 2;
            //mousePos.Y=GraphicsDevice.Viewport.Height / 2;
            //Mouse.SetPosition(mousePos.X,mousePos.Y);

            base.Initialize();
        }