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

Submitting a menu form kicks the player #270

Closed
AndreasHGK opened this issue Sep 10, 2021 · 3 comments · Fixed by #271
Closed

Submitting a menu form kicks the player #270

AndreasHGK opened this issue Sep 10, 2021 · 3 comments · Fixed by #271

Comments

@AndreasHGK
Copy link
Contributor

Whenever I create and send my menu form to the player and they click a button, they will get kicked with the following message DEBU[0015] failed processing packet from [ip]:65076 (AndreasHGK): *packet.ModalFormResponse: no form with ID 1 currently opened

@AndreasHGK AndreasHGK changed the title Submitting a menu form kicks the players Submitting a menu form kicks the player Sep 10, 2021
@AndreasHGK
Copy link
Contributor Author

I added a debug line fmt.Println(pk.FormID) in ModalFormResponseHandler and it seems like the packet is somehow being handled twice

@AndreasHGK
Copy link
Contributor Author

I added all these in the ModalFormResponseHandler:

	fmt.Println(pk.FormID)
	fmt.Println(pk.ResponseData)
	var index uint
	err := json.Unmarshal(pk.ResponseData, &index)
	fmt.Println(index)
	fmt.Println(err)

and it returned this:

1
[49 49 10]
11 //this is the actual button i pressed
<nil>

1
[110 117 108 108 10]
0
<nil>

@AndreasHGK
Copy link
Contributor Author

Putting a fmt.Println(bytes.Equal(pk.ResponseData, nullBytes)), it seems like the second packet returns null

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 a pull request may close this issue.

1 participant