Brian Posted January 26, 2012 Posted January 26, 2012 Suggestion: change @ban to only allow negatives if their GM level has privilege to use @unban http://www.eathena.w...er&showbug=5125 Eg: A character named Test got banned for 3 years.When a Game Master use @ban -3y Test, the ban will be removed. I don't think that is right, because the command @unban does the same thing and normally Game Masters don't have @unban privilege. [13:04] <@Pekkle> should we consider @ban <negative number> a bug? because some servers might give GMs @ban but not @unban. [13:04] <@Pekkle> http://www.eathena.w...er&showbug=5125 [13:05] <@assdev> Uh. [13:05] <@assdev> @ban 7d; @ban -4d should still be "not a bug" I think. [13:05] == assdev [[email protected]] [13:05] == realname : Marc Hittinger [13:05] == channels : @#RAthena @#rstaff [13:05] == server : *.rizon.net [Where are you?] [13:05] == End of WHOIS [13:06] <@assdev> I don't like "@ban 7d; @unban; @ban 3d" to adjust a ban (@unban doesn't take a duration does it?) [13:06] <@Pekkle> i think no duration for @unban [13:06] <@assdev> I like being able to reduce a ban/mute with negative numbers, and I always imagined it was intentional [13:07] <@Pekkle> ok [13:07] <@assdev> Could add a flag (or two -.-) to gm.conf -- minimum level to reduce a ban time [13:08] <@Pekkle> so if servers want to give GMs @ban but not @unban, it's not possible? because the GM could do @ban -99d or something to unban the player [13:08] <@Pekkle> lol more configs [13:08] <@assdev> Yeah :3 [13:08] <@Pekkle> hmm what if we made @ban only allow negatives if their GM level has privilege to use @unban ? [13:08] <@assdev> Oh neat [13:08] <@assdev> That sounds like a better solution [13:22] <xazax> who is assdev? [13:22] <@assdev> trojal-at-work [13:22] <xazax> oh
Protimus Posted January 28, 2012 Posted January 28, 2012 I think it already works as intended. In atcommand.c command function ACMD_FUNC(char_ban) This condiction shows that it is possible to use both: if (modif_p[0] == '-' || modif_p[0] == '+') Someone can test for me if it really works?
Brian Posted January 28, 2012 Author Posted January 28, 2012 I know the +/- part is working as intended, I was just wondering if we could add some code to sum up the time, and if the overall time is negative (effectively reducing the ban), then only allow it if they have permission to use @unban? This would prevent GMs who don't have @unban from using @ban <negative number> to un-ban someone.
Gepard Posted January 28, 2012 Posted January 28, 2012 Well that is obviously not working as intended. And the solution proposed by Brain sounds good enough. 1
Protimus Posted January 29, 2012 Posted January 29, 2012 I had not understood your idea (bad english). Yes, it's a good idea... I think we should change, if you can I do that later.
Brian Posted February 9, 2012 Author Posted February 9, 2012 Thanks Ind, but Would it be possible to add code that sums up the <time> and if the overall time is negative, then block it if they don't have permission to @unban. Right now, the code you added checks for ANY negative <time>. @ban +23h PlayerName @ban +1d-1h PlayerName ^ both of these mean "add 23 hours" to the char's ban, but the 2nd one would fail because it has a negative sign.
Gepard Posted February 9, 2012 Posted February 9, 2012 Would it be possible to add code that sums up the <time> and if the overall time is negative, then block it if they don't have permission to @unban. +1 and that's why I didn't start fixing it in first place Denying minus sign is not the proper solution here. 1
Ind Posted February 9, 2012 Posted February 9, 2012 oh I didn't even know you could combine like that D: sorry >_< I failed to read the comments over char_ban code /me cries in agony. uhm it's login server who handles the previous (if any) ban time +___+ /me goes think Edit: I think i can get it to work if i move the check to char server (where it receives the ban request, then replies with a new chrif_char_ask_name_answer value) -- although char server cannot retrieve unban min level ^___^ how lovely. I'll try to think of something .-. will someone stab me if i add a new field to the ban packet?D: (or any better suggestions than this?)
Gepard Posted February 9, 2012 Posted February 9, 2012 Just calculate total time in atcommand_char_ban. Dunno, maybe use some time-related structure type for it, or just by hand (total = hours*3600 + minutes*60 + seconds +....). If total < 0 -> deny. If total == 0 -> "no change message", if total > 0 -> request char-server to (extend) ban.
Recommended Posts