[patch] Fix PM System of tRO to work properly

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

UltimaWeapon
Human
Human
Posts: 37
Joined: 04 Apr 2008, 22:55
Noob?: Yes
Location: Thailand

[patch] Fix PM System of tRO to work properly

#1 Post by UltimaWeapon »

tRO PM packets has been changed. This is structure of new packets.

Code: Select all

<msg id>.W <msg len>.W <name>.24B <unknown>.L <message>.?B
This is old structure.

Code: Select all

<msg id>.W <msg len>.W <name>.24B <message>.?B
I have no idea what is <unknown>. I guess it is sender account id but Gravity not yet implement it.

Please commit it. Thank you. :mrgreen:

Code: Select all

Index: src/Network/Receive/ServerType21.pm
===================================================================
--- src/Network/Receive/ServerType21.pm	(revision 6995)
+++ src/Network/Receive/ServerType21.pm	(working copy)
@@ -14,25 +14,19 @@
 package Network::Receive::ServerType21;
 
 use strict;
-use Network::Receive::ServerType0 ();
 use base qw(Network::Receive::ServerType0);
-use Log qw(message warning error debug);
-use Translation;
-use Globals;
-use I18N qw(bytesToString);
-use Utils qw(getHex swrite makeIP makeCoords);
 
 sub new {
-	my ($class) = @_;
-	my $self = $class->SUPER::new();
+	my $class = shift;
+	my $self = $class->SUPER::new(@_);
 
 	$self->{packet_list}{'0069'} = ['account_server_info', 'x2 a4 a4 a4 x30 C1 x4 a*', [qw(sessionID accountID sessionID2 accountSex serverInfo)]];
 	$self->{packet_list}{'0078'} = ['actor_display', 'x a4 v14 a4 a2 v2 C2 a3 C3 v', [qw(ID walk_speed opt1 opt2 option type hair_style weapon lowhead shield tophead midhead hair_color clothes_color head_dir guildID emblemID manner opt3 karma sex coords unknown1 unknown2 act lv)]]; #standing
 	$self->{packet_list}{'007C'} = ['actor_display', 'x a4 v14 C2 a3 C2', [qw(ID walk_speed opt1 opt2 option hair_style weapon lowhead type shield tophead midhead hair_color clothes_color head_dir karma sex coords unknown1 unknown2)]]; #spawning
+	$self->{packet_list}{'0097'} = ['private_message', 'v Z24 x4 Z*', [qw(len privMsgUser privMsg)]];
 	$self->{packet_list}{'022C'} = ['actor_display', 'x a4 v3 V v5 V v5 a4 a2 v V C2 a5 x C2 v', [qw(ID walk_speed opt1 opt2 option type hair_style weapon shield lowhead tick tophead midhead hair_color clothes_color head_dir guildID emblemID manner opt3 karma sex coords unknown1 unknown2 lv)]]; # walking
 
-
 	return $self;
 }
 
-1;
\ No newline at end of file
+return 1;
You do not have the required permissions to view the files attached to this post.
I may make you misunderstand. Because my English isn't good enough. So Sorry.
Image
Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: [patch] Fix PM System of tRO to work properly

#2 Post by Technology »

thanks UltimaWeapon, it has been comitted.
One ST0 to rule them all? One PE viewer to find them!
One ST_kRO to bring them all and in the darkness bind them...

Mount Doom awaits us, fellowship of OpenKore!