Poseidon: CHARACTER_INFO size error

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
kudos2u
Noob
Noob
Posts: 6
Joined: 06 Oct 2010, 11:45
Noob?: No

Poseidon: CHARACTER_INFO size error

#1 Post by kudos2u »

This is as far as I could go. Could somebody tell me how to fix this? I've tried searching everywhere and yet, I found no answer. :(

Image

*Hoping for someone to help me out*

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Poseidon: CHARACTER_INFO size error

#2 Post by EternalHarvest »

Maybe character list packet construction in Poseidon::RagnarokServer needs modification according to your server's charBlockSize.

kudos2u
Noob
Noob
Posts: 6
Joined: 06 Oct 2010, 11:45
Noob?: No

Re: Poseidon: CHARACTER_INFO size error

#3 Post by kudos2u »

Thanks for the idea. I've tried what you've suggested, and failed (got overwhelmed by those packets). lol :lol:

Modifying some strings resulted in "Failed to connect to server" popups. I just don't know how to modify it correctly since I didn't study perl or any language at all.

Shed some light, anyone? :D

EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: Poseidon: CHARACTER_INFO size error

#4 Post by EternalHarvest »

Updated relevant part of Poseidon::RagnarokServer (OpenKore can see characters correctly and connect now, no idea about client):

Code: Select all

	} elsif (($switch eq '0065') || ($switch eq '0275') || ($msg =~ /^$packed_switch$accountID$sessionID$sessionID2\x0\x0.$/)) { # client sends server choice packet

		my %character_base = (
			exp => 0, zeny => 0, exp_job => 0, lvl_job => 70,
			hp => 0x0fff, sp => 0x0fff, job_id1 => 0, job_id2 => 23,
			hairStyle => 16, level => 99, points_skill => 1,
			hairColor => 6,
			str => 99, agi => 99, vit => 99, int => 99, dex => 99, luk => 99,
			rename => 0,
		);
		my @characters = (
			{%character_base, slot => 0, name => 'Poseidon', head_low => 0x0038, head_top => 0x00a0, head_mid => 0x009e},
			{%character_base, slot => 1, name => 'Poseidon Dev', head_low => 0x0039, head_top => 0x009f, head_mid => 0x0098},
		);
		my $data;

		if($clientdata{$index}{kRO}) {	#Packet 006B of kRO differs from that of other servers
			$client->send($accountID);
			$data = pack ("H272", "6b0088000100000064000000007fffffbc000000000000004cf1d00080020000000000002300000001000000000000000000000000000000000000000000000002004c0000004c00000016001600960006001700000006000000000000000000000001000000b1e2beefbcd3b1d7c0dabdc42100000000000000000000000c0901010c0100000100");
		} else {
			for (@characters) {
				$data .= pack
					$ENV{POSEIDON_CHARBLOCKSIZE} == 112
						? 'a4 V4 x22 V2 v2 x2 v2 x2 v3 x2 v3 x2 a24 C6 v2'
						: 'a4 V4 x22 v4    x2 v2 x2 v3 x2 v3 x2 a24 C6 v', # old Poseidon packing (charBlockSize 106?)
					$charID, @{$_}{qw(exp zeny exp_job lvl_job hp hp sp sp job_id1 hairStyle level points_skill head_low head_top head_mid hairColor name str agi vit int dex luk slot rename)};
				# NOTE: ideally, all character slots are filled with the same character, for idiot-proofing
				# NOTE: also, the character's appearance may be made to be modifiable
			}
			
			$data = $accountID . pack("v2 x20", 0x6b, ($ENV{POSEIDON_CHARBLOCKSIZE} || 106)*@characters + 24) . $data;
		}

		$client->send($data);

		# save servers.txt info
		if ($switch ne '0065') {
			$clientdata{$index}{gameLogin_packet} = $switch;
		} else {
			undef $clientdata{$index}{gameLogin_packet};
		}

	} elsif ($switch eq '0066') { # client sends character choice packet
Run with POSEIDON_CHARBLOCKSIZE=112 (or modify conditions in the source).

kudos2u
Noob
Noob
Posts: 6
Joined: 06 Oct 2010, 11:45
Noob?: No

Re: Poseidon: CHARACTER_INFO size error

#5 Post by kudos2u »

Tried your code on every block size from 106 to 128. It's either it would fail to connect to server or show the same popup from my screenshot. I can't figure out why openkore can connect on the right charBlockSize whereas poseidon cannot. Jeez! :o

Thanks for helping me btw, I appreciate it much! :D

KeithRafael
Human
Human
Posts: 23
Joined: 27 Aug 2009, 04:10
Noob?: No

Re: Poseidon: CHARACTER_INFO size error

#6 Post by KeithRafael »

Is this code only works on KRO right? just to clarify. i'm also working on Poseidon and gathering some update on it. list client receivepacket etc. I also got the same error. Thanks and regards.

paulmichael
Noob
Noob
Posts: 2
Joined: 27 May 2011, 07:02
Noob?: Yes

Re: Poseidon: CHARACTER_INFO size error

#7 Post by paulmichael »

any update on this? :)

Locked