r6694 | a little Problem from idRO schat become unreadable

This place is for Closed bug reports only. NOT for asking help!

Moderators: Moderators, Developers

h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

r6694 | a little Problem from idRO schat become unreadable

#1 Post by h4rry84 »

From last week since maintenance "fix", idRO(sType 21) changed the way ppl using Megaphone item. now it prefixed with miccname and FFFF00(Yellow colour hex) and continued with the old schat. but the micc isn't showed ingame but readable thru packet recorder / openkore, and the FFFF00 i think to force the colour to become Yellow as it exploitable before .

openkore can't read the message and only type miccname
like this :
[GM] miccNewBlood
been capture the example packet using wpe :

Code: Select all

9A 00 72 00 6D 69 63 63 7E 4D 6F 73 68 69 2D 6D 6F 73 68 69 7E 00 40 6B 65 72 24 3C 7E 00 00 00 46 46 46 46 30 30 7E 4D 6F 73 68 69 2D 6D 6F 73 68 69 7E 20 42 65 72 6B 61 74 61 20 3A 20 4A 3E 2B 36 20 4F 72 63 20 48 65 6C 6D 20 6E 20 2B 36 20 6D 61 6E 74 65 61 75 20 4C 50 20 63 6F 63 6F 6B 20 64 69 20 62 6C 7A 7A 7A 3C 3C 3C 62 61 63 61 00 
it would type this

Code: Select all

..r.micc~Moshi-moshi~.@ker$<~...FFFF00~Moshi-moshi~ Berkata : J>+6 Orc Helm n +6 manteau LP cocok di blzzz<<<baca
in Game showed like this

Code: Select all

~Moshi-moshi~ Berkata : J>+6 Orc Helm n +6 manteau LP cocok di blzzz<<<baca.

Code: Select all

9A 00 79 00 6D 69 63 63 4B 6F 71 2D 47 74 75 00 6F 78 00 70 41 4C 40 6B 65 72 24 3C 7E 00 00 00 46 46 46 46 30 30 4B 6F 71 2D 47 74 75 20 42 65 72 6B 61 74 61 20 3A 20 4A 3E 4A 61 73 61 20 62 6F 74 20 33 35 6B 2F 62 6C 6E 20 32 34 6A 41 4D 2C 42 3E 56 6F 63 20 36 35 6B 5B 36 30 6A 74 5D 2C 31 37 35 6B 5B 31 32 30 6A 74 5D 20 6B 6F 64 65 20 31 73 74 20 57 4D 00 
it would type this

Code: Select all

..y.miccKoq-Gtu.ox.pAL@ker$<~...FFFF00Koq-Gtu Berkata : J>Jasa bot 35k/bln 24jAM,B>Voc 65k[60jt],175k[120jt] kode 1st WM.
in Game showed like this

Code: Select all

Koq-Gtu Berkata : J>Jasa bot 35k/bln 24jAM,B>Voc 65k[60jt],175k[120jt] kode 1st WM
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: r6694 | a little Problem from idRO schat become unreadable

#2 Post by kali »

What's the s21 schat handler in the code?
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: r6694 | a little Problem from idRO schat become unreadable

#3 Post by h4rry84 »

it's using the handler from receive.pm

Code: Select all

'009A' => ['system_chat', 'x2 Z*', [qw(message)]], #maybe use a* instead and $message =~ /\000$//; if there are problems
ToXCiL
Noob
Noob
Posts: 8
Joined: 20 May 2009, 13:10
Noob?: No

Re: r6694 | a little Problem from idRO schat become unreadable

#4 Post by ToXCiL »

in file Receive.pm

Code: Select all

'009A' => ['system_chat', 'x2 A*', [qw(message)]], #maybe use a* instead and $message =~ /\000$//; if there are problems
and system_chat become:

Code: Select all

sub system_chat {
	my ($self, $args) = @_;

	my $message = bytesToString($args->{message});
	if (substr($message,0,4) eq 'micc') {
		$message = bytesToString(substr($args->{message},34));
	}
	stripLanguageCode(\$message);
	chatLog("s", "$message\n") if ($config{logSystemChat});
	# Translation Comment: System/GM chat
	message TF("[GM] %s\n", $message), "schat";
	ChatQueue::add('gm', undef, undef, $message);

	Plugins::callHook('packet_sysMsg', {
		Msg => $message
	});
}
Work fine for me in idRO FnC
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: r6694 | a little Problem from idRO schat become unreadable

#5 Post by h4rry84 »

thanks :) , but it's kinda hackish to just using substring to just cut out from char 34 till end. luckily the pattern is the message starting out from char 34.

after think about it, instead of changing the global receive.pm, let the local serverType21 to handle it ~_~ :

Code: Select all

#########################################################################
#  OpenKore - Network subsystem
#  Copyright (c) 2006 OpenKore Team
#
#  This software is open source, licensed under the GNU General Public
#  License, version 2.
#  Basically, this means that you're allowed to modify and distribute
#  this software. However, if you distribute modified versions, you MUST
#  also distribute the source code.
#  See http://www.gnu.org/licenses/gpl.html for the full license.
#########################################################################
# tRO (Thai) for 2008-09-16Ragexe12_Th
# Servertype overview: http://www.openkore.com/wiki/index.php/ServerType
package Network::Receive::ServerType21;

use strict;
use Network::Receive;
use base qw(Network::Receive);
use Log qw(message warning error debug);
use Translation;
use Globals;
use Plugins;
use Misc;
use I18N qw(bytesToString);
use Utils qw(getHex swrite makeIP makeCoords);

sub new {
   my ($class) = @_;
   my $self = $class->SUPER::new();

   $self->{packet_list}{'0078'} = ['actor_display', 'x1 a4 v14 a4 v2 x2 C2 a3 x2 C1 v1', [qw(ID walk_speed param1 param2 param3 type hair_style weapon shield lowhead tophead midhead hair_color clothes_color head_dir guildID guildEmblem visual_effects stance sex coords act lv)]];
   $self->{packet_list}{'007C'} = ['actor_display', 'x1 a4 v14 C2 a3', [qw(ID walk_speed param1 param2 param3 hair_style weapon lowhead type shield tophead midhead hair_color clothes_color head_dir stance sex coords)]];
   $self->{packet_list}{'022C'} = ['actor_display', 'x1 a4 v3 V1 v5 V1 v5 a4 a4 V1 C2 a5 x3 v1', [qw(ID walk_speed param1 param2 param3 type hair_style weapon shield lowhead timestamp tophead midhead hair_color clothes_color head_dir guildID guildEmblem visual_effects stance sex coords lv)]];
   $self->{packet_list}{'009A'} = ['system_chat', 'x2 A*', [qw(message)]];

   return $self;
}

sub system_chat {
   my ($self, $args) = @_;

   my $message = bytesToString($args->{message});
   if (substr($message,0,4) eq 'micc') {
      $message = bytesToString(substr($args->{message},34));
   }
   stripLanguageCode(\$message);
   chatLog("s", "$message\n") if ($config{logSystemChat});
   # Translation Comment: System/GM chat
   message TF("[GM] %s\n", $message), "schat";
   ChatQueue::add('gm', undef, undef, $message);

   Plugins::callHook('packet_sysMsg', {
      Msg => $message
   });
}


1;
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: r6694 | a little Problem from idRO schat become unreadable

#6 Post by kali »

h4rry, in programming what you did was called “Separate changeable parts from others that remains the same,” a bit of the template pattern. That's actually good programming practice :)
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: r6694 | a little Problem from idRO schat become unreadable

#7 Post by kali »

BTW h4rry if you have time to test and commit, please do so :P
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: r6694 | a little Problem from idRO schat become unreadable

#8 Post by h4rry84 »

it's working fine using my serverType21.pm , but since the serverType21 is used for tRO after the modification of account screen, it became unusable now. so maybe another serverType ? -_-"
h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House

Re: r6694 | a little Problem from idRO schat become unreadable

#9 Post by h4rry84 »

for moment, i added new serverType 22 for idRO, since idRO can't use anymore serverType 21.
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: r6694 | a little Problem from idRO schat become unreadable

#10 Post by kali »

type 22 is fine.

Is everything okay so far?
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.