public void InitializePipe() { if (pipe != null) return; pipe = new Pipe(client, "TibiaAPI" + client.Process.Id.ToString()); pipe.OnConnected += new Pipe.PipeNotification(OnPipeConnect); client.ContextMenu.AddInternalEvents(); client.Icon.AddInternalEvents(); if (!Inject(System.IO.Path.Combine(System.Windows.Forms.Application.StartupPath.ToString(), "TibiaAPI_Inject.dll"))) throw new Tibia.Exceptions.InjectDLLNotFoundException(); }
public void DisconnectPipe() { byte[] uninjectByte = { 0x2, 0x0, 0xD, 0x0 }; pipe.Send(new NetworkMessage(uninjectByte)); pipe = null; }