Ejemplo n.º 1
0
        public static IMatchController CreateHost(this INetworkStrategy strategy,
                                                  NetworkHost host,
                                                  MatchConfig config)
        {
            var server = strategy.CreateServer(host.Server, config);
            var client = strategy.CreateClient(host.Client, config);

            return(new NetworkHostController(client, server));
        }
Ejemplo n.º 2
0
        public NetworkController()
        {
            _networkStrategy = NetworkStrategyFactory.Instance.CreateDotNetworkStrategy();

//#if NETFX_CORE
//            _networkStrategy = NetworkStrategyFactory.Instance.CreateUWPworkStrategy();
//#else
//            _networkStrategy = NetworkStrategyFactory.Instance.CreateDotNetworkStrategy();
//#endif
            ListenerStartedArgs = new ListenerStartedArgs();
            ClientConnectedArgs = new ClientConnectedArgs();
        }
Ejemplo n.º 3
0
 public NetworkClient(IProtocolInterpreter interpreter, INetworkStrategy networkStrategy) : base(networkStrategy)
 {
     this._bufferedPackages = new List <ByteArray>();
     this._backupPackages   = new List <ByteArray>();
     this._interpreter      = interpreter;
 }
Ejemplo n.º 4
0
 protected NetworkClient(INetworkStrategy networkStrategy) : this(null, networkStrategy)
 {
 }
Ejemplo n.º 5
0
 public NetworkServer(IProtocolInterpreter interpreter, INetworkStrategy networkStrategy) : base(networkStrategy)
 {
     this._clients             = new Dictionary <int, ClientSession>();
     this._disconnectedClients = new Dictionary <int, ClientSession>();
     this._interpreter         = interpreter;
 }
Ejemplo n.º 6
0
 protected NetworkServer(INetworkStrategy networkStrategy) : this(null, networkStrategy)
 {
 }
Ejemplo n.º 7
0
 protected NetworkWorker(INetworkStrategy networkStrategy)
 {
     this._networkStrategy = networkStrategy;
 }