Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with player database macro functions throwing exceptions or returning incomplete/erroneous info #3017

Closed
Phergus opened this issue Oct 6, 2021 · 1 comment
Assignees
Labels
bug tested This issue has been QA tested by someone other than the developer.

Comments

@Phergus
Copy link
Contributor

Phergus commented Oct 6, 2021

Describe the bug
On player client, getInfo() & getName() functions thrown an exception whether run trusted or un-trusted:

java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "net.rptools.maptool.model.player.PlayerInfo.name()" because "playerInfo" is null
Error trace : Get Info@campaign
java.lang.NullPointerException: Cannot invoke "net.rptools.maptool.model.player.PlayerInfo.name()" because the return value of "java.util.concurrent.CompletableFuture.get()" is null error executing expression player.getName().
Error trace : Get Name@campaign

Also on player client, both getPlayers() and getConnectedPlayers() return the info for only the GM player but uses the Default Username as set in preferences and not the GM name as entered on the Start Server dialog.

[{
  "name": "Default Username",
  "role": "GM",
  "connected": true
}]

Passing a name to player.getInfo() that isn't in the player database produces an exception.

java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "net.rptools.maptool.model.player.PlayerInfo.name()" because "playerInfo" is null
Error trace : Get Info Error@campaign

To Reproduce
Steps to reproduce the behavior:

  1. Create a macro with [r: player.getInfo() ] on Campaign panel.
  2. Run macro from a player client and see above exception.
  3. Create a macro with [r: player.getName() ] on Campaign panel.
  4. Run macro from a player client and see above exception.
  5. Create a trusted macro with [r: player.getPlayers() ] on Campaign Panel
  6. Run macro from a player client. Only returns the GM but has the Default GM Name and not the actual GM name.
  7. Create a trusted macro with [r: player.getConnectPlayers() ] on Campaign Panel
  8. Run macro from a player client. Only returns the GM but has the Default GM Name and not the actual GM name.
  9. Create a trusted macro with [r: player.getInfo("somenamenotindb") ] on Campaign Panel
  10. Run macro from any client.

Expected behavior
For both step 2 and 4, the macros should return the correct information for the current player.
For both steps 6 and 8, expect to see all players or all connected players and that the GM info would have the correct name.
For step 10, expect to see error message such as Player "name" not found in database.

MapTool Info

  • Version: Current dev code
  • Install: from dev environment

Desktop (please complete the following information):

  • OS: Windows
  • Version: 10

Additional context
See issue #2912 for info on functions.

@Phergus Phergus added the bug label Oct 6, 2021
@Phergus Phergus added this to To do in MapTool 1.10.0 via automation Oct 6, 2021
@Phergus Phergus moved this from To do to In progress in MapTool 1.10.0 Oct 7, 2021
@Phergus Phergus added the tested This issue has been QA tested by someone other than the developer. label Oct 7, 2021
@Phergus
Copy link
Contributor Author

Phergus commented Oct 7, 2021

Tested - Issues Resolved.

@Phergus Phergus moved this from In progress to Reviewer approved in MapTool 1.10.0 Oct 7, 2021
@Phergus Phergus closed this as completed Oct 7, 2021
@Phergus Phergus moved this from Reviewer approved to Done in MapTool 1.10.0 Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug tested This issue has been QA tested by someone other than the developer.
Projects
No open projects
Development

No branches or pull requests

2 participants