コード例 #1
0
        public IServerType GetServerType(int serverType)
        {
            IServerType server = null;

            switch (serverType)
            {
            case 1:
                server = LoginServer;
                break;

            case 2:
                server = ChatServer;
                break;

            case 3:
                server = GameServer;
                break;

            case 0:
            default:
                server = ProxyServer;
                break;
            }

            return(server);
        }
コード例 #2
0
        public UploadService(IOptions <ServerConfig> config, IAmazonS3 s3Client)
        {
            _config     = config.Value;
            _serverType = new ServerTypeFactory().Create(_config);

            // Can't adding IAmazonS3 by factory pattern,
            // created special function and refrences the Dependency Injection
            if (_config.ServerType == ServerConfig.AWS)
            {
                (_serverType as AWSBucketServer).Register(s3Client);
            }
        }
コード例 #3
0
 public HandleServerRegistration(ILogger log, IServerType serverType, ServerConfiguration serverConfiguration)
 {
     Log                  = log;
     _serverType          = serverType;
     _serverConfiguration = serverConfiguration;
 }
コード例 #4
0
 public HandleServerRegistration(ILogger log, IServerType serverType)
 {
     Log         = log;
     _serverType = serverType;
 }