[Help] Save Chat In SQL!

01/03/2018 18:16 HatersDAD#1
hello awesome community,
first: thanks for kingdollar and all ppls for solve my last topic help.
second: i want to make log from filter (AllChat,PrivateChat,GlobalChat,GuildChat) .
what is packet? and how i can save this chats into my sql db.
thanks a lot.
01/03/2018 18:55 chipno0p#2
I think u can use a Game Server which has chat log function. As I remembered, there is a Game Server has this function.
01/03/2018 20:40 HatersDAD#3
Quote:
Originally Posted by chipno0p View Post
I think u can use a Game Server which has chat log function. As I remembered, there is a Game Server has this function.
yes iknow,
but i want to make this function in my filter. thanks for reply.
01/04/2018 18:34 KingDollar#4
you can handle client chat packet

this enum would help you for chatType
Code:
public enum ChatType : byte
{
    All = 1,
    PM = 2,
    AllGM = 3,
    Party = 4,
    Guild = 5,
    Global = 6,
    Notice = 7,
    Stall = 9,
    Union = 11,
    NPC = 13,
    Accademy = 16,
}
and here is packet structure

Code:
byte msgTypeId = pck.ReadUInt8();
byte msgCount = pck.ReadUInt8();
ChatType msgType = (ChatType)(msgTypeId);
string msg = string.Empty;
switch (msgType)
{
    case ChatType.All:
	case ChatType.AllGM:
	case ChatType.Party:
	case ChatType.Guild:
	case ChatType.Accademy:
	case ChatType.Union:
	case ChatType.Stall:
            msg = pck.ReadAscii();
        break;

    case ChatType.PM:
        {
            string name = pck.ReadAscii();
            msg = pck.ReadAscii();
        }
        break;
}
01/05/2018 05:06 #HB#5
KingDollar is the second Goofie baby :D
01/05/2018 09:10 HatersDAD#6
Quote:
Originally Posted by KingDollar View Post
you can handle client chat packet

this enum would help you for chatType
Code:
public enum ChatType : byte
{
    All = 1,
    PM = 2,
    AllGM = 3,
    Party = 4,
    Guild = 5,
    Global = 6,
    Notice = 7,
    Stall = 9,
    Union = 11,
    NPC = 13,
    Accademy = 16,
}
and here is packet structure

Code:
byte msgTypeId = pck.ReadUInt8();
byte msgCount = pck.ReadUInt8();
ChatType msgType = (ChatType)(msgTypeId);
string msg = string.Empty;
switch (msgType)
{
    case ChatType.All:
	case ChatType.AllGM:
	case ChatType.Party:
	case ChatType.Guild:
	case ChatType.Accademy:
	case ChatType.Union:
	case ChatType.Stall:
            msg = pck.ReadAscii();
        break;

    case ChatType.PM:
        {
            string name = pck.ReadAscii();
            msg = pck.ReadAscii();
        }
        break;
}
thanks again .

Quote:
Originally Posted by #HB View Post
KingDollar is the second Goofie baby :D
hhahahaha, right [King] <3