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

Guard site submission concurrency #181

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

narc0tiq
Copy link
Owner

It is possible for the game to attempt to submit "the current site" when there is no current site (see #143 for an example) so just make sure that submit_site doesn't try to do anything if there is no current site.

Fixes #143

It is possible for the game to attempt to submit "the current site" when there is no current site (see #143 for an example) so just make sure that `submit_site` doesn't try to do anything if there is no current site.

Fixes #143
@@ -1512,7 +1514,7 @@ function resmon.on_click.expand_site(event)
site cleans up the expansion-related variables on the site) or if we were adding a new site
and decide to expand an existing one
--]]
if are_we_cancelling_expand or player_data.current_site then
if are_we_cancelling_expand and player_data.current_site then
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, I suspect just patching this one would fix the actual issue but it's safer for submit_site to actually check its input before it works on it.

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.

Server crash when trying to expand a resource area
1 participant