Exemplo n.º 1
0
        public void ServerRoomManageReady()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();

            Assert.That(t.rooms[0].ManageReady(dataLenght), Is.EqualTo(false));
        }
Exemplo n.º 2
0
        public void ServerJoinRoom()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();

            Assert.That(t.JoinRoom(0, 0), Is.EqualTo(true));
        }
Exemplo n.º 3
0
        public void ServerRoomManageRoomEnter()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].ManageEnterRoom(dataLenght);

            Assert.That(t.data[(int)PacketOffset.ANSWER], Is.EqualTo((int)PacketType.REQUEST));
        }
Exemplo n.º 4
0
        public void ServerRoomReceiveRequest()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.data[(int)PacketOffset.ANSWER] = (byte)PacketType.REQUEST;

            Assert.That(t.rooms[0].Receive(dataLenght, 0), Is.EqualTo((int)PacketType.REQUEST));
        }
Exemplo n.º 5
0
        public void ServerRoomAdd()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);

            Assert.That(t.rooms[0].membersCount, Is.EqualTo(1));
        }
Exemplo n.º 6
0
        public void ServerRoomControlStartMatch()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);

            Assert.That(t.rooms[0].ControlStartMatch(0), Is.EqualTo(false));
        }
Exemplo n.º 7
0
        public void ServerRoomManageReadySetMember()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);

            Assert.That(t.rooms[0].ManageCharacterSelection(dataLenght), Is.EqualTo(true));
        }
Exemplo n.º 8
0
        public void ServerRoomSendReliableAll()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].SendAllReliable(new byte[dataLenght], dataLenght, (int)Command.ENTERROOM);

            Assert.That(t.rooms[0].reliablePackets.Count, Is.EqualTo(t.rooms[0].membersCount));
        }
Exemplo n.º 9
0
        public void ServerRoomManageReady()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.data = new byte[t.minPacketSize];

            Assert.That(t.rooms[0].ManageCharacterSelection(dataLenght), Is.EqualTo(false));
        }
Exemplo n.º 10
0
        public void ServerRoomSendReliable()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].SendReliable(end, new byte[dataLenght], dataLenght);

            Assert.That(t.rooms[0].reliablePackets.Count, Is.EqualTo(1));
        }
Exemplo n.º 11
0
        public void ServerRoomReceive()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.data[(int)PacketOffset.ANSWER] = 3;

            Assert.That(t.rooms[0].Receive(dataLenght, 0), Is.EqualTo(-1));
        }
Exemplo n.º 12
0
        public void ServerRoomContains()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);

            Assert.That(t.rooms[0].Contains(end), Is.EqualTo(true));
        }
Exemplo n.º 13
0
        public void ServerRoomGetMemberEndPoint()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);

            Assert.That(t.rooms[0].GetMemberEndPoint(0), Is.EqualTo(end));
        }
Exemplo n.º 14
0
        public void ServerRoomStartMatchOffset()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.data[(int)PacketOffset.ANSWER] = (byte)PacketType.ANSWER;
            t.rooms[0].StartMatch(dataLenght);

            Assert.That(t.data[(int)PacketOffset.ANSWER], Is.EqualTo((int)PacketType.REQUEST));
        }
Exemplo n.º 15
0
        public void ServerRoomManageTransform()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);
            t.rooms[0].ManageTransform(0);

            Assert.That(t.rooms[0].reliablePackets.Count, Is.EqualTo(t.rooms[0].membersCount - 1));
        }
Exemplo n.º 16
0
        public void ServerRoomControlStartMatchAllReady()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);
            t.rooms[0].members[0].CurrentState = State.READY;

            Assert.That(t.rooms[0].ControlStartMatch(0), Is.EqualTo(true));
        }
Exemplo n.º 17
0
        public void ServerRoomManageReadySetMemberReady()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.rooms[0].Add(end);
            t.rooms[0].members[0].CurrentState = State.READY;

            Assert.That(t.rooms[0].ManageCharacterSelection(dataLenght), Is.EqualTo(false));
        }
Exemplo n.º 18
0
        public void ServerRoomTransformOffset()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            t.data[(int)PacketOffset.ANSWER] = (byte)PacketType.REQUEST;
            t.rooms[0].ManageTransform(dataLenght);

            Assert.That(t.data[(int)PacketOffset.ANSWER], Is.EqualTo((int)PacketType.ANSWER));
        }
Exemplo n.º 19
0
        public void ServerRoomManageAnswer()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();
            Room.ReliablePacket p = new Room.ReliablePacket();
            p.command = (int)Command.CHARACTERSELECTION;
            p.end     = t.CurrentEndPoint;
            t.rooms[0].reliablePackets.Add(p);
            t.rooms[0].ManageAnswer((int)Command.CHARACTERSELECTION);

            Assert.That(t.rooms[0].reliablePackets.Count, Is.EqualTo(0));
        }