コード例 #1
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        public void ServerRoomManageReady()
        {
            MvsAServer t = new MvsAServer(socket, end, dataLenght, 4, 3);

            t.CreateRoom();

            Assert.That(t.rooms[0].ManageReady(dataLenght), Is.EqualTo(false));
        }
コード例 #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));
        }
コード例 #3
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #10
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #14
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #18
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        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));
        }
コード例 #19
0
ファイル: Class1.cs プロジェクト: M-Isonni/Server
        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));
        }