/// <summary> /// Initializes the specified ip. /// </summary> /// <param name="ip">The ip.</param> /// <param name="matchID">The match identifier.</param> /// <param name="username">The username.</param> /// <param name="netAdapter">The net adapter.</param> public void Initialize(string ip, string matchID, string username, MessagingNetworkAdapter netAdapter) { this.matchID = matchID; this.username = username; this.netAdapter = netAdapter; this.ip = ip; clientThread = new Thread(StartClient); clientThread.Start(); }
/// <summary> /// Initializes a new instance of the <see cref="MultiplayerMessagingAdapter"/> class. /// </summary> /// <param name="netAdapter">The net adapter.</param> /// <param name="context">The context.</param> /// <param name="username">The username.</param> /// <param name="teamId">The team identifier.</param> /// <param name="teamSpawners">The team spawners.</param> /// <param name="enemies">The enemies.</param> /// <param name="chat">The chat.</param> public MultiplayerMessagingAdapter(MessagingNetworkAdapter netAdapter, MonoBehaviour context, string username, int teamId, ArrayList[] teamSpawners, ArrayList enemies, Chat chat) { this.netAdapter = netAdapter; this.context = context; this.teamSpawners = teamSpawners; gcEnemies = enemies; this.username = username; this.teamId = teamId; this.chatInstance = chat; }
/// <summary> /// Starts the networking. /// </summary> void StartNetworking() { netAdapter = new MessagingNetworkAdapter(NetworkCli); NetworkCli.Initialize(ip, matchId, username, netAdapter); multiMessageAdapter = new MultiplayerMessagingAdapter(netAdapter, this, username, teamId, teamSpawners, enemies, chatScrollView.GetComponent<Chat>()); buildMode.Initialize(multiMessageAdapter); enemyMode.Initialize(multiMessageAdapter, (teamId == 1 ? 2 : 1), teamSpawners, enemies); chatScrollView.GetComponent<Chat>().Initialize(multiMessageAdapter); }
/// <summary> /// Initializes a new instance of the <see cref="NetworkMock"/> class. /// </summary> /// <param name="syncObj">The synchronize object.</param> public NetworkMock(MessagingNetworkAdapter syncObj) { this.syncObj = syncObj; }