Skip to content

Conversation

@aabstractt
Copy link

Fix the menu dont send... Quickfix: multitply 1000000 for the stored timestamp

@Muqsit
Copy link
Owner

Muqsit commented Jul 13, 2023

The change must be made to the registered default handler in PlayerNetworkHandlerRegistry instead. PlayStation (and I suspect other OSes) have different offset value and this would affect them.

$this->registerDefault(new ClosurePlayerNetworkHandler(static function(Closure $then) : NetworkStackLatencyEntry{
+	$timestamp = mt_rand();
+	return new NetworkStackLatencyEntry($timestamp * 1000000, $then, $timestamp);
-	return new NetworkStackLatencyEntry(mt_rand() * 1000 /* TODO: remove this hack */, $then);
}));

@Muqsit
Copy link
Owner

Muqsit commented Jul 13, 2023

Addressed in 363c211

@Muqsit Muqsit closed this Jul 13, 2023
@MateusBlackyOFC
Copy link

MateusBlackyOFC commented Jul 13, 2023

What is the solution for this error for players playing on console?
Well, I tried that one, and it didn't work!

Addressed in 363c211

@Muqsit
Copy link
Owner

Muqsit commented Jul 14, 2023

What is the solution for this error for players playing on console? Well, I tried that one, and it didn't work!

Addressed in 363c211

I've highlighted this in #216 (comment). At the moment, I do not have access to a PlayStation and therefore cannot test a solution. I would suggest trying the same fix for Windows 10 users to see if it works for PlayStation users as well:

protected function onEnable() : void{
	if(!InvMenuHandler::isRegistered()){
		InvMenuHandler::register($this);
	}
+	// possible solution for playstation users:
+	$registry = InvMenuHandler::getPlayerManager()->getNetworkHandlerRegistry();
+	$registry->register(DeviceOS::PLAYSTATION, $registry->get(DeviceOS::WINDOWS_10));
}

@dadodasyra
Copy link
Contributor

What is the solution for this error for players playing on console? Well, I tried that one, and it didn't work!

Addressed in 363c211

I've highlighted this in #216 (comment). At the moment, I do not have access to a PlayStation and therefore cannot test a solution. I would suggest trying the same fix for Windows 10 users to see if it works for PlayStation users as well:

protected function onEnable() : void{
	if(!InvMenuHandler::isRegistered()){
		InvMenuHandler::register($this);
	}
+	// possible solution for playstation users:
+	$registry = InvMenuHandler::getPlayerManager()->getNetworkHandlerRegistry();
+	$registry->register(DeviceOS::PLAYSTATION, $registry->get(DeviceOS::WINDOWS_10));
}

So, I tried multiple situations with a PS4 player.

  • With your actual pushed fixed it doesn't work, nothing opens
  • With the possible fix just ahead it doesnt work
  • By adding * 1000000 to the playstation thing (line 26) it works !!

We all love mojang weird protocol changes..

@Muqsit
Copy link
Owner

Muqsit commented Jul 16, 2023

What is the solution for this error for players playing on console? Well, I tried that one, and it didn't work!

Addressed in 363c211

I've highlighted this in #216 (comment). At the moment, I do not have access to a PlayStation and therefore cannot test a solution. I would suggest trying the same fix for Windows 10 users to see if it works for PlayStation users as well:

protected function onEnable() : void{
	if(!InvMenuHandler::isRegistered()){
		InvMenuHandler::register($this);
	}
+	// possible solution for playstation users:
+	$registry = InvMenuHandler::getPlayerManager()->getNetworkHandlerRegistry();
+	$registry->register(DeviceOS::PLAYSTATION, $registry->get(DeviceOS::WINDOWS_10));
}

So, I tried multiple situations with a PS4 player.

  • With your actual pushed fixed it doesn't work, nothing opens
  • With the possible fix just ahead it doesnt work
  • By adding * 1000000 to the playstation thing (line 26) it works !!

We all love mojang weird protocol changes..

Thank you for testing, I expected the fix to be something like that. You're welcome to open a PR that addresses the issue on PlayStation🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants