L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 07, 2008, 04:37:54 AM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: how to handle subcommands
Pages: [1]   Go Down
« previous next »
Print
Author Topic: how to handle subcommands  (Read 428 times)
0 Members and 1 Guest are viewing this topic.
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 773



WWW
how to handle subcommands
« on: December 11, 2007, 12: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

Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: how to handle subcommands
« Reply #1 on: December 11, 2007, 07:31:44 AM »

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.
Logged
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 773



WWW
Re: how to handle subcommands
« Reply #2 on: December 11, 2007, 10:35:26 AM »

what i mean is alowing the module to handle the blocks

Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: how to handle subcommands
« Reply #3 on: December 11, 2007, 11:02:28 AM »

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.
Logged
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 773



WWW
Re: how to handle subcommands
« Reply #4 on: December 11, 2007, 11:19:04 AM »

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
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: how to handle subcommands
« Reply #5 on: December 11, 2007, 11:40:36 AM »

You could argue the same for the commands itself.
Logged
Temar
BeBot Developer
Grandmaster
********
Online Online

Gender: Male
Posts: 773



WWW
Re: how to handle subcommands
« Reply #6 on: December 11, 2007, 01: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"
Logged
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1052


Re: how to handle subcommands
« Reply #7 on: December 11, 2007, 02: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.
Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online/Age Of Conan chat automaton > Forum > Development > Coding and development discussion > Topic: how to handle subcommands
« previous next »
 
Jump to:  

Recent
TWC
by Temar
[Today at 02:49:27 AM]

raid/point system suggest...
by Vain
[October 06, 2008, 08:53:00 PM]

!items database
by cthulhu
[October 05, 2008, 11:36:16 AM]

Supplies needed module
by viper
[October 05, 2008, 11:11:13 AM]

Assist
by Foxy
[October 05, 2008, 05:09:02 AM]

How's 0.5.x coming? Wonde...
by Hyde
[October 04, 2008, 04:59:20 PM]

Org in AoC
by Alreadythere
[October 04, 2008, 04:50:00 AM]

OnlineOrg
by Slacklin
[October 04, 2008, 03:06:00 AM]

Learning .NET, Mono, C#, ...
by Vhab
[October 04, 2008, 02:39:03 AM]

guild taxes module for ag...
by Elesar1
[October 03, 2008, 09:06:09 AM]
Stats
Members
Total Members: 983
Latest: Titerris
Stats
Total Posts: 10743
Total Topics: 1448
Online Today: 10
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 4
Guests: 47
Total: 51
Noer
Wolfbiter
Temar
IKShadow

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.173 seconds with 28 queries. (Pretty URLs adds 0.029s, 4q)
Loading...