Exemplo n.º 1
0
        public static void RequestTie(Character chr, MiniRoomBase mrb)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x18);
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 2
0
        public static void RemovePlayer(Character pCharacter, MiniRoomBase mrb)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(10);
            pw.WriteByte(pCharacter.RoomSlotId);
            mrb.BroadcastPacket(pw, pCharacter);
        }
Exemplo n.º 3
0
        public static void Skip(MiniRoomBase mrb, byte pWho)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x25);
            pw.WriteByte(pWho);
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 4
0
        public static void RequestTieResult(Character chr, MiniRoomBase mrb)
        {
            //Your opononent denied your request for a tie
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x19);
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 5
0
        public static void ShowLeaveRoom(MiniRoomBase pRoom, Character pWho, byte pReason)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0xA);
            pw.WriteByte(pWho.RoomSlotId);
            pw.WriteByte(pReason);
            pRoom.BroadcastPacket(pw);
        }
Exemplo n.º 6
0
        public static void Start(Character chr, MiniRoomBase mrb)
        {
            //Timer is (null) then client stops responding ;-;
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x23);
            pw.WriteByte(mrb.mWinnerIndex); //0 Would let slot 1, 1 would let slot 0
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 7
0
        public static void RemoveOmokPieceTest(MiniRoomBase mrb, int X, int Y, byte Piece)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x26);
            pw.WriteInt(X);
            pw.WriteInt(Y);
            pw.WriteSByte(-1);
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 8
0
        public static void ShowJoin(MiniRoomBase pRoom, Character pWho)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(4);
            pw.WriteByte(pWho.RoomSlotId);
            PacketHelper.AddAvatar(pw, pWho);
            pw.WriteString(pWho.Name);
            pRoom.EncodeEnterResult(pWho, pw);
            pRoom.BroadcastPacket(pw, pWho);
        }
Exemplo n.º 9
0
        public static void MoveOmokPiece(Character chr, MiniRoomBase mrb, int X, int Y, byte Piece)
        {
            //decodebuffer (8 bytes.. obviously 2 ints)
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x26); //?
            pw.WriteInt(X);
            pw.WriteInt(Y);
            //Type
            pw.WriteByte(Piece); //Works as piece too
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 10
0
        public static void RequestHandicapResult(Character chr, MiniRoomBase mrb, bool Accepted, byte CountBack)
        {
            //Your opponent denied your request for a handicap
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x1D);
            pw.WriteBool(Accepted); //deny or not ?
            pw.WriteByte(CountBack);
            if (chr.RoomSlotId == 0)
            {
                pw.WriteByte(1);
            }
            else
            {
                pw.WriteByte(0);
            }
            mrb.BroadcastPacket(pw);
        }
Exemplo n.º 11
0
        public static void AddVisitor(Character chr, MiniRoomBase mrb)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(4);
            pw.WriteByte(chr.RoomSlotId);
            PacketHelper.AddAvatar(pw, chr);
            pw.WriteString(chr.Name);

            //GW_Minigamerecord_Decode
            pw.WriteInt(1);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            //pw.WriteInt(0);
            pw.WriteInt(chr.GameStats.OmokWins);
            pw.WriteInt(chr.GameStats.OmokTies);
            pw.WriteInt(chr.GameStats.OmokLosses);
            pw.WriteInt(2000);
            mrb.BroadcastPacket(pw, chr);
        }
Exemplo n.º 12
0
        public static void Chat(MiniRoomBase pRoom, Character pCharacter, string pText, sbyte pMessageCode)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(6);

            if (pMessageCode < 0)
            {
                pw.WriteByte(8);
                pw.WriteByte(pCharacter.RoomSlotId);
                pw.WriteString($"{pCharacter.Name} : {pText}");
            }
            else
            {
                pw.WriteByte(7);
                pw.WriteSByte(pMessageCode);
                pw.WriteString(pCharacter.Name);
            }

            pRoom.BroadcastPacket(pw);
        }
Exemplo n.º 13
0
        public static void UpdateGame(Character pWinner, MiniRoomBase mrb, byte Type)
        {
            Packet pw = new Packet(ServerMessages.MINI_ROOM_BASE);

            pw.WriteByte(0x24);

            switch (Type)
            {
            case 0: pw.WriteByte(0); break;

            case 1: pw.WriteByte(1); break;

            case 2: pw.WriteByte(2); break;
            }
            pw.WriteByte(pWinner.RoomSlotId);

            //gamestats
            pw.WriteInt(1);
            //pw.WriteInt(1337);
            //pw.WriteInt(1337);
            //pw.WriteInt(1337);
            pw.WriteInt(mrb.Users[0].GameStats.OmokWins);
            pw.WriteInt(mrb.Users[0].GameStats.OmokTies);
            pw.WriteInt(mrb.Users[0].GameStats.OmokLosses);
            pw.WriteInt(1);

            pw.WriteInt(1);
            //pw.WriteInt(1337);
            //pw.WriteInt(1337);
            //pw.WriteInt(1337);
            pw.WriteInt(mrb.Users[1].GameStats.OmokWins);
            pw.WriteInt(mrb.Users[1].GameStats.OmokTies);
            pw.WriteInt(mrb.Users[1].GameStats.OmokLosses);
            pw.WriteInt(1);

            pw.WriteLong(0);
            mrb.BroadcastPacket(pw);
        }