I always get this character_info size error...
Can someone please tell me how to fix this...
# Problem Solved....
# I will be monitoring it for a while...
This is How I Fixed it.... *From sofax222's Post
*Thanks to sofax222
and....Making "Xkore 2" and "Xkore 1" work, you need change the packet file and some programs as followings:
The 006B packet sending back to RO Client.
The 006B packect including the data of characters is sent back from server.
I change some codes in the program, src/Network/XKore2/CharServer.pmThe line 28, 29 and 30 are the original codes, I remark them and add the line 27.Code: Select all
23 sub getCharacters { 24 my ($self, $session) = @_; 25 my @chars; 26 if (!$session->{dummy} && $char) { 27 push @chars, $char; 28 # for (my $i = 0; $i < 6; $i++) { 29 # push @chars, $char; 30 # } 31 } else { 32 $session->{dummy} = 1; 33 for (my $i = 0; $i < 6; $i++) { 34 push @chars, Base::Ragnarok::CharServer::DUMMY_CHARACTER; 35 } 36 } 37 return @chars; 38 }
I change some codes in the program, src/Base/Ragnarok/CharServer.pmThe line 92 is remarked, add the line 93. The length of 006B should be 119 (the charBlockSize sholud be 115).Code: Select all
72 sub process_0065 { 73 # Character server login. .............. 89 foreach my $char ($self->getCharacters($session)) { 90 $index++; 91 next if (!$char); 92 # my $charStructure = pack('x' . $self->charBlockSize()); 93 my $charStructure = pack('x' . $self->charBlockSize() + 3); 94 95 # substr($charStructure, 0, 18) = pack('a4 V3 v', 96 substr($charStructure, 0, 21) = pack('C3 a4 V3 v', 97 0x06, 0x06, 0x06, 98 $char->{charID}, # character ID 99 $char->{exp}, # base experience 100 $char->{zeny}, # zeny 101 $char->{exp_job}, # job experience 102 $char->{lv_job} # job level 103 ); 104 105 # substr($charStructure, 42, 64) = pack('v7 x2 v x2 v x2 v4 Z24 C6 v', 106 substr($charStructure, 43, 72) = pack('v V2 v5 x2 v x2 v x2 v4 Z24 C6 v2', 107 0, 108 $char->{hp}, 109 $char->{hp_max}, 110 $char->{sp}, 111 $char->{sp_max}, 112 $char->{walk_speed} * 1000, 113 $char->{jobID}, 114 $char->{hair_style}, 115 $char->{lv}, 116 $char->{headgear}{low}, 117 $char->{headgear}{top}, 118 $char->{headgear}{mid}, 119 $char->{hair_color}, 120 $char->{clothes_color}, 121 $char->{name}, 122 $char->{str}, 123 $char->{agi}, 124 $char->{vit}, 125 $char->{int}, 126 $char->{dex}, 127 $char->{luk}, 128 # $index 129 $index, 130 $index + 1 131 ); 132 133 $output .= $charStructure; 134 } ..............
(PS: I don't know the charBlockSize sholud be change to 115 or not ?!)
The line 95 is remarked, add the line 96 and 97.
(PS: I don't know the 2 0x06 btyes for what, yet ??)
The line 105 is remarked, add the line 106 and 107.
The line 128 is remarked, add the line 129 and 130.
I change some codes in the program, src/Base/Ragnarok/MapServer.pmAdd the line 53. (Send a 07FF packet to RO client before 0283 packet.)Code: Select all
39 sub handleLogin { 40 my ($self, $client, $accountID, $charID, $sessionID, $gender) = @_; 41 my $session = $self->{sessionStore}->get($sessionID); 42 43 if (!$session || $session->{accountID} ne $accountID || $session->{sessionID} != $sessionID 44 || $session->{sex} != $gender || $session->{charID} ne $charID 45 || $session->{state} ne 'About to load map') { 46 $client->close(); 47 48 } else { 49 $self->{sessionStore}->remove($session); 50 $client->{session} = $session; 51 52 my $output; 53 $output = pack("C8", 0xFF, 0x07, 0x08, 0x00, 0x03, 0x00, 0x00, 0x00); 54 #Note: in perl 8 == "8_4" == '8_4', so to separate them you need to use a regular expression 55 # $output = pack("C2",0x83, 0x02) if ($self->getServerType() =~ m/^8(_[1-5])$/); 56 $output .= pack("C2", 0x83, 0x02) if (($self->getServerType() =~ m/^8(_[1-5])$/) || ($self->getServerType() eq "twRO")); 57 $output .= $accountID; 58 59 my $charInfo = $self->getCharInfo($session); 60 my $coords = ''; 61 shiftPack(\$coords, $charInfo->{x}, 10); 62 shiftPack(\$coords, $charInfo->{y}, 10); 63 shiftPack(\$coords, 0, 4); 64 $output .= pack("C2 V a3 x2", 65 0x73, 0x00, 66 int(time), # syncMapSync 67 $coords # character coordinates 68 ); 69 $client->send($output); 70 } 71 }
The line 55 is remarked, add the line 56.
I change some lenght of packets(recvpackets-twRO-free.txt) :
0072 22 -> 0072 19
007E 105 -> 007E 6
0085 10 -> 0085 5
0089 11 -> 0089 7
0094 19 -> 0094 6
Early, the XKore 1 & 2 bith did not work.
So, I decide try to hack the XKore 2 firstly.
(PS: I think the XKore 2 should be more easy).
And then, I hack it step by step with packet analysising.
After the XKore 2 working, the XKore just works, too.
I did nothing change for XKore 1.
But, the changes of packet length may be more than these.
Because, I did not change them in one time.
I did these change with try and error.
Actually, you could add some codes into the subroutine "onClientData" of /src/Base/RagnarokServer.pm.
such as:The lines are my adding:Code: Select all
sub onClientData { my ($self, $client, $data) = @_; $client->{tokenizer}->add($data); my $type; print "got RO client messages !!!\n"; bufDump($data); while (my $message = $client->{tokenizer}->readNext(\$type)) { if ($type == Network::MessageTokenizer::KNOWN_MESSAGE) { my $ID = Network::MessageTokenizer::getMessageID($message); print "--- $ID\n"; my $handler = $self->can('process_' . (($ID eq $masterServer->{mast......... ...............
print "got RO client messages !!!\n";
bufDump($data); (This "bufDump" is a subroutine what I add for dumping the packet in hex format.)
print "--- $ID\n";
After the RO client connect to XKore 2.
The XKore 2 shows the hex data sent from RO client.
If it show the "---XXXX", it means the XKore 2 could identify the packet.
If it show ont the hex data, the packet is bypassed with XKore 2.
So, you can count the number of hex codes (the packet length), and compare with the packet.txt file.
The bufDump code such as:Code: Select all
sub bufDump { my $buf = shift; my $nn = 0; foreach (split(//, $buf)) { printf("%02X ", ord($_)); $nn++; print " " if ($nn == 8); if ($nn == 16) { print "\n"; $nn = 0; } } print "\n"; }
*Again, thanks to sofax222 for this...