public void Parse(string command) { string[] splitCommand = command.Split(' '); try{ switch (splitCommand[0]) { case Send: Debug.Log(splitCommand[1]); break; case Close: Network_Server.ShutDown(); break; case Begin: if (splitCommand[1].Equals("game")) { ServerMasterManager.instance.BeginGame(); } break; case Hide: ConsoleSystem.Hide(); break; default: ConsoleMsgQueue.EnqueMsg("Invalid Command"); break; } }catch (Exception e) { ConsoleMsgQueue.EnqueMsg(e.Message); } }
private IEnumerator SendPosRoutine() { while (true) { msgBody.SetContent(transform.position); Network_Server.BroadCast(new NetworkMessage(msgHeader, msgBody)); yield return(new WaitForSeconds(posSyncTime)); } }