Pocketmine-mp: Joining with the same name as someone else.

Created on 7 Jul 2017  路  9Comments  路  Source: pmmp/PocketMine-MP

Issue description




Tested this on api3/blocks

You can join with the same in a server even though that person is also online on the server.

Steps to reproduce the issue

  1. Have 2 devices
  2. Join the server with the same username.

OS and versions

  • PocketMine-MP: 1a5e3b2
  • PHP: 7.0.20
  • Server OS: Debian

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded?

If the issue is not reproducible without plugins:

  • Have you asked for help on our forums before creating an issue?
  • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section
  • Paste your list of plugins here (use the 'plugins' command in PocketMine-MP)

This is tested on a server without any plugins

Crashdump, backtrace or other files

  • ...
Core Fixed

Most helpful comment

Another copy-paste job... you see that Debugged label? We know full well what's causing the problem -
I just haven't decided how best to fix it. Copy-pasting code however, is an idiot's solution.

All 9 comments

This is only reproducible in the short space of time between logging in and spawning.

Do you know of any quick fix? I tried cancelling prelogin etc. But it all doesn't work

@Matthww

~Try sending a disconnection packet using the directDataPacket API method, then make sure to cancel the event so the server stops processing the player.~

Update: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Player.php#L3657

Off-Toppic: You can do this in singleplayer too by the way.

@thebigsmileXD Because singleplayer handles this differently. It uses the DeviceID or something similiar to see them different while on PMMP they are seen as the same person they share the same data such as Inventory.

Singleplayer is completely irrelevant. This issue targets a bug in PocketMine-MP.

Try closing the connection instead of cancelling it.
close()

This is what I meant btw.

Another copy-paste job... you see that Debugged label? We know full well what's causing the problem -
I just haven't decided how best to fix it. Copy-pasting code however, is an idiot's solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hugheth picture Hugheth  路  3Comments

jasonwynn10 picture jasonwynn10  路  3Comments

JoshuaACasey picture JoshuaACasey  路  3Comments

SuperAdam47 picture SuperAdam47  路  3Comments

beetree picture beetree  路  3Comments