Example #1
0
        public static void ResponseChat(List<Client> clients, Muid channelId, string charName, string message, UGradeId access)
        {
            using (var packet = new PacketWriter(Operation.ChannelChat, CryptFlags.Encrypt))
            {
                packet.Write(channelId);
                packet.Write(charName);
                packet.Write(message);
                packet.Write((Int32)access);

                clients.ForEach(c => c.Send(packet));
            }
        }
Example #2
0
        public static void ResponseLogin(Client client, Results results,  string user, UGradeId ugrade, PGradeId pgrade, Muid playerId)
        {
            using (var packetWriter = new PacketWriter(Operation.MatchLoginResponse, CryptFlags.Encrypt))
            {
                packetWriter.Write((Int32)results);
                packetWriter.Write(Globals.Config.Server.Name);

                switch (Globals.Config.Server.Mode.ToLower())
                {
                    case "match":
                        packetWriter.Write((byte)0);
                        break;

                    case "clan":
                        packetWriter.Write((byte)1);
                        break;

                    case "quest":
                        packetWriter.Write((byte)4);
                        break;;

                    case "test":
                        packetWriter.Write((byte)4);
                        break;

                    case "develop":
                        packetWriter.Write((byte)3);
                        break;
                    default:
                        packetWriter.Write((byte)1);
                        break;
                }

                packetWriter.Write(user);
                packetWriter.Write((byte)ugrade);
                packetWriter.Write((byte)pgrade);
                packetWriter.Write(playerId);
                packetWriter.Write(Globals.Config.Server.Survival);
                packetWriter.Write(Globals.Config.Server.DuelTourney);
                packetWriter.Write(1, 20);
                packetWriter.WriteSkip(20);

                client.Send(packetWriter);
            }
        }