예제 #1
0
        public void Setup()
        {
            byte[,] map =
            {
                { 1, 1, 1, 3, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 3, 1, 1, 1 }
            };
            freePort = GetFreePortHelper.NextFreePort(4649);
            var basicServer = BasicServer.CreateInstance(freePort);

            basicServer.RunAsynch(new ByteArrayMapLoader(map));
            Thread.Sleep(2000);
        }
        public void Setup()
        {
            byte[,] map =
            {
                { 1, 1, 1, 3, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 3, 1, 1, 1 }
            };
            freePort = GetFreePortHelper.NextFreePort(4649);
            var basicServer = BasicServer.CreateInstance(freePort);

            basicServer.RunAsynch(new ByteArrayMapLoader(map));
            Thread.Sleep(2000);
            _client = new OHSWebSocketClient("localhost", freePort);
            _client.Connect();
            _client.WaitForConnectionId();
            _client.PlayerLogin("TestName");
            playerId = _client.PlayerInfo.Id;
        }