コード例 #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));
        }
コード例 #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();
        }
コード例 #3
0
ファイル: NetworkClient.cs プロジェクト: zhangyu233/pbo0791
 public NetworkClient(IProtocolInterpreter interpreter, INetworkStrategy networkStrategy) : base(networkStrategy)
 {
     this._bufferedPackages = new List <ByteArray>();
     this._backupPackages   = new List <ByteArray>();
     this._interpreter      = interpreter;
 }
コード例 #4
0
ファイル: NetworkClient.cs プロジェクト: zhangyu233/pbo0791
 protected NetworkClient(INetworkStrategy networkStrategy) : this(null, networkStrategy)
 {
 }
コード例 #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;
 }
コード例 #6
0
 protected NetworkServer(INetworkStrategy networkStrategy) : this(null, networkStrategy)
 {
 }
コード例 #7
0
 protected NetworkWorker(INetworkStrategy networkStrategy)
 {
     this._networkStrategy = networkStrategy;
 }