static void Main(string[] args) { //Console.WriteLine("isLittleEndian: {0}", BitConverter.IsLittleEndian); ListenServer listenServer = new ListenServer(); listenServer.Run(); }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { DialogResult dr = MessageBox.Show("Do you want to minimize the program instead of closing it?", "Exit or minified", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation); if (dr == DialogResult.Yes) { this.WindowState = FormWindowState.Minimized; hideToolStripMenuItemNotifyIcon.Text = "Show"; this.ShowInTaskbar = false; notifyIcon.BalloonTipIcon = ToolTipIcon.Info; notifyIcon.BalloonTipTitle = "CinaRAT is now minified"; notifyIcon.BalloonTipText = "CinaRAT still running in background." + Environment.NewLine + "If you want to close the program, right click the icon and choose close."; notifyIcon.ShowBalloonTip(5000); e.Cancel = true; } else if (dr == DialogResult.No) { ListenServer.Disconnect(); UPnP.DeletePortMap(Settings.ListenPort); notifyIcon.Visible = false; notifyIcon.Dispose(); Instance = null; } else if (dr == DialogResult.Cancel) { e.Cancel = true; } }
static void Main(string[] args) { //Objects are references, meaning that as long as we do not make a new object and clone the old one //we will always have a reference to the original, even if it is changed by another thread. /* * PlayerDatabase db = PlayerDatabase.Instance; * db.CreateTestDatabase(); * var players = db.GetPlayers(); * Player derp = players[0]; * System.Console.WriteLine(derp.Name); * * System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(dothingy)); * thread.Start(); * System.Threading.Thread.Sleep(3000); * * //players = db.GetPlayers(); * * System.Console.WriteLine(derp.Name); */ BlackBoxTests test = new BlackBoxTests(); test.Start(); ListenServer listenServer = new ListenServer(); listenServer.Run(); }
private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { ListenServer.Disconnect(); UPnP.DeletePortMap(Settings.ListenPort); notifyIcon.Visible = false; notifyIcon.Dispose(); Instance = null; }
protected override void Tick() { SteamClient?.Update(); if (ListenServer.Running) { ListenServer.Update(); } }
public void Stop() { if (!IsRunning) { return; } MonitorPool.Singleton.Exit(); IsRunning = false; ListenServer.Stop(); ServiceServer.Stop(); Client.Disconnect(); }
public void Stop() { if (!IsRunning) { return; } IsRunning = false; MonitorPool.Singleton.Exit(); Client.Disconnect(); ListenServer.Stop(); Debuger.Log("Server appliaction Stoped!"); }
private void AutostartListening() { if (Settings.AutoListen && Settings.UseUPnP) { UPnP.Initialize(Settings.ListenPort); ListenServer.Listen(Settings.ListenPort); } else if (Settings.AutoListen) { UPnP.Initialize(); ListenServer.Listen(Settings.ListenPort); } else { UPnP.Initialize(); } if (Settings.EnableNoIPUpdater) { NoIpUpdater.Start(); } }
private void AutostartListening() { if (Ayarlar.AutoListen && Ayarlar.UseUPnP) { UPnP.Initialize(Ayarlar.ListenPort); ListenServer.Listen(Ayarlar.ListenPort); } else if (Ayarlar.AutoListen) { UPnP.Initialize(); ListenServer.Listen(Ayarlar.ListenPort); } else { UPnP.Initialize(); } if (Ayarlar.EnableNoIPUpdater) { NoIpUpdater.Start(); } }
public GatewayMain(LoginServerProxy loginServer) : base() { servers = new ServerRegistry(); players = new List <GatewayPlayer>(); inactivePlayers = new List <GatewayPlayer>(); loginServerProxy = loginServer; loginServerProxy.OnNewPlayerLoggedIn += NewPlayerLoginResult; playerConnectionListener = new ListenServer(NetworkConstants.defaultGatewayToClientPort, "0.0.0.0", "client-side"); playerConnectionListener.OnNewConnection += OnNewPlayerConnection; serverListener = new ListenServer(NetworkConstants.defaultGatewayToServerPort, "0.0.0.0", "server-side"); serverListener.OnNewConnection += OnNewServerConnection; Console.WriteLine("-------------------------------------------------------"); newServersAwaitingConfirmation = new List <ServerConnectionState>(); newPlayersAwaitingConfirmation = new List <PlayerConnectionState>(); serverListener.StartListening(); playerConnectionListener.StartListening(); screenRefreshTimer = new Stopwatch(); screenRefreshTimer.Start(); }
static void Main(string[] args) { //Console.WriteLine("isLittleEndian: {0}", BitConverter.IsLittleEndian); ListenServer listenServer = new ListenServer(); listenServer.Run(); }
private void OnSceneChanged(SceneType sceneType, Scene scene) { Interface.Oxide.LogDebug($"Scene changed to {scene.name} ({scene.buildIndex})."); if (sceneType == SceneType.Game) { RemotePlayer.CreatePlayerPrefab(); localPlayer = GameObject.Find("Player") ?? throw new NotImplementedException("Could not find local player"); localPlayerControl = localPlayer.GetComponent <PlayerControl>() ?? throw new NotImplementedException("Could not find PlayerControl on local player"); localPoseControl = localPlayer.transform.Find("dude/mixamorig:Hips").GetComponent <PoseControl>() ?? throw new NotImplementedException("Could not find PoseControl on local player"); localPlayerBase = localPlayer.AddComponent <LocalPlayer>(); InitSpectator(); InitUI(); InitClient(); } else if (sceneType == SceneType.Menu) { InitMenuUI(); if (firstLaunch) { firstLaunch = false; // Don't connect to server automatically if an update is available or if this is the first ever launch. if (firstEverLaunch) { menuUi.ShowFirstLaunch(); return; } if (updateAvailable) { menuUi.ShowUpdateAvailable(); return; } } else { return; } var launchArguments = Environment.GetCommandLineArgs().Skip(1).ToArray(); for (int i = 0; i < launchArguments.Length; i += 2) { string argument = launchArguments[i].ToLower(); string value = i < launchArguments.Length - 1 ? launchArguments[i + 1].ToLower() : null; if (argument == "--goimp-connect") { string[] ipPort = value.Split(':'); string ipString = ipPort[0]; string portString = ipPort[1]; IPAddress ipAddress; short port; if (!IPAddress.TryParse(ipString, out ipAddress)) { Interface.Oxide.LogError($"Launch arguments contained invalid ip: {ipString}"); return; } if (!short.TryParse(portString, out port)) { Interface.Oxide.LogError($"Launch arguments contained invalid port: {portString}"); return; } launchEndPoint = new IPEndPoint(ipAddress, port); // Wait for game to finish loading then continue game. var loader = GameObject.FindObjectOfType <Loader>(); var loadingFinishedField = typeof(Loader).GetField("loadFinished", BindingFlags.Instance | BindingFlags.NonPublic); Timer.TimerInstance timerInstance = null; Action timerCallback = () => { bool loadingFinished = (bool)loadingFinishedField.GetValue(loader); if (loadingFinished) { loader.ContinueGame(); timerInstance.Destroy(); } }; timerInstance = Timer.Repeat(0, -1, timerCallback, this); } } } if (sceneType != SceneType.Game) { DestroyClient(); DestroyUI(); DestroySpectator(); if (ListenServer.Running) { ListenServer.Stop(); } } else if (sceneType != SceneType.Menu) { DestroyMenuUI(); } }