bug in xkore2/proxy connection & disconnects when using tele

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

Moderators: Moderators, Developers

Post Reply
Message
Author
genuine
Noob
Noob
Posts: 8
Joined: 15 May 2008, 08:19
Noob?: No

bug in xkore2/proxy connection & disconnects when using tele

#1 Post by genuine »

hi, i have an error in connecting in xkore2/proxy
and when i use teleport my RO disconects

can someone help me?

Code: Select all

Error message:
'x' outside of string in unpack at src/Base/Ragnarok/MapServer.pm line 83.

Stack trace:
'x' outside of string in unpack at src/Base/Ragnarok/MapServer.pm line 83.
 at src/Base/Ragnarok/MapServer.pm line 83
	Base::Ragnarok::MapServer::process_0072('Network::XKore2::MapServer=HASH(0x3082f4c)', 'Base::Server::Client=HASH(0x31fc8b8)', 'r\x{0}\x{7}wa\x{0},H-\x{1}\x{0}\x{0}\x{0}\x{0}\x{f0}\x{eb}\x{b3}\x{1}\x{0}') called at src/Base/RagnarokServer.pm line 56
	Base::RagnarokServer::onClientData('Network::XKore2::MapServer=HASH(0x3082f4c)', 'Base::Server::Client=HASH(0x31fc8b8)', 'r\x{0}\x{7}wa\x{0},H-\x{1}\x{0}\x{0}\x{0}\x{0}\x{f0}\x{eb}\x{b3}\x{1}\x{0}', 0) called at src/Base/Server.pm line 203
	Base::Server::iterate('Network::XKore2::MapServer=HASH(0x3082f4c)') called at src/Network/XKore2.pm line 143
	Network::XKore2::mainLoop('mainLoop_pre', 'undef', 'undef') called at src/Plugins.pm line 444
	Plugins::callHook('mainLoop_pre') called at src/functions.pl line 69
	main::mainLoop() called at src/Interface.pm line 75
	Interface::mainLoop('Interface::Console::Win32=HASH(0x24bb864)') called at openkore.pl line 96
	main::__start() called at start.pl line 125

Died at this line:
  	} else { #oRO and pRO and idRO
* 		my ($accountID, $charID, $sessionID, $gender) = unpack('x2 a4 x5 a4 x2 V x4 C', $message);
        $self->handleLogin($client, $accountID, $charID, $sessionID, $gender);


genuine
Noob
Noob
Posts: 8
Joined: 15 May 2008, 08:19
Noob?: No

Re: bug in xkore2/proxy connection & disconnects when using tele

#2 Post by genuine »

anyone can help me with this proble? thnx

here's my mapserver.pm

Code: Select all

package Base::Ragnarok::MapServer;

use strict;
use Time::HiRes qw(time);
no encoding 'utf8';
use bytes;

use Globals;
use Modules 'register';
use Base::RagnarokServer;
use Misc;
use base qw(Base::RagnarokServer);
use Utils;
use constant SESSION_TIMEOUT => 120;
use constant DUMMY_POSITION => {
	map => 'prontera.gat',
	x => 154,
	y => 198
};


sub new {
	my $class = shift;
	my %options = @_;
	my $self = $class->SUPER::new(
		$options{host},
		$options{port},
		$options{serverType},
		$options{rpackets}
	);
	$self->{sessionStore} = $options{sessionStore};
	return $self;
}

sub getCharInfo {
	#my ($self, $session) = @_;
}

sub handleLogin {
	my ($self, $client, $accountID, $charID, $sessionID, $gender) = @_;
	my $session = $self->{sessionStore}->get($sessionID);

	if (!$session || $session->{accountID} ne $accountID || $session->{sessionID} != $sessionID
	  || $session->{sex} != $gender || $session->{charID} ne $charID
	  || $session->{state} ne 'About to load map') {
		$client->close();

	} else {
		$self->{sessionStore}->remove($session);
		$client->{session} = $session;

		my $output;
		#Note: in perl 8 == "8_4" == '8_4',  so to separate them you need to use a regular expression
		$output = pack("C2",0x83, 0x02) if ($self->getServerType() =~ m/^8(_[1-4])$/);
		$output .= $accountID;

		my $charInfo = $self->getCharInfo($session);
		my $coords = '';
		shiftPack(\$coords, $charInfo->{x}, 10);
		shiftPack(\$coords, $charInfo->{y}, 10);
		shiftPack(\$coords, 0, 4);
		$output .= pack("C2 V a3 x2",
			0x73, 0x00,
			int(time),	# syncMapSync
			$coords		# character coordinates
		);
		$client->send($output);
	}
}

sub process_0072 {
	my ($self, $client, $message) = @_;
	if ($self->{serverType} == 0) {
		# Map server login.
      my ($accountID, $charID, $sessionID, $gender) = unpack('x2 a4 a4 V x4 C', $message);
      $self->handleLogin($client, $accountID, $charID, $sessionID, $gender);
      return 1;
	} elsif ($self->getServerType()  == 8) {
		# packet sendSkillUse
		$self->unhandledMessage($client, $message);
		return 0;
	} else { #oRO and pRO and idRO
		my ($accountID, $charID, $sessionID, $gender) = unpack('x2 a4 x5 a4 x2 V x4 C', $message);
      $self->handleLogin($client, $accountID, $charID, $sessionID, $gender);
      return 1;
	}
}

sub process_00F3 {
	my ($self, $client, $message) = @_;
	if ($self->getServerType() == 18) {
		# Map server login.
		my ($charID, $accountID, $sessionID, $gender) = unpack('x5 a4 a4 x V x9 x4 C', $message);
		$self->handleLogin($client, $accountID, $charID, $sessionID, $gender);
		return 1;
	} else {
		$self->unhandledMessage($client, $message);
		return 0;
	}
}

#	$msg = pack("C*", 0x9b, 0, 0x39, 0x33) .
#		$accountID .
#		pack("C*", 0x65) .
#		$charID .
#		pack("C*", 0x37, 0x33, 0x36, 0x64) .
#		$sessionID .
#		pack("V", getTickCount()) .
#		pack("C*", $sex);

sub process_009B {
	my ($self, $client, $message) = @_;

	if ($self->getServerType() == 8) {
		# Map server login.
		my ($accountID , $charID, $sessionID, $gender) = unpack('x4 a4 x a4 x4 V x4 C', $message);
		$self->handleLogin($client, $accountID, $charID, $sessionID, $gender);
		return 1;
	} else {
		$self->unhandledMessage($client, $message);
		return 0;
	}
}

sub unhandledMessage {
	my ($self, $client) = @_;
	if (!$client->{session}) {
		$client->close();
		return 0;
	} else {
		return 1;
	}
}

1;

Technology
Super Moderators
Super Moderators
Posts: 801
Joined: 06 May 2008, 12:47
Noob?: No

Re: bug in xkore2/proxy connection & disconnects when using tele

#3 Post by Technology »

xkore's modes are old, unmaintained and thus depreciated.
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!

Post Reply