-
Notifications
You must be signed in to change notification settings - Fork 180
Added spawn management commands, along with some minor bugfixes #1807
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
base: main
Are you sure you want to change the base?
Added spawn management commands, along with some minor bugfixes #1807
Conversation
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.
|
will review today sometime. Please revert the changes to ConstructEntity in the meantime as that is old code now. |
|
This is quite a large change list, if it could be broken up at all that would be nice but if not its fine |
|
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 |
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 |
|
Will do! Unfortunately, it might come next weekend. Behaviour update scuppered any chances of me doing any work! |
| 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) << " "; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
EmosewaMC
left a comment
There was a problem hiding this 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).
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.