Invalid Password/Banned/Character Name Already Exists/Registered Messages?

05/18/2010 03:50 scottdavey#1
Anybody know how I can send these messages?

I kind of fail with the whole packets thing but if someone explained it would be grand.

5017 <-
05/18/2010 04:02 Arcо#2
Which 5017?
Lotf or hybrid's?
05/18/2010 04:05 scottdavey#3
Quote:
Originally Posted by .Arco View Post
Which 5017?
Lotf or hybrid's?
Lotf.
05/18/2010 04:14 LetterX#4
Isn't it the chat packet? o.o
05/18/2010 04:17 Arcо#5
Downloading a lotf right now, I'll take a look into it.
05/18/2010 05:47 Sion~#6
Quote:
Originally Posted by LetterX View Post
Isn't it the chat packet? o.o
Imi is right it is. Basically you use the chat packet along with your database functions.. You check if the account attempting to log in has the same credentials as in the database if it doesn't exist you send the NEW_ROLE in the LoginInformation (0x835) chat type ect.

Quote:
Originally Posted by .Arco View Post
Downloading a lotf right now, I'll take a look into it.
There's no need to download the source its only a packet. :facepalm:
05/18/2010 06:11 scottdavey#7
Quote:
Originally Posted by Sion~ View Post
Imi is right it is. Basically you use the chat packet along with your database functions.. You check if the account attempting to log in has the same credentials as in the database if it doesn't exist you send the NEW_ROLE in the LoginInformation (0x835) chat type ect.



There's no need to download the source its only a packet. :facepalm:
Can you give me an example?

I'm pretty novice..
05/18/2010 07:09 Sion~#8
Well create the packet structure using this [Only registered and activated users can see links. Click Here To Register...].

When you receive the new connection you'll wanna check if the account exist and if it doesn't you send the NEW_ROLE sorta like this:

Code:
if (!getChar.Exists)
                    {
                        Client.Transmit(Packets.Chat.Packet(
                            Enums.ChatType.LoginInformation,
                            "SYSTEM", "ALLUSERS", "NEW_ROLE"),
                            SendType.Game);
                        Xio.PrintInfo("[Xio] New Character from " + Client.Account);
                        return;
                    }
Code:
public GetCharacter(ClientEntity _Client)
        {
            Client = _Client;
            MysqlCommand cmd = new MysqlCommand(CommandType.SELECT);
            cmd.Select("*", "Characters").Where("UID", Client.Identifier);
            cmd.Done();

            bool _exists = false;
            while (cmd.DataReader.Read())
            {
                _exists = true;
                Client.Character.Name = Convert.ToString(cmd.Read("Name"));
                Client.Character.SpouseName = Convert.ToString(cmd.Read("Spouse"));
                Client.Character.Model = (Enums.ModelId)Convert.ToUInt32(cmd.Read("Model"));
                Client.Character.Hair = Convert.ToUInt16(cmd.Read("Hair"));
                Client.Character.Gold = Convert.ToUInt32(cmd.Read("Gold"));
                Client.Character.CP = Convert.ToUInt32(cmd.Read("CP"));
                Client.Character.WarehouseGold = Convert.ToUInt32(cmd.Read("WarehouseGold"));
                Client.Character.Experience = Convert.ToUInt32(cmd.Read("Experience"));
                Client.Character.Strength = Convert.ToUInt16(cmd.Read("Strength"));
                Client.Character.Dexterity = Convert.ToUInt16(cmd.Read("Dexterity"));
                Client.Character.Vitality = Convert.ToUInt16(cmd.Read("Vitality"));
                Client.Character.Spirit = Convert.ToUInt16(cmd.Read("Spirit"));
                Client.Character.StatPoints = Convert.ToUInt16(cmd.Read("StatPoints"));
                Client.Character.HP = Convert.ToUInt16(cmd.Read("HP"));
                Client.Character.MP = Convert.ToUInt16(cmd.Read("MP"));
                Client.Character.PKPoints = Convert.ToUInt16(cmd.Read("PKPoints"));
                Client.Character.Level = Convert.ToByte(cmd.Read("Level"));
                Client.Character.Class = Convert.ToByte(cmd.Read("Class"));
                Client.Character.Reborn = Convert.ToByte(cmd.Read("Reborn"));
                Client.Character.QuizPoints = Convert.ToUInt32(cmd.Read("QuizPoints"));
                Client.Character.Virtue = Convert.ToUInt32(cmd.Read("Virtue"));
                Client.Character.Map = Convert.ToUInt16(cmd.Read("Map"));
                Client.Character.X = Convert.ToUInt16(cmd.Read("X"));
                Client.Character.Y = Convert.ToUInt16(cmd.Read("Y"));
            }
            Exists = _exists;
            cmd.End();
        }
P.S - Here are the chat types:

Code:
public enum ChatType : uint
    {
        Talk = 0x7d0,
        Whisper = 0x7d1,
        Action = 0x7d2,
        Team = 0x7d3,
        Guild = 0x7d4,
        Top = 0x7d5,
        Spouse = 0x7d6,
        Yell = 0x7d8,
        Friend = 0x7d9,
        Broadcast = 0x7da,
        Center = 0x7db,
        Ghost = 0x7dd,
        Service = 0x7de,
        Dialog = 0x834,
        LoginInformation = 0x835,
        VendorHawk = 0x838,
        Website = 0x839,
        MiniMap = 0x83c,
        MiniMap2 = 0x83d,
        FriendsOfflineMessage = 0x83e,
        GuildBulletin = 0x83f,
        TradeBoard = 0x899,
        FriendBoard = 0x89a,
        TeamBoard = 0x89b,
        GuildBoard = 0x89c,
        OthersBoard = 0x89d
    }
05/18/2010 07:29 scottdavey#9
[Only registered and activated users can see links. Click Here To Register...] (DC was me closing server, not the packet.)

Code:
MyChar.MyClient.SendPacket(General.MyPackets.SendMsg2((long)World.ChatType.LoginInformation, "SYSTEM", "ALLUSERS", "NEW_ROLE", true));
When I test it in a command, the link you sent is for 4267.

I'm 5017, is that the problem?
05/18/2010 07:36 Sion~#10
Quote:
Originally Posted by scottdavey View Post
[Only registered and activated users can see links. Click Here To Register...] (DC was me closing server, not the packet.)

Code:
MyChar.MyClient.SendPacket(General.MyPackets.SendMsg2((long)World.ChatType.LoginInformation, "SYSTEM", "ALLUSERS", "NEW_ROLE", true));
When I test it in a command, the link you sent is for 4267.

I'm 5017, is that the problem?
The link I sent you has a layout for the 5017 chat packet as well.

The problem is simple... You're not sending the packet at the correct time (If the dc was you closing the server).. I PM'ed you my info, add me and I'll help you out.

EDIT# I just noticed something..

Code:
[COLOR="Red"]MyChar.MyClient.[/COLOR]SendPacket(General.MyPackets.SendMsg2((long)World.ChatType.LoginInformation, "SYSTEM", "ALLUSERS", "NEW_ROLE", true));
The packet is supposed to be sent from the server to the client.
05/18/2010 08:21 scottdavey#11
This is hard to implement in LOTF because the source is fail, if anyone has any solutions please post.
05/18/2010 08:36 kinshi88#12
Use a different source...? lol
05/18/2010 08:39 Arcо#13
Solution:Hybrids
05/18/2010 08:57 scottdavey#14
Lol, I've been using this source for a while and did a lot of stuff.

Don't wanna move on just yet.
05/18/2010 10:52 ~Yuki~#15
Get me @ msn ill do it for u :D