Jump to content

@ban <negative time> removes ban


Brian

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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? :D

[13:22] <@assdev> trojal-at-work

[13:22] <xazax> oh

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  198
  • Reputation:   102
  • Joined:  11/13/11
  • Last Seen:  

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?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

Well that is obviously not working as intended. And the solution proposed by Brain sounds good enough.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  198
  • Reputation:   102
  • Joined:  11/13/11
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 2 weeks later...

  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

Awesome idea. added in r15557

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

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 /no1 Denying minus sign is not the proper solution here.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

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?)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  392
  • Reputation:   285
  • Joined:  12/19/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

thanks to gepard it was fixed in r15558

Link to comment
Share on other sites

×
×
  • Create New...