public TCPServer(GameSimulation simulation) { ipAddress = ConfigValueStore.GetValue("ipaddress"); port = Int32.Parse(ConfigValueStore.GetValue("port")); sim = simulation; messages = new Queue <NetworkMessage>(); networkThread = new Thread(new ThreadStart(StartServer)); connectedClients = new List <TcpClient>(); networkThread.Start(); SetupEvents(); }
// Use this for initialization void Start() { simulation = new GameSimulation(); server = new TCPServer(simulation); cam = GameObject.Find("CameraRig").GetComponent <StadiumCam>(); scoreBoard = GameObject.Find("Scoreboard").GetComponent <Text>(); timer = GameObject.Find("Timer").GetComponent <Text>(); gameDuration = new TimeSpan(0, 0, Int32.Parse(ConfigValueStore.GetValue("game_time"))); timer.text = string.Format("{0:hh\\:mm\\:ss}", gameDuration); scoreRefreshTime = DateTime.Now; }