SendMessage packet (PacketLib168)

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

SendMessage packet (PacketLib168)

Postby stephenxpimentel » Sat Sep 25, 2010 3:20 am

Heya, there seems to be a problem when using

Code: Select all
 SendMessage(string message, eChatType.CT_ScreenCenter_And_CT_System, eChatLoc.CL_ChatWindow);



i see in this code that there is checks for certain types of messages, do we need to add another one, or does the existing one mess it up?

it adds "@@" at the beginning of the message.


Code: Select all
public virtual void SendMessage(string msg, eChatType type, eChatLoc loc)
      {
         if (m_gameClient.ClientState == GameClient.eClientState.CharScreen)
            return;

         // types not supported by 1.68+ clients
         switch (type)
         {
            case eChatType.CT_ScreenCenterSmaller:
            case eChatType.CT_ScreenCenter:
               return;
         }

         using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Message)))
         {
            pak.WriteShort((ushort) m_gameClient.SessionID);
            pak.WriteShort(0x00);
            pak.WriteByte((byte) type);
            pak.Fill(0x0, 3);

            String str;
            if (loc == eChatLoc.CL_ChatWindow)
               str = "@@";
            else if (loc == eChatLoc.CL_PopupWindow)
               str = "##";
            else
               str = "";

            str = String.Concat(str, msg);
            pak.WriteString(str);
            SendTCP(pak);
         }
      }



notice this here.

Code: Select all
String str;
            if (loc == eChatLoc.CL_ChatWindow)
               str = "@@";
            else if (loc == eChatLoc.CL_PopupWindow)
               str = "##";
            else
               str = "";



now i see that it does a String.Concat, i'm not sure what that does, i will google it tomorrow. lol, any feedback would be nice as to a solution for this :)
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: SendMessage packet (PacketLib168)

Postby Dunnerholl » Sat Sep 25, 2010 5:59 am

its all correct, @@ and ## are the old old old channel directors, which are still used by daoc
Dunnerholl
Developer
 
Posts: 1229
Joined: Mon Sep 08, 2008 8:39 pm

Re: SendMessage packet (PacketLib168)

Postby Dinberg » Sat Sep 25, 2010 9:21 am

its because of the chat destination iirc, which afaik can only be system for that particlar type
The Marvelous Contraption begins to stir...
User avatar
Dinberg
Inactive Staff Member
 
Posts: 4695
Joined: Sat Mar 10, 2007 9:47 am
Yahoo Messenger: dinberg_darktouch
Location: Jordheim

Re: SendMessage packet (PacketLib168)

Postby stephenxpimentel » Sat Sep 25, 2010 2:26 pm

awesome. :) i just change it to CL_System, thanks.
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest