Beispiel #1
0
        public void Initialize()
        {
            var network = EntityFactory.NewEntity();
            NetworkConnectionComponent networkConnectionComponent = new NetworkConnectionComponent(network);

            networkConnectionComponent.IPAddress = NetworkHelper.GetCurrentIPAddress();
            networkConnectionComponent.Port      = NetworkHelper.GetPort();
            ComponentManager.Instance.AddComponentToEntity(network, networkConnectionComponent);
            networkConnectionManager             = new NetworkConnectionManager(NetworkHelper.ConnectionType.Client);
            gameManager.NetworkConnectionManager = networkConnectionManager;
        }
 private void InitConnectionManager()
 {
     networkConnectionComponent = ComponentManager.Instance.GetDictionary <NetworkConnectionComponent>()
                                  .FirstOrDefault().Value as NetworkConnectionComponent;
     if (networkConnectionComponent == null)
     {
         return;
     }
     netPeerConfiguration =
         new NetPeerConfiguration("thundercats")
     {
         Port = networkConnectionComponent.Port
     };
 }