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

Zone Switcher Returns Error #27

Open
mobbyg opened this issue Oct 10, 2023 · 3 comments
Open

Zone Switcher Returns Error #27

mobbyg opened this issue Oct 10, 2023 · 3 comments
Assignees
Labels
back end help wanted Extra attention is needed

Comments

@mobbyg
Copy link
Collaborator

mobbyg commented Oct 10, 2023

After logging in as an admin, when trying to switch a character to a different zone from the Zone Switcher page, it originally returned a 404 error looking for 'zonesByIndex.json'. When I went into the public/assets/js folder, the only json file there, was zones.json. So renamed assuming that is the correct file. When I ran again, the 404 was gone, but got an Error 500. Also an uncaught exception:

Uncaught (in promise) SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

Ran the json file through a checker and comes back as good. So my guess is in how the moveCharacter.php is handling the data somehow.

image

@mobbyg mobbyg added help wanted Extra attention is needed back end labels Oct 10, 2023
@mobbyg mobbyg self-assigned this Oct 10, 2023
@dracc
Copy link
Contributor

dracc commented Oct 10, 2023

This looks like the culprit to me, rather than the PHP stuff.

I'd recommend changing the sought path at the line linked over renaming the file.

@mobbyg
Copy link
Collaborator Author

mobbyg commented Oct 11, 2023

Not 100% sure what I am missing @dracc . I have the path on the server as /var/www/webui/public/assets/js/, and the root folder for the site is the public folder. I guess I am confused.

@mobbyg
Copy link
Collaborator Author

mobbyg commented Oct 24, 2023

The Error 500 appears to be something with the data type? Here is what it's sending to the server:

{"character_id":"0","map_index":"1","location":[0,0,0],"orientation":[0,0,0]}

Which generates the 500 error. Here is the error log from the web server:

PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, stdClass given in /var/www/webui/public/assets/includes/moveCharacter.php:54\nStack trace:\n#0 /var/www/webui/public/assets/includes/moveCharacter.php(138): moveCharacter()\n#1 {main}\n thrown in /var/www/webui/public/assets/includes/moveCharacter.php on line 54, referer: http://webui.dev-box.local/?page=zones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back end help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants