示例#1
0
 public void showPreview(Client c)
 {
     client = c;
     this.Show();
     int i = DwmRegisterThumbnail(this.Handle, client.Process.MainWindowHandle, out thumb);
     UpdateThumb();
 }
示例#2
0
        public HookProxy(Client client)
        {
            this.client = client;
            serverRecvMsg = new NetworkMessage(client);
            serverSendMsg = new NetworkMessage(client);
            clientRecvMsg = new NetworkMessage(client);
            clientSendMsg = new NetworkMessage(client);

            if (client.Dll.Pipe == null)
            {
                client.Dll.InitializePipe();
                client.Dll.PipeIsReady.WaitOne();
            }

            client.Dll.Pipe.OnSocketRecv += new Pipe.PipeListener(Pipe_OnSocketRecv);
            client.Dll.Pipe.OnSocketSend += new Pipe.PipeListener(Pipe_OnSocketSend);

            if (client.LoggedIn)
            {
                protocol = Protocol.World;
            }
            else
            {
                protocol = Protocol.None;
            }
        }
示例#3
0
文件: Hotkey.cs 项目: Xileck/tibiaapi
 public Hotkey(Client client, byte number)
 {
     if (number < 0 || number > Addresses.Hotkey.MaxHotkeys)
         throw new ArgumentOutOfRangeException("number", "Hotkey number must be between 0 and Addresses.Hotkey.MaxHotkeys.");
     this.client = client;
     this.number = number;
 }
示例#4
0
文件: Pipe.cs 项目: Xileck/tibiaapi
 /// <summary>
 ///  Creates a Pipe to interact with an injected DLL or another program.
 /// </summary>
 public Pipe(Client client, string name)
 {
     this.client = client;
     this.name = name;
     pipe = new NamedPipeServerStream(name, PipeDirection.InOut, -1, PipeTransmissionMode.Message, PipeOptions.Asynchronous);
     pipe.BeginWaitForConnection(new AsyncCallback(BeginWaitForConnection), null);
 }
示例#5
0
 public CamLoader(Client client, ProxyBase proxy, Action<string> logMethod)
 {
     this.client = client;
     this.proxy = proxy;
     this.logMethod = logMethod;
     InitializeComponent();
 }
示例#6
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            _client = Tibia.Util.ClientChooser.ShowBox();

            if (_client != null)
            {
                if (!_client.LoggedIn)
                {

                    _client.Exited += new EventHandler(_client_Exited);

                    _client.IO.StartProxy();
                    //autoloot
                    _client.IO.Proxy.ReceivedTextMessageIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedTextMessageIncomingPacket);
                    _client.IO.Proxy.ReceivedContainerUpdateItemIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedContainerUpdateItemIncomingPacket);
                    _client.IO.Proxy.ReceivedContainerRemoveItemIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedContainerRemoveItemIncomingPacket);
                    _client.IO.Proxy.ReceivedContainerAddItemIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedContainerAddItemIncomingPacket);
                    _client.IO.Proxy.ReceivedTileAddThingIncomingPacket += new Proxy.IncomingPacketListener(_proxy_ReceivedTileAddThingIncomingPacket);
                    _client.IO.Proxy.ReceivedContainerOpenIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedContainerOpenIncomingPacket);
                }
                else
                    MessageBox.Show("Please start this program before login.");
            }
            else
                Application.Exit();
        }
示例#7
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            do
            {
                client = ClientChooser.ShowBox();
            } while (client == null && MessageBox.Show("Please select a Tibia client", "Notification", MessageBoxButtons.RetryCancel, MessageBoxIcon.Asterisk) == DialogResult.Retry);

            if (client == null)
            {
                Application.Exit();
                return;
            }
            else
            {
                screen = client.Screen;
                client.ContextMenu.AddContextMenu(1000, "Add as Ally", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1001, "Add as Enemy", ContextMenuType.CopyNameContextMenu, true);
                client.ContextMenu.AddContextMenu(1002, "Show Item Id", ContextMenuType.LookContextMenu, true);
                client.ContextMenu.Click += new Tibia.Objects.ContextMenu.ContextMenuEvent(ContextMenu_Click);

                client.Icon.AddIcon(1, 20, 30, 64, 1841, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("ally",new Location(20,84,0),Color.LightBlue, ClientFont.NormalBorder, "Display/Hide Allies");
                client.Icon.AddIcon(2, 20, 110, 64, 9438, 0, ClientFont.NormalBorder, Color.White);
                client.Screen.DrawScreenText("enemy", new Location(20, 164, 0), Color.Red, ClientFont.NormalBorder, "Display/Hide Enemies");

                client.Icon.Click+=new Tibia.Objects.Icon.IconEvent(Icon_Click);
            }
        }
示例#8
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            ItemInfo.LoadItemsOtb();
            mapTiles = new Dictionary<Location, OtMapTile>();
            mapCreatures = new Dictionary<Location, PacketCreature>();
            packetQueue = new Queue<SplitPacket>();

            Reset();

            client = ClientChooser.ShowBox();

            if (client != null)
            {
                if (!useHookProxy && client.LoggedIn)
                {
                    MessageBox.Show("Using the proxy requires that the client is not logged in.");
                    Application.Exit();
                }
                else if (!useHookProxy)
                {
                    client.Exited += new EventHandler(Client_Exited);
                    client.IO.StartProxy();
                }
                Start();
            }
            else
            {
                MessageBox.Show("MapTracker requires at least one running client.");
                Application.Exit();
            }

            camLoader = new CamLoader(client, proxy, Log);
            minimap = new MiniMap();
        }
示例#9
0
 public override void Enable()
 {
     Host.DefaultProfile.Set(this, "test", "hello world");
     client = this.Host.Client;
     proxy = this.Host.Proxy;
     proxy.ReceivedSelfAppearIncomingPacket += new ProxyBase.IncomingPacketListener(ReceivedSelfAppearIncomingPacket);
     proxy.ReceivedPlayerSpeechOutgoingPacket += new ProxyBase.OutgoingPacketListener(ReceivedPlayerSpeechOutgoingPacket);
 }
示例#10
0
 public ClientChooserWPF()
 {
     InitializeComponent();
     ShowInTaskbar = true;
     uxUseOT.IsExpanded = false;
     uxLoginServerLabel.Content = LoginServerDisabled;
     uxLoginServerLabel.Foreground = Brushes.PaleVioletRed;
     client = null;
 }
示例#11
0
        //packet tile constructors
        internal Tile(Client client, uint groundId, Location location)
        {
            this.type = ObjectType.Packet;
            this.client = client;
            this.location = location;
            this.items = new List<Item>();

            if (groundId > 0)
                this.ground = new Item(client, groundId);
        }
示例#12
0
 private void MainForm_Load(object sender, EventArgs e)
 {
     client = ClientChooser.ShowBox();
     if (client != null)
         if (client.LoggedIn)
         {
             player = client.GetPlayer();
             uxMap.Markers.Add(new MapViewer.MapMarker(player));
         }
 }
示例#13
0
        internal Tile(Client client, uint address, uint squareNumber)
        {
            this.type = ObjectType.Memory;
            this.client = client;
            this.squareNumber = squareNumber;
            this.address = address;
            this.memoryLocation = squareNumber.ToMemoryLocation();

            this.objectCount = client.Memory.ReadInt32(address + Tibia.Addresses.Map.DistanceTileObjectCount) - 1;
            this.ground = new Item(client, client.Memory.ReadUInt32(address +
                Tibia.Addresses.Map.DistanceTileObjects + Tibia.Addresses.Map.DistanceObjectId));
        }
示例#14
0
        public Core(string clientChooserTitle, string mutexName, bool proxy, bool useWPF)
        {
            KeyboardHook.Enable();

            do
            {
                ClientChooserOptions clientChooserOptions = new ClientChooserOptions();
                clientChooserOptions.Title = clientChooserTitle;
                clientChooserOptions.ShowOTOption = true;
                clientChooserOptions.OfflineOnly = proxy;

                if (useWPF)
                {
                    Client = ClientChooserWPF.ShowBox(clientChooserOptions);
                }
                else
                {
                    Client = ClientChooser.ShowBox(clientChooserOptions);
                }

                if (Client != null)
                {
                    kedrahMutex = new Mutex(true, "Kedrah_" + mutexName + Client.Process.Id.ToString());

                    if (!kedrahMutex.WaitOne(0, false))
                    {
                        Client = null;
                        continue;
                    }

                    System.Diagnostics.Process.GetCurrentProcess().PriorityClass = System.Diagnostics.ProcessPriorityClass.AboveNormal;
                    Client.Process.Exited += new EventHandler(ClientClosed);

                    if (proxy)
                    {
                        Client.IO.StartProxy();
                        Proxy = Client.IO.Proxy;

                        Proxy.PlayerLogin += new EventHandler(OnLogin);
                        Proxy.PlayerLogout += new EventHandler(OnLogout);
                    }
                    else
                    {
                        loginChecker.Execute += new Tibia.Util.Timer.TimerExecution(loginChecker_Execute);
                        loginChecker.Start();
                    }

                    Modules = new HModules(this);
                    Kedrah.Extensions.Core = this;
                }
            } while (Client == null);
        }
示例#15
0
        private void frmMain_Load(object sender, EventArgs e)
        {
            Client = ClientChooser.ShowBox();
            if (Client == null || !Client.LoggedIn)

            {
                MessageBox.Show("You must have at least one client open and logged in.");
                Application.Exit();
            }
            else
            {
                Player = Client.GetPlayer();
            }
        }
示例#16
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            client = ClientChooser.ShowBox();

            if (client == null || !client.LoggedIn)
            {
                MessageBox.Show("You must have at least one client open and logged in to start this program.");
                Application.Exit();
            }
            else
            {
                rune = RuneChooser.ShowBox();
                notifyIcon.Icon = new System.Drawing.Icon(GetType(), "icon.ico");
                start();
            }
        }
示例#17
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            client = Client.Open();
            client.IO.StartProxy();
            proxy = client.IO.Proxy;
            hookProxy = new HookProxy(client);

            proxy.ReceivedSelfAppearIncomingPacket += new ProxyBase.IncomingPacketListener(
                delegate(IncomingPacket p)
                {
                    Success(uxProxyStatus);
                    return true;
                });

            hookProxy.ReceivedSelfAppearIncomingPacket += new ProxyBase.IncomingPacketListener(
                delegate(IncomingPacket p)
                {
                    Success(uxHookProxyStatus);
                    return true;
                });
        }
示例#18
0
        private void uxForm_Load(object sender, EventArgs e)
        {
            client = Tibia.Util.ClientChooser.ShowBox();

            if (client == null)
            {
                MessageBox.Show("No active client.");
                Application.Exit();
            }
            else
            {
                InitializeProxy();
            }

            foreach (byte t in Enum.GetValues(typeof(IncomingPacketType)))
            {
                incomingPacketTypeNames.Add(t, Enum.GetName(typeof(IncomingPacketType), t));
            }

            foreach (byte t in Enum.GetValues(typeof(OutgoingPacketType)))
            {
                outgoingPacketTypeNames.Add(t, Enum.GetName(typeof(OutgoingPacketType), t));
            }

            uxTypes.Items.Add("(Any)");
            uxTypes.SelectedIndex = 0;
            foreach (KeyValuePair<byte, string> kvp in incomingPacketTypeNames)
            {
                uxTypes.Items.Add(new PacketType(kvp.Key, kvp.Value, true));
            }
            foreach (KeyValuePair<byte, string> kvp in outgoingPacketTypeNames)
            {
                uxTypes.Items.Add(new PacketType(kvp.Key, kvp.Value, false));
            }
            
        }
示例#19
0
文件: Player.cs 项目: Xileck/tibiaapi
 /// <summary>
 /// Default constructor, same as Objects.Creature.
 /// </summary>
 /// <param name="client">The client.</param>
 /// <param name="address">The address.</param>
 public Player(Client client, uint address)
     : base(client, address) { }
示例#20
0
 public RemoveTextPacket(Client client)
     : base(client)
 {
     Type = PipePacketType.RemoveText;
 }
示例#21
0
 internal LoginHelper(Client client) 
 {
     this.client = client; 
 }
示例#22
0
 public AddContextMenuPacket(Client client)
     : base(client)
 {
     Type = PipePacketType.AddContextMenu;
 }
示例#23
0
 public HookSendToServerPacket(Client client)
     : base(client)
 {
     Type = PipePacketType.HookSendToServer;
 }
示例#24
0
文件: Vip.cs 项目: Xileck/tibiaapi
 internal Vip(Client client, uint address)
 {
     this.client = client;
     this.address = address;
 }
示例#25
0
 internal DllHelper(Client client)
 {
     this.client = client;
     pipeIsReady = new AutoResetEvent(false);
 }
示例#26
0
 /// <summary>
 /// Create a new inventory object with the specified client.
 /// </summary>
 /// <param name="c"></param>
 public Console(Client client)
 {
     this.client = client;
 }
示例#27
0
 public UpdateIconPacket(Client client)
     : base(client)
 {
     Type = PipePacketType.UpdateIcon;
 }
示例#28
0
 internal WindowHelper(Client client) { this.client = client; }
示例#29
0
文件: Icon.cs 项目: Xileck/tibiaapi
 internal Icon(Client client)
 {
     this.client = client;
     iconIds=new List<uint>();
 }
示例#30
0
 /// <summary>
 /// Create a new inventory object with the specified client.
 /// </summary>
 /// <param name="client">The client.</param>
 public Inventory(Client client)
 {
     this.client = client;
 }