Warning: Client Cannot Receive Packet or Key is Invalid

User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

Re: Warning: Client Cannot Receive Packet or Key is Invalid

Post by atom0s » Fri Oct 03, 2014 2:27 am

In extreme cases, your current zone can get corrupted to 0 when the client key error occurs. When this happens if you set your previous zone to something like Lower Jeuno and the user attempts to login again, their current zone will be 0, their prev zone will be Jeuno. When that happens, the zone_in packet has a check for if zone 0 as mog house and then attempts to send you to your previous zone when you exit:

Code: Select all

	if (PChar->getZone() == 0) 
	{
		WBUFB(data,(0x80)-4) = 1;
		WBUFW(data,(0x30)-4) = PChar->loc.prevzone;             // form zone
		WBUFW(data,(0x42)-4) = PChar->loc.prevzone;             // from zone
	    WBUFW(data,(0xAA)-4) = GetMogHouseID(PChar);            // Mog House id
		WBUFB(data,(0xAE)-4) = GetMosHouseFlag(PChar);          // Mog House leaving flag
	} else {
		WBUFB(data,(0x80)-4) = 2;
		WBUFW(data,(0x30)-4) = PChar->getZone();                // to zone
		WBUFW(data,(0x42)-4) = PChar->getZone();                // to zone
	    WBUFW(data,(0xAA)-4) = 0x01FF;
        WBUFB(data,(0xAC)-4) = csid > 0 ? 0x01 : 0x00;          //if 0x01 then pause between zone
		WBUFB(data,(0xAF)-4) = PChar->loc.zone->CanUseMisc(MISC_MOGMENU);	// флаг, позволяет использовать mog menu за пределами mog house
	}
So that means this could happen:
- Player creates a new character and starts in Sandy.
- Player logs out or has key error.
- Players prevzone is force set to Lower Jeuno using your suggestion.
- Players currzone has the chance to corrupt and become 0.
- Player times out, then logs back in which they log into their mog house even though they were in Sandy.
- Player leaves their mog house and they are now in Lower Jeuno due to their prev zone being set.

It's rare to happen, but having your zones corrupt to 0 in the database is not unheard of.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Warning: Client Cannot Receive Packet or Key is Invalid

Post by TeoTwawki » Fri Oct 03, 2014 10:10 am

I'm not seeing any problems with my pos_zone and my pos_prevzone and being identical during login. I have them both set to the same value and I'm not getting any error.

Edit: I just checked on what happens with prevzone zero, while my current zone was set to Port Jeuno. After 1 failed login current zone was copied onto prevzone automatically The only times I've seen both current and prevzone get set to zero simultaneously the entire row's positional data was wiped, so there wouldn't be a homepoint value either.

We should send them to their home nations outpostNPC/explorerMoogle zone when all 3 zone values are zero.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

Re: Warning: Client Cannot Receive Packet or Key is Invalid

Post by atom0s » Fri Oct 03, 2014 12:12 pm

I wrote a stuck tool for Era a while back due to issues that i explained above. Peoples zones would land up both becoming 0 and being stuck in the void. And in some cases, people would log into their mog house and land up zoning to their prev zone.

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Warning: Client Cannot Receive Packet or Key is Invalid

Post by whasf » Fri Oct 03, 2014 10:22 pm

Ideally this would be fixed in the game server though. Along with a zone timer in the mog house!
-- Whasf

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Warning: Client Cannot Receive Packet or Key is Invalid

Post by TeoTwawki » Fri Oct 03, 2014 10:47 pm

whasf wrote:Ideally this would be fixed in the game server though. Along with a zone timer in the mog house!
MH needs to be like...a sub-zone instead of its own zone. It acts like part of the zone you came in from. The moogle's NPC ID is from there, the textIDs loaded are from there, on retail when you /sea someone who's in their mog they are still shown in the zone outside their the mog house.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply