message window packet

Welcome in the osRose emulator Project.

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

Re: message window packet

Postby Drakia on Mon May 19, 2008 6:34 pm

It's just one adddword
  1.    BEGINPACKET( pak, 0x7e2 );  
  2.     ADDDWORD    ( pak, 1 ); // This is the ID
  3.      ADDSTRING  ( pak, "This is a message" ); // This is the message
  4.      ADDBYTE    ( pak, 00 ); //This is a null terminator
  5.     thisclient->SendPacket(&pak);


That last one should be a byte, though a dword would work fine there as well I think.
Last edited by Drakia on Mon May 19, 2008 7:16 pm, edited 1 time in total.
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 6:45 pm

Ahh. Thx I'll try it.
Sry, I'm new to packets :p.
No.sig
wtfux
Pomic
Pomic
 
Posts: 130
Joined: Sun Apr 13, 2008 2:35 pm

Re: message window packet

Postby wtfux on Mon May 19, 2008 7:29 pm

Can you tell me, how to filter out a message, too?
(Packet come in -> save text as string)
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 7:33 pm

  1. string msg = (char*)&P->buffer[4];


I'm not positive on that 4, but it should be 4 (Start from the 5th byte, and it will go until the next null byte)
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 7:39 pm

Drakia wrote:I'm not positive on that 4, but it should be 4 (Start from the 5th byte, and it will go until the next null byte)

Seems to work.
It doesn't matter how long the user's id is, does it?
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 7:44 pm

Userid is stored as a DWORD, which is always only 4 bytes long, and can hold 65535 unique ID's
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 Maxxon on Tue May 20, 2008 11:22 am

what is it now? a WORD with 65k IDs or a DWORD with 4bil?
Image
an anymous comment on a program called reloader:
what if a fatal error happens, will it restart it?
User avatar
Maxxon
Hawker's pet
Hawker's pet
 
Posts: 1305
Joined: Sat Nov 10, 2007 12:42 pm

Re: message window packet

Postby Drakia on Tue May 20, 2008 6:00 pm

It's a DWORD, the bigger one, lol.
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 lmame on Tue May 20, 2008 9:12 pm

I want a QWORD :D
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Previous

Return to Support - OspRose Emulator

Who is online

Users browsing this forum: No registered users and 7 guests

cron