Exemplo n.º 1
0
        public BotTestServer(int serverPort, int wolfCount, int serverSideBotsCount = 0)
        {
            _test = new ToonKnifeTest();
            ToonKnifeTest.current = _test;
            _test.UserCount       = wolfCount * 2;

            //TODO как-то надо протестить много каток подряд с одного лкиента без переподключения
            _test.Step_AllRabbitUsers_SendFail.overrideValueToSuccess = _test.RabbitTotalCount;
            _test.Step_AllWolfUsers_SendWin.overrideValueToSuccess    = _test.WolfTotalCount;

            _server = new Server.Server();

            _server.UserFightQueue.UserEnqueue += UserFightQueue_UserEnqueue;
            _server.FightList.FightCreated     += FightList_FightCreated;

            // scs
            _scsServer                     = new ScsService.Server.ScsService(serverPort);
            _scsServer.OnUserLogin        += ScsServer_OnUserLogin;
            _scsServer.OnUserDisconnected += ScsServer_OnUserDisconnected;
            _scsServer.Start();

            for (int i = 0; i < serverSideBotsCount; i++)
            {
            }
        }
Exemplo n.º 2
0
        public ServerAdapter(int serverPort)
        {
            _toonKnifeServer = new Server();

            _scsServer                     = new ScsService.Server.ScsService(5500);
            _scsServer.OnUserLogin        += ScsServer_OnUserLogin;
            _scsServer.OnUserDisconnected += ScsServer_OnUserDisconnected;
        }
Exemplo n.º 3
0
        public TestServer(int tcpPort)
        {
            _users = new Dictionary <IMessenger, User>();

            scsServer = new ScsService.Server.ScsService(ScsServiseTest.current.ServerPort);
            //scsServer.MsgReaders.RegisterMsgReader<TestMessage>(OnTestMessage);

            scsServer.OnUserLogin        += ScsServer_OnUserLogin;
            scsServer.OnUserDisconnected += ScsServer_OnUserDisconnected;

            scsServer.Start();
        }