Skip to content

Conversation

@NinjaOfLU
Copy link
Contributor

Added commands to print to chat, despawn, and save to a bug reports entry, lists of entities, based on entity groups, or who/what spawned them.

Added a command to despawn an object by object id, and one to despawn based on the 'nearest to player' check done by the inspect command.

Added a command to print a player's object id to chat.

Also replaced (splitArgs.empty()) checks with (args == ""), because the argument parser never returns an empty vector, only a vector containing an empty string.

Updated Commands.md to reflect the added commands.

Added commands to print to chat, despawn, and save to a bug reports entry, lists of entities, based on entity groups, or who/what spawned them.

Added a command to despawn an object by object id, and one to despawn based on the 'nearest to player' check done by the inspect command.

Added a command to print a player's object id to chat.

Also replaced (splitArgs.empty()) checks with (args == ""), because the argument parser never returns an empty vector, only a vector containing an empty string.

Updated Commands.md to reflect the added commands.
@NinjaOfLU NinjaOfLU marked this pull request as ready for review June 7, 2025 18:04
@EmosewaMC EmosewaMC self-requested a review June 7, 2025 20:30
@EmosewaMC
Copy link
Collaborator

will review today sometime. Please revert the changes to ConstructEntity in the meantime as that is old code now.

@EmosewaMC
Copy link
Collaborator

This is quite a large change list, if it could be broken up at all that would be nice but if not its fine

@NinjaOfLU
Copy link
Contributor Author

Lowkey, I was a touch scared of being roasted for only making minor changes! xD

Maybe this is a sign that I go back through stuff a little, and clean it up!

And I see that stuff with ConstructEntity, yeah, I touched none of that. Clearly me breaking and fixing stuff on my end had ramifications! I'll see if I can fix that up, tomorrow.

@EmosewaMC
Copy link
Collaborator

Lowkey, I was a touch scared of being roasted for only making minor changes! xD

Maybe this is a sign that I go back through stuff a little, and clean it up!

And I see that stuff with ConstructEntity, yeah, I touched none of that. Clearly me breaking and fixing stuff on my end had ramifications! I'll see if I can fix that up, tomorrow.

i havent really looked at the pr yet, only saw the revert of the changes that fixed players remaining in a world even after quitting the game and made sure to mention it

@EmosewaMC
Copy link
Collaborator

Also replaced (splitArgs.empty()) checks with (args == ""), because the argument parser never returns an empty vector, only a vector containing an empty string.

instead lets fix the issue at the root and not push back into the vector if the input is empty

@NinjaOfLU
Copy link
Contributor Author

Also replaced (splitArgs.empty()) checks with (args == ""), because the argument parser never returns an empty vector, only a vector containing an empty string.

instead lets fix the issue at the root and not push back into the vector if the input is empty

Works for me! I was kind of just scared of touching it and breaking more things. I guess I should have checked where else it was used, but I kind of ran with 'maybe it's like that for a reason; I don't want to touch more than I need to'. All in all, sounds good!

@EmosewaMC
Copy link
Collaborator

Also replaced (splitArgs.empty()) checks with (args == ""), because the argument parser never returns an empty vector, only a vector containing an empty string.

instead lets fix the issue at the root and not push back into the vector if the input is empty

Works for me! I was kind of just scared of touching it and breaking more things. I guess I should have checked where else it was used, but I kind of ran with 'maybe it's like that for a reason; I don't want to touch more than I need to'. All in all, sounds good!

if it breaks anything it was probably not doing what was intended in the first place. I'll take a look at the places that call split string and see if any could possibly get an empty string as an input

@NinjaOfLU
Copy link
Contributor Author

Will do! Unfortunately, it might come next weekend. Behaviour update scuppered any chances of me doing any work!

Comment on lines +914 to +916
entityInfo << "/spawn " << std::to_string(lot) << " ";
entityInfo << std::to_string(x) << " " << std::to_string(y) << " " << std::to_string(z) << " ";
entityInfo << std::to_string(rotw) << " " << std::to_string(rotx) << " " << std::to_string(roty) << " " << std::to_string(rotz) << " ";
Copy link
Collaborator

Choose a reason for hiding this comment

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

you do not need to call to_string when piping to a string stream. stringstream does this for you and is faster.

reportInfo.selection = "Saved spawn command.";
if (character) reportInfo.characterId = character->GetID();

Database::Get()->InsertNewBugReport(reportInfo);
Copy link
Collaborator

Choose a reason for hiding this comment

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

what? Please seek out a better way to store this information. BugReports is not for this.

Copy link
Collaborator

@EmosewaMC EmosewaMC left a comment

Choose a reason for hiding this comment

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

On second thought, this needs to be split up into multiple prs, theres a lot going on here and it would be easier to follow whats being added in smaller chunks. The saving code also makes no sense being stored/read from where it does and should be re-tooled to either have its own table or to write to disk. there are a lot of changes i'd like to suggest however i want to put that time in in smaller chunks.
i would think this should be 3-4 prs in total, one modifying any existing functions, and 2-3 more adding more commands (ideally 3).

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.

2 participants