public Wp7ConnectionDriver(Runtime.Runtime runtime, MemoryStream memStream) : base(false) { try { _memStream = memStream; _runtime = runtime; _runtime.Driver = this; _incoming = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); SocketAsyncEventArgs args = new SocketAsyncEventArgs(); args.Completed += new EventHandler<SocketAsyncEventArgs>(OnConnected); args.RemoteEndPoint = new DnsEndPoint(HOST, PORT); if (!_incoming.ConnectAsync(args)) { OnConnected(null, args); } } catch (SocketException e) { throw new ConnectionException(e); } }
private void OnInitialize() { string openModDirectory = Path.GetFullPath($"Servers/{Dedicator.serverID}/OpenMod/"); if (!Directory.Exists(openModDirectory)) { Directory.CreateDirectory(openModDirectory); } var parameters = new RuntimeInitParameters { CommandlineArgs = Environment.GetCommandLineArgs(), WorkingDirectory = openModDirectory }; var assemblies = new List <Assembly> { typeof(OpenMod.UnityEngine.UnityMainThreadDispatcher).Assembly, typeof(OpenModUnturnedHost).Assembly }; var runtime = new Runtime.Runtime(); runtime.Init(assemblies, parameters); }
public Wp7ConnectionDriver(Runtime.Runtime runtime, MemoryStream memStream) : base(false) { try { _memStream = memStream; _runtime = runtime; _runtime.Driver = this; _incoming = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); SocketAsyncEventArgs args = new SocketAsyncEventArgs(); args.Completed += new EventHandler <SocketAsyncEventArgs>(OnConnected); args.RemoteEndPoint = new DnsEndPoint(HOST, PORT); if (!_incoming.ConnectAsync(args)) { OnConnected(null, args); } } catch (SocketException e) { throw new ConnectionException(e); } }
private static async Task Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; var path = Path.Combine(AppContext.BaseDirectory, "openmod"); var runtime = new Runtime.Runtime(); var host = await runtime.InitAsync(new List <Assembly> { typeof(Program).Assembly }, new RuntimeInitParameters { CommandlineArgs = args, WorkingDirectory = path }); var applifecycle = host.Services.GetRequiredService <IHostApplicationLifetime>(); applifecycle.ApplicationStopping.Register(StandaloneConsoleIo.StopListening); var autoCompletionHandler = host.Services.GetRequiredService <IAutoCompleteHandler>(); ReadLine.AutoCompletionHandler = autoCompletionHandler; ReadLine.HistoryEnabled = true; StandaloneConsoleIo.StartListening(); }
private void OnInitialize() { System.Environment.CurrentDirectory = ReadWrite.PATH; var openModDirectory = Path.Combine(ReadWrite.PATH, $"Servers/{Dedicator.serverID}/OpenMod/"); if (!Directory.Exists(openModDirectory)) { Directory.CreateDirectory(openModDirectory); } var parameters = new RuntimeInitParameters { CommandlineArgs = System.Environment.GetCommandLineArgs(), WorkingDirectory = openModDirectory }; var assemblies = new List <Assembly> { typeof(OpenModUnityEnginePlugin).Assembly, typeof(OpenModUnturnedHost).Assembly }; OpenModRuntime = new Runtime.Runtime(); OpenModRuntime.Init(assemblies, parameters); m_SharedModule.OnPostInitialize(); }
public override void Load() { var openModDirectory = Path.Combine(Interface.Oxide.RootDirectory, "openmod"); if (!Directory.Exists(openModDirectory)) { Directory.CreateDirectory(openModDirectory); } var parameters = new RuntimeInitParameters { CommandlineArgs = Environment.GetCommandLineArgs(), WorkingDirectory = openModDirectory }; var assemblies = new List <Assembly> { typeof(OpenModUnityEnginePlugin).Assembly, typeof(OpenModRustOxideHost).Assembly, typeof(BaseOpenModRustHost).Assembly }; var openModRuntime = new Runtime.Runtime(); OpenModRuntime = openModRuntime; openModRuntime.Init(assemblies, parameters); }
private static void DisposeRuntime() { if (SharedRuntime == null) { return; } Common.Util.DisposeObject(SharedRuntime); SharedRuntime = null; }
public KeyFrameDriver(IKeyFrame provider, Runtime.Runtime runtime) : base(false) { _runtime = runtime; _runtime.Driver = this; _provider = provider; Start(); }
public KeyFrameDriver(IKeyFrame provider, Runtime.Runtime runtime) : base(false) { _runtime = runtime; _runtime.Driver = this; _provider = provider; Start(); }
private void LogOut(object sender, RoutedEventArgs e) { SignInWindow signInWindow = new SignInWindow(); signInWindow.Show(); this.Close(); confirmPasswordWindow.Close(); runtime = null; TbIcon.Dispose(); }
private void frmMain_Load(object sender, EventArgs e) { nfyTrayIcon.Text = Application.ProductName; Text = Application.ProductName + " v" + Application.ProductVersion; SharedRuntime = new Runtime.Runtime(); PopulateSignalsView(); if (Settings.Default.StartRunningWhenLaunched) { Start(); } }
public SettingsWindow(UserInfoModel user) { InitializeComponent(); emailConfirmation = new EmailConfirmationMethods(); userSettings = new UserSettingsMethods(); _user = user; InitializeUserSettings(); confirmPasswordWindow = new ConfirmPasswordWindow(_user, this); Email.Content = _user.Email; runtime = new Runtime.Runtime(_user.EyesTimer, _user.EatingTimer, _user.ExerciseTimer, _user.ShutDownTimer); }
public W8ConnectionDriver(Runtime.Runtime runtime, MemoryStream memStream) : base(false) { _memStream = memStream; _runtime = runtime; _runtime.Driver = this; _socket = new StreamSocket(); _socket.ConnectAsync(new HostName(HOST), PORT.ToString()).AsTask().Wait(); OnConnected(); }
//private readonly ILog _log = LogManager.GetLogger("FileCapDriver"); public FileCapDriver(string capFile, MemoryStream memStream, Runtime.Runtime runtime) : base(false) { _memStream = memStream; #if WINRT _path = capFile; #else _fileStream = File.OpenRead(capFile); #endif _runtime = runtime; _runtime.Driver = this; Start(); }
//private readonly ILog _log = LogManager.GetLogger("FileCapDriver"); public FileCapDriver(string capFile, MemoryStream memStream, Runtime.Runtime runtime) : base(false) { _memStream = memStream; #if WINRT _path = capFile; #else _fileStream = File.OpenRead(capFile); #endif _runtime = runtime; _runtime.Driver = this; Start(); }
public AsyncConnectionDriver(Runtime.Runtime runtime, MemoryStream memStream) : base(false) { try { _memStream = memStream; _runtime = runtime; _runtime.Driver = this; IPHostEntry e = Dns.GetHostEntry(HOST); _incoming = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _log.InfoFormat("Resolved {0} to {1}.", HOST, e.AddressList[0].ToString()); _log.Info("Connecting..."); #if COMPACT EndPoint ep = new IPEndPoint(e.AddressList[0], PORT); _incoming.Connect(ep); _incoming.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 10000); #else _incoming.Connect(e.AddressList, PORT); _incoming.ReceiveTimeout = 10000; // 10 seconds because we may not always be receiving data #endif // Queue the first read and write CmdQueue.Push(CommandFactory.MakeCommand(DoNextRead, new byte[BLOB_SIZE])); CmdQueue.Push(CommandFactory.MakeCommand(DoPing)); Start(); // We've sent the first request so schedule timer to start one interval later _timer = new Timer(TimerPingCallback, null, _refreshRate, _refreshRate); _log.Info("Connected."); } catch (SocketException e) { throw new ConnectionException(e); } }
public AsyncConnectionDriver(Runtime.Runtime runtime, MemoryStream memStream) : base(false) { try { _memStream = memStream; _runtime = runtime; _runtime.Driver = this; IPHostEntry e = Dns.GetHostEntry(HOST); _incoming = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); _log.InfoFormat("Resolved {0} to {1}.", HOST, e.AddressList[0].ToString()); _log.Info("Connecting..."); #if COMPACT EndPoint ep = new IPEndPoint(e.AddressList[0], PORT); _incoming.Connect(ep); _incoming.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 10000); #else _incoming.Connect(e.AddressList, PORT); _incoming.ReceiveTimeout = 10000; // 10 seconds because we may not always be receiving data #endif // Queue the first read and write CmdQueue.Push(CommandFactory.MakeCommand(DoNextRead, new byte[BLOB_SIZE])); CmdQueue.Push(CommandFactory.MakeCommand(DoPing)); Start(); // We've sent the first request so schedule timer to start one interval later _timer = new Timer(TimerPingCallback, null, _refreshRate, _refreshRate); _log.Info("Connected."); } catch (SocketException e) { throw new ConnectionException(e); } }
private static async Task Main(string[] args) { Console.OutputEncoding = System.Text.Encoding.UTF8; var path = Path.GetFullPath("openmod"); var runtime = new Runtime.Runtime(); var host = await runtime.InitAsync(new List <Assembly> { typeof(Program).Assembly }, new RuntimeInitParameters { CommandlineArgs = args, WorkingDirectory = path }); var applifecycle = host.Services.GetRequiredService <IHostApplicationLifetime>(); applifecycle.ApplicationStopped.Register(StandaloneConsoleIo.StopListening); StandaloneConsoleIo.StartListening(); }
public static void Initialize() { string openModDirectory = Path.GetFullPath($"Servers/{Dedicator.serverID}/OpenMod/"); if (!Directory.Exists(openModDirectory)) { Directory.CreateDirectory(openModDirectory); } #if NUGET_BOOTSTRAP Console.WriteLine("Bootstrapping OpenMod for Unturned, this might take a while..."); var bootrapper = new OpenModDynamicBootstrapper(); bootrapper.Bootstrap( openModDirectory, Environment.GetCommandLineArgs(), new List <string> { "OpenMod.Unturned" }, false, new NuGetConsoleLogger()); #else var parameters = new RuntimeInitParameters { CommandlineArgs = Environment.GetCommandLineArgs(), WorkingDirectory = openModDirectory }; var assemblies = new List <Assembly> { typeof(OpenMod.UnityEngine.UnityMainThreadDispatcher).Assembly, typeof(OpenMod.Unturned.OpenModUnturnedHost).Assembly }; var runtime = new Runtime.Runtime(); runtime.Init(assemblies, parameters); #endif }
public void shutdown() { m_SharedModule.Shutdown(); OpenModRuntime = null; }