public ActionResult Index() { UserLogic gl = new UserLogic(); RequestLogic rl = new RequestLogic(); ServerLogic sl = new ServerLogic(); //Different models RequestDataViewModel rdvm = rl.GetRequestResponseTimeGraphData(); ServerDataViewModel sdvm = sl.GetServerData(10); SettingLogic s = new SettingLogic(); //events EventViewModel evm = new EventViewModel(); evm.Events = new EventLogic().GetLastEvents(5); evm.NotificationCount = Facade.NotificationDomainController.GetAll().Where(x => x.Seen == false).ToList().Count; //MasterViewModel DashBoardViewModel dbvm = gl.GetUsersGraphData(); dbvm.RequestDataViewModel = rdvm; dbvm.ServerDataViewModel = sdvm; dbvm.SettingsModel = s.GetSettings(); dbvm.EventViewModel = evm; // DashBoardViewModel dbvm = gl.GetGraphDataOneHourInterval(); return(View(dbvm)); }
void Start(int port) { logic = new ServerLogic(this); _listener = TcpListener.Create(port); _listener.Start(); Console.WriteLine("Bound to port {0}", port); }
private void button1_Click(object sender, EventArgs e) { ServerLogic.somethinghappend += PrintSomething; sData.IPofServer = "127.0.0.1"; sData.PortofServer = 60000; ServerLogic.ServerOnline(sData); }
public void Setup() { inputData = new InputData { Content = new byte[1] }; new Random().NextBytes(inputData.Content); middleInputData = new InputData { Content = new byte[10 * 1024] }; new Random().NextBytes(middleInputData.Content); largeInputData = new InputData { Content = new byte[100 * 1024] }; new Random().NextBytes(largeInputData.Content); messageInputData = new InputData { Content = new byte[1024] }; new Random().NextBytes(middleInputData.Content); expectedReply = ServerLogic.Convert(inputData); middleExpectedReply = ServerLogic.Convert(middleInputData); largeExpectedReply = ServerLogic.Convert(largeInputData); messageExpectedReply = ServerLogic.Convert(messageInputData); client = new T(); }
public ServerViewModel() { Outputs = new ObservableCollection <string>(); serverLogic = new ServerLogic(ExternalAddress, Port, "Rice", ClientsConnected, _server, _isRunning, Outputs, Usernames); RunCommand = new RelayCommand((obj) => { serverLogic.Run(_status); }); StopCommand = new AsyncCommand(serverLogic.Stop); }
public ServerDataViewModel ServerData(int serverId) { ServerLogic sl = new ServerLogic(); ServerDataViewModel sdvm = sl.GetServerData(serverId); return(sdvm); }
public virtual void Setup() { ConfigurationMock = new Mock <IConfiguration>(); ProcessLogicMock = new Mock <IProcessWrapper>(); IPLogicMock = new Mock <IIPWrapper>(); LoggerMock = new Mock <ILogger <ServerLogic> >(); ServerLogic = new ServerLogic(ConfigurationMock.Object, ProcessLogicMock.Object, IPLogicMock.Object, LoggerMock.Object); }
public static void Main(string[] args) { ServerLogic server = new ServerLogic(); server.Init(); server.OnServerUpdate += PrintPlayers; server.OnMsgReceivedSize += MsgReceivedSize; server.StartServer(8181, 60); }
public ReplyData GetReply(InputData data) { var inputBuf = ByteArray.CreateFrom(data); var input = inputBuf.ConvertTo <InputData>(); var reply = ServerLogic.Convert(input); var replyBuf = ByteArray.CreateFrom(reply); return(replyBuf.ConvertTo <ReplyData>()); }
public async Task <JsonResult> AddServerWorker(Server[] swarmNodes) { try { await ServerLogic.Init(swarmNodes.ToList()); await ServerLogic.JoinAllWorkersAsync(); } catch (Exception e) { Console.WriteLine(e.Message); } return(new JsonResult("Выполнилось")); }
public Server(HostOptions options) { _options = options; ServerLogic server = new ServerLogic(); _logic = server; server.OnClientConnected += OnClientConnected; server.OnClientDisconnected += OnClientDisconnected; server.OnTick += OnTick; server.OnMessage += OnMessage; server.Start(_options.Port); }
public void run(ServerLogic logic) { Console.WriteLine("Creating Listener..."); TcpListener listener = new TcpListener(System.Net.IPAddress.Parse("127.0.0.1"), 8800); listener.Start(); Console.WriteLine("Listener started, waiting for connections"); while (true) { TcpClient client = listener.AcceptTcpClient(); Console.WriteLine("Connection established with {0}. Creating Thread...", ((IPEndPoint)client.Client.RemoteEndPoint).Address); CommunicationThread newThread = new CommunicationThread(logic, client); new Thread(new ThreadStart(newThread.run)).Start(); Console.WriteLine("Thread created."); } }
private void StartServerButton_Click(object sender, EventArgs e) { ServerConnection Sr = new ServerConnection(sData); Sr.ShowDialog(); RedLightPanel.Visible = false; GreenLightPanel.Visible = true; //ServerData.CommonSd = sData; ServerLogic.ServerOnline(sData); //ServerisOnline += ServerLogic.StartListening(sData); //////ServerisOnline(this, sData); }
private void CheckFieldChanges() { var listOfFields = GetType().GetFields(); List <InspectorTypes.FieldValue> fieldsForRemove = null; List <InspectorTypes.FieldValue> fieldsForAdd = null; foreach (var newField in listOfFields) { foreach (var oldField in Fields) { if (newField.Name.Equals(oldField.Field)) { string newValue = newField.GetValue(this).ToString(); if (!newField.GetValue(this).ToString().Equals(oldField.Value)) { // DebugCheckFieldChanges(newField, oldField, newValue); if (fieldsForAdd == null) { fieldsForAdd = new List <InspectorTypes.FieldValue>(); fieldsForRemove = new List <InspectorTypes.FieldValue>(); } fieldsForAdd.Add(new InspectorTypes.FieldValue(newField.Name, newValue)); fieldsForRemove.Add(oldField); } } } } if (fieldsForAdd == null) { return; } foreach (var fieldValue in fieldsForRemove) { Fields.Remove(fieldValue); } foreach (var field in fieldsForAdd) { Fields.Add(field); ServerLogic.AddChanges(field); } }
public async Task <JsonResult> JoinSwarmNode([FromBody] SwarmManagerNode ManagerInfo) { Logger.Success("Request to join swarm node!"); ServerLogic.InitSwarmManagerNode(ManagerInfo); try { bool isSuccess = await ServerLogic.JoinToSwarmAsync(); if (isSuccess) { Logger.Success("Successfuly joined to swarm!"); } else { Logger.Fail("Cant join to swarm!"); } return(new JsonResult(await ServerLogic.GetSwarmInfoAsync())); } catch (Exception e) { Logger.Fail($"Cant join to swarm: {e.Message}"); return(new JsonResult(e.Message)); } }
private void StopServerButton_Click(object sender, EventArgs e) { ServerLogic.StopListening(); }
static void Main(string[] args) { ServerLogic server = new ServerLogic(); server.Start(); }
void exec(ServerLogic server, object client) { PrivateUtilities.callPrivateMethod(server, "SendClientToCurrentLevel", client); }
protected override void Initialize() { base.Initialize(); this.SetWorldSize(worldSize); serverLogic = new ServerLogic(this, lobby, worldSize); }
void Awake() { server = GameObject.FindWithTag("Server").GetComponent <ServerLogic>(); slingshot = GetComponentInChildren <SlingshotCreator>(); }
void Awake() { current = this; }
public CommunicationThread(ServerLogic logic, TcpClient client) { Client = client; Logic = logic; }
public async Task <JsonResult> GetSwarmNodeInfo() { return(new JsonResult(await ServerLogic.GetSwarmInfoAsync())); }
void OnLevelWasLoaded(int level) { if (serverLogic == null && string.Compare(Application.loadedLevelName, Scenes.Main) == 0) { serverLogic = GameObject.Find("ServerLogic").GetComponent<ServerLogic>(); } else if (backLogic == null && string.Compare(Application.loadedLevelName, Scenes.Backend) == 0) { backLogic = GameObject.Find("BackendLogic").GetComponent<BackendLogic>(); } }
void Start() { ServerLogic = GameObject.Find("Game").GetComponent<ServerLogic>(); ServerLogic.RegisterPlayer(this); HUDInstance = Instantiate(HUD); if (!isLocalPlayer) { foreach (Behaviour comp in ComponentsToDisable) { comp.enabled = false; } setPlayerTag(); HUDInstance.SetActive(false); } else { this.Revealed = true; // Make sure the player does not 'reveal' itself as a team member SceneCamera = Camera.main; if (SceneCamera != null) { SceneCamera.gameObject.SetActive(false); } ServerLogic.ScoreBoardInstance = Instantiate(ScoreBoard); } }
void Awake() { motor = GetComponent<PlayerMotor>(); state = GetComponent<PlayerState>(); serverLogic = GameObject.Find("Game").GetComponent<ServerLogic>(); }
public ReplyData GetReply(InputData data) { return(ServerLogic.Convert(data)); }
void Awake() { server = GameObject.FindWithTag("Server").GetComponent<ServerLogic>(); slingshot = GetComponentInChildren<SlingshotCreator>(); }
void exec(ServerLogic server, object client) { server.GetType().GetMethod("SendClientToCurrentLevel", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(server, new object[] { client }); }
public void MakeTurn(int x, int y, int id, bool num, int victim_id, int witns_id) { Debug.Log("In PUN"); ServerLogic.SetTurn(new Turn(x, y, id, victim_id, witns_id), num); }
public Logic() { serverLogic = new ServerLogic(); }
void Awake() { instance = this; values = new int[] { life, speed, rifleAmountStart, grenadeAmountStart, boxAmountStart, largeBoxAmountStart }; _mysqlLogic = GameObject.Find("MysqlLogic"); }