collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18366
  • stats Total Topics: 2501
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: how to handle subcommands  (Read 6314 times)

0 Members and 1 Guest are viewing this topic.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
how to handle subcommands
« on: December 11, 2007, 06:58:08 am »
was thinking about wat should the bot do if user doesnt have access to a subcommand
i think letting the modules handle when is best way
i have 1 idea so far
if the subcommand is blocked
change the msg from !command subcommand ...
to !command * subcommand ...
then the command handler can handle the * or simple let it goto default
howeva there is the case were some module wont handle it
such as old preg_match handlers
and since u can add a subcommand to any module i think we need a way to tell bot.php it can send the modified msg
1 way could be do put
$this -> bot -> subcommands["command"] = TRUE;
then do a simple isset to see if it should do it


Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: how to handle subcommands
« Reply #1 on: December 11, 2007, 01:31:44 pm »
What do you want to do?

Handling of subcommands is and most likely always will be a job for the modules registering a command.

The new access control for subcommands in the SVN version doesn't really change this, all it does is block tries of users without access before they reach the module.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: how to handle subcommands
« Reply #2 on: December 11, 2007, 04:35:26 pm »
what i mean is alowing the module to handle the blocks


Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: how to handle subcommands
« Reply #3 on: December 11, 2007, 05:02:28 pm »
That would counter the idea behind access control.

Right now a module only gets informed if a valid command/subcommand combination is called. The module doesn't have to do anything about access control itself, it just has to check for that any further parameter are valid. And then do it's job.

Why should a module be informed that a user tried to call a command/subcommand he wasn't allowed to? It's not as if it should do anything further then, denied is denied.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: how to handle subcommands
« Reply #4 on: December 11, 2007, 05:19:04 pm »
ok

well far as i know currently is acts the same for subcommand as command when your too low, that being send help for tell and nothing on pg and gc
would be nice if subcommand error was added.
as people will see commands and all help on these and be wondering why it isnt working

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: how to handle subcommands
« Reply #5 on: December 11, 2007, 05:40:36 pm »
You could argue the same for the commands itself.

Offline Temar

  • Contributor
  • *******
  • Posts: 1140
  • Karma: +0/-0
    • AoFiles
Re: how to handle subcommands
« Reply #6 on: December 11, 2007, 07:30:24 pm »
well with command it wont be on help if they dont have access etc
but with subcommands it is and useing just the command works, just not the subcommand
also i know some module when not typed in correctly dont output and u end up with nothing
i think command if fine as it is
but subcommand need a simple output error like Subcommand "subcom" Requires Access Level of "level" to Use.
and maybe include a You have Accesslevel of "level"

Offline Alreadythere

  • BeBot Maintainer
  • BeBot Hero
  • ******
  • Posts: 1288
  • Karma: +0/-0
Re: how to handle subcommands
« Reply #7 on: December 11, 2007, 08:03:26 pm »
To much work IMO.

If a user thinks he got the command right, just a bit of syntax wrong he should do !help !command anyways.

 

* Recent Posts
Com bot module by bitnykk
[November 25, 2024, 05:36:11 pm ]


0.8.x updates for AO by bitnykk
[June 23, 2024, 03:19:47 pm ]


0.8.x updates for AoC by bitnykk
[June 23, 2024, 03:19:44 pm ]


[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm ]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am ]

* Who's Online
  • Dot Guests: 152
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal