static void Main(string[] args) { outputpack = new BabylonMS.BMSPack(); bms = BabylonMS.BabylonMS.ShipDocking(shipUUID, args); bms.NewInputFrame += NewInputFrame; bms.OpenGate(true); }
public Recv() { bms = BabylonMS.BabylonMS.ShipDocking(Program.shipUUID, Program.Args); bms.Connected += ClientConnected; bms.Disconnected += Disconnected; bms.NewInputFrame += NewInputFrame; bms.OpenGate(false);//client }
public Recv() { bms = BabylonMS.BabylonMS.ShipDocking("127.0.0.1", 9020, Program.shipUUID); bms.Connected += ClientConnected; bms.Disconnected += Disconnected; bms.NewInputFrame += NewInputFrame; bms.OpenGate(false);//server }
static void Main(string[] args) { mediaserver = new MediaServer(); IDGenerator = new ObjectIDGenerator(); clientFollower = new ClientFollower(); tcp = BabylonMS.BabylonMS.ShipDocking(ip_imagebuffer, port_imagebuffer, shipUUID); tcp.Connected += TCPClientConnected; tcp.Disconnected += TCPDisconnected; tcp.NewInputFrame += TCPNewInputFrame; tcp.OpenGate(true);//NET Server }
//public BabylonMS.BabylonMS req; public Androids(string[] args) { AndroidsList = new List <AndroidDescriptor>(); try { tcp = BabylonMS.BabylonMS.ShipDocking(Program.ip_partner, Program.port_partner, UUIDAndroid); //server tcp.Connected += NewAndroidConnected; tcp.Disconnected += AndroidDisconnected; tcp.NewInputFrame += InputFrame_fromAnAndroid; tcp.OpenGate(false); //Server } catch (Exception) { Console.WriteLine(Program.ERR_ANDROIDLOAD); Program.terminate(); } }
static void Main(string[] args) { _handler += new EventHandler(Handler); SetConsoleCtrlHandler(_handler, true); Application.EnableVisualStyles(); User32.HideMouse(); User32.ShowMouse(); bms = BabylonMS.BabylonMS.ShipDocking(shipUUID, args); bms.Connected += Connected; bms.Disconnected += Disconnected; bms.NewInputFrame += NewInputFrame; bms.Waitbytes += WaitBytes; bms.WaitBytesMS = 5; bms.OpenGate(false); //Client //BabylonMS.Util.setPriorityUp(); if (TEST_INPUTCONTROLLER) { hook = new MouseHooker(); //for test because the Connect activate the Mousehooker } Application.Run(); //Application.Run(new Form1()); while (true) { try { Thread.Sleep(5); for (int i = 0; i < 4; i++) { Application.DoEvents(); } } catch (Exception) { } } }
static void Main(string[] args) { hwnd = IntPtr.Zero; datavalid = false; bms = BabylonMS.BabylonMS.ShipDocking(shipUUID, args); bms.Connected += ClientConnected; bms.Disconnected += Disconnected; bms.NewInputFrame += NewInputFrame; bms.OpenGate(false);//client stopWatch = Stopwatch.StartNew(); while (true) { if (datavalid) { if (stopWatch.ElapsedMilliseconds > mintime) { stopWatch.Restart(); try { ContentCapture.User32.RECT r = new ContentCapture.User32.RECT(); ContentCapture.User32.GetWindowRect(hwnd, ref r); MemoryStream zmem = new BabylonMS.zipper(ContentCapture.CaptureWindowToStream(hwnd, JPEGQuality)).GetZip(false); BabylonMS.BMSField data = screensession.outputPack.GetFieldByName("DATA"); BabylonMS.BMSField recta = screensession.outputPack.GetFieldByName("RECT"); if (data != null) { data.Value(zmem.ToArray()); } if (recta != null) { recta.Value((Int16)r.left); recta.Value((Int16)r.top); recta.Value((Int16)r.right); recta.Value((Int16)r.bottom); } if (!screensession.TransferPacket(true)) { Disconnected(null); } if (data != null) { data.clearValue(); } if (recta != null) { recta.clearValue(); } } catch (Exception) { Disconnected(null); }; } else { Thread.Sleep(10); } } else { Thread.Sleep(300); live--; if (live < 0) { Disconnected(null); //exit } } } }