Пример #1
0
 public MtcgServer(IDatabase database, IBattleHandler battleHandler)
 {
     _sessions              = new ConcurrentDictionary <Session, Guid>();
     _invokeBattleLimiter   = new SemaphoreSlim(2, 2);
     _invokeBattleExclusive = new SemaphoreSlim(1, 1);
     _invokeBattleHang      = new SemaphoreSlim(0, 1);
     _db          = database;
     _btl         = battleHandler;
     _store       = new CardStore(database);
     _packages    = new PackageStore(database);
     _scoreboards = new Dictionary <string, IScoreboard>(StringComparer.OrdinalIgnoreCase);
 }
Пример #2
0
 public MtcgWebServer(IWebServer webServer, IDatabase database, IBattleHandler battleHandler)
 {
     _web    = webServer;
     _server = new MtcgServer.MtcgServer(database, battleHandler);
 }
Пример #3
0
 public void Setup()
 {
     _handler = new CardImplHandler(new NullDb());
 }