message window packet

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

message window packet

Postby wtfux on Sun May 18, 2008 12:17 am

I can't find the function which handles the private message packets (the private chat with a guy on your friend list, not whisper).

Can someone pls help me?
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Re: message window packet

Postby Seotern on Sun May 18, 2008 10:10 am

That part of the protocol is handled through the character server, not the world server.
Image
User avatar
Seotern
Smoulie
Smoulie
 
Posts: 37
Joined: Thu Jan 17, 2008 9:01 pm

Re: message window packet

Postby wtfux on Sun May 18, 2008 4:36 pm

Ah ok I found it.
  1. BEGINPACKET( pak, 0x7e2 );  
  2. ADDWORD    ( pak, thisclient->charid );
  3. for (int i=2;i<(P->Size-6);i++)
  4. ADDBYTE    ( pak, GETBYTE((*P),i ));
  5. otherclient->SendPacket(&pak);


How can I send a specific text?
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Re: message window packet

Postby Sethanye on Sun May 18, 2008 5:15 pm

just insert a string to send before the actual text, same as in [broadcast] or whatever before /b send
~ Learning Flash ~ Anyone Know Any Good Tutorial DVDs? ~
Image
"Come Into My Dream, Let Me Show You Where I've Been.
Its You And Me I've Seen, Let Me Tell You What I Mean."
User avatar
Sethanye
Neko Chan
Neko Chan
 
Posts: 2603
Joined: Fri Jan 18, 2008 11:23 am
Location: ~ Resident Graphics Artist ~

Re: message window packet

Postby wtfux on Sun May 18, 2008 6:23 pm

  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDWORD    ( pak, 1 ); // 1 = id of my bot, auto added to all players
  3. //What do I have to put here to send the chat string "msg"? I need to send packets before string, but which?
  4.     thisclient->SendPacket(&pak);


Can you help me :(? look comments.
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Re: message window packet

Postby Drakia on Sun May 18, 2008 6:55 pm

If you're just trying to send a message, I think you can do something like
  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDWORD    ( pak, 1 ); // 1 = id of my bot, auto added to all players
  3.     ADDSTRING  ( pak, "This is a message" ); // Change to change message.
  4.     thisclient->SendPacket(&pak);
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: message window packet

Postby Drakia on Sun May 18, 2008 9:42 pm

I haven't managed to get a screen to pop up, but I have figured out the Mail packet for the most part (So that a message gets shown under "Community->Mail". It seems that if a user is offline the client sends packet 0x7e5 to the server when you try to send them a message. I'll post the packet in the Submit Code section for that, and I'll keep working on getting a popup message working.

Ok, weird, most of the server has that packets layout wrong. The first entry is a DWORD not a WORD. This will only work if the person that it is coming from is on the persons friend list who you are sending it to though. Otherwise the client has nowhere to get a name from so it just fails to show the message.

  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDDWORD    ( pak, 1 ); // 1 = id of my bot, auto added to all players
  3.     ADDSTRING  ( pak, "This is a message" ); // Change to change message.
  4.     thisclient->SendPacket(&pak);
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: message window packet

Postby wtfux on Mon May 19, 2008 5:24 am

That does not work.
I figured it out yesterday:

  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDWORD    ( pak, 1 ); (Or ADDDWORD; dunno, could not test dword so far)
  3.     ADDBYTE    ( pak, 00 ); //Dunno if 00 is right here, anyway client accepts it.
  4.     ADDBYTE    ( pak, 00 ); //Again 00, got it out by loggin packets
  5.      ADDSTRING  ( pak, "This is a message" ); // Change to change message.
  6.      ADDBYTE    ( pak, 00 ); //And in the end again
  7.     thisclient->SendPacket(&pak);


This is the log:
1 //ID
00
00
Hex of your text
00
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Re: message window packet

Postby Drakia on Mon May 19, 2008 5:36 am

Oh right, I forgot the last 0 after the string. But that addword/addbyte/addbyte is actually an adddword (DWORD = 4 bytes, WORD = 2, BYTE = 1. Hence a WORD + 2BYTES = DWORD).
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: message window packet

Postby wtfux on Mon May 19, 2008 2:43 pm

What do you mean?
This is not working:

  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDDWORD    ( pak, 1 ); (Or ADDDWORD; dunno, could not test dword so far)
  3.     ADDDWORD    ( pak, 00 ); //Dunno if 00 is right here, anyway client accepts it.
  4.     ADDDWORD    ( pak, 00 ); //Again 00, got it out by loggin packets
  5.      ADDSTRING  ( pak, "This is a message" ); // Change to change message.
  6.      ADDDWORD    ( pak, 00 ); //And in the end again
  7.     thisclient->SendPacket(&pak);


When I replace 00 with 0 it does not work neither.
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Next

Return to Support - OspRose Emulator

Who is online

Users browsing this forum: No registered users and 7 guests

cron