private IEnumerator <IYieldInstruction> UpdateGameServerConnectionsContinuously() { while (true) { var peersCount = peerContainer.GetPeersCount(); if (connections != peersCount) { connections = peersCount; UpdateGameServerConnections(); } yield return(new WaitForSeconds(CONNECTIONS_UPDATE_TIME)); } }
public GameServerProviderService() { peerContainer = ServerComponents.GetComponent <IPeerContainer>().AssertNotNull(); connections = peerContainer.GetPeersCount(); }