-
Notifications
You must be signed in to change notification settings - Fork 126
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
Fixed unban
not overwriting banlist.txt
#228
Conversation
I gotta say I really like the idea of reusing your previous PR to just comment out bans. ^^ Also, making it dependent on the previous PR is a smart way to get that PR merged faster |
Just to be sure, you tested, banning, unbanning, re-banning, and re-unbanning the same UID? |
spoke to wolf about it, i feel like this is a really nice thing so the uid isnt just "gone" but you have an overview of what you did and when
those 2 prs arent on the same branch so i only tested their independant quirks 💀 ill make a new branch where i merge the 2 and test it fully! what im like 99.9% sure of if going to happen:
@GeckoEidechse i will test this all again tho to be 100% sure and ping u here again :) |
This is what I would expect and also prefer myself personally.
This is what I'm looking for. I haven't gotten the chance to read fully through the code so I just want to make sure that I comments out the right UID and doesn't just somehow grab the earlier one and just add another |
std::string modLine = line; // copy the line into a free var that we can fuck with, line will be the original
// remove tabs which shouldnt be there but maybe someone did the funny
modLine.erase(std::remove(modLine.begin(), modLine.end(), '\t'), modLine.end());
// remove spaces to allow for spaces before uids
modLine.erase(std::remove(modLine.begin(), modLine.end(), ' '), modLine.end());
// ignore line if first char is # or empty line, just add it
if (line.front() == BANLIST_COMMENT_CHAR || modLine == "")
{
banlistText.push_back(line);
continue;
} to spare you from reading through the whole file: this is the relevant part. it will do that for every line unless the first non-space/non-tab character is |
uids with inline comments werent able to unban due to whitespaces
alright so i fixed a small issue where unbanning a uid with inline comment wouldnt work because of whitespaces. ive tested banning, unbanning, re.banning and re.unbanning without issues but id be glad if others could confirm! @GeckoEidechse |
for testing purposes i merged the 2 pr branches into this branch https://github.com/ScureX/NorthstarLauncher/tree/commentsAndUnbanPRs so if anyone is doing a review or testing shit feel free to use it :) |
unban
not overwriting banlist.txt
unban
not overwriting banlist.txt
+ added banlist hotreload
alright so i made the banlist editable by closing it everywhere, it gets reloaded when a player joins. not really a need to reload it when a player gets banned since on join it get checked anyways |
moved hot reload to #233 |
unban
not overwriting banlist.txt
+ added banlist hotreloadunban
not overwriting banlist.txt
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.
Worked in testing by banning, unbanning, and re-banning a player a bunch of times with them (trying to) join in-between.
Bob said it's chill :D |
* fixed unban * changed timestamp for gecko * fixed unbanning with inline comment uids with inline comments werent able to unban due to whitespaces
This closes #165.
In the current state it only works with #227!
When unbanning it comments out the uid and adds a comment with the local time when the person was unbanned. Gives a nice overview i think, but it only works with #227 since that adds the comment functionality.