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?
December 02, 2008, 10:59:56 PM

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 485 times)
0 Members and 1 Guest are viewing this topic.
Temar
BeBot Developer
Grandmaster
********
Offline Offline

Gender: Male
Posts: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


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
********
Offline Offline

Gender: Male
Posts: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


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
********
Offline Offline

Gender: Male
Posts: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


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
********
Offline Offline

Gender: Male
Posts: 877



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

MSN messenger: chris_smith96 at hotmain dot com
Xfire: chriss96
Alreadythere
BeBot Maintainer
Administrator
Grandmaster
********
Offline Offline

Posts: 1085


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
!items database
by Zeephonz
[Today at 08:05:21 PM]

Log playtime from buddys ...
by IKShadow
[Today at 06:48:12 AM]

[request] Raid timers
by Elesar1
[December 01, 2008, 04:41:09 PM]

Shared DB online list
by Temar
[December 01, 2008, 01:55:47 AM]

relay colors
by Temar
[December 01, 2008, 01:54:56 AM]

BeBot v0.6.0 released
by Alreadythere
[November 30, 2008, 05:32:00 PM]

Change to Bid.php
by Temar
[November 30, 2008, 11:41:44 AM]

OnlineOrg
by Jiheld
[November 29, 2008, 12:44:27 PM]

Silly Newbie Question.
by Temar
[November 29, 2008, 12:00:02 PM]

massive_pvp_time_table 1
by gerborg
[November 29, 2008, 06:55:35 AM]
Stats
Members
Total Members: 1244
Latest: Armonkens
Stats
Total Posts: 11146
Total Topics: 1505
Online Today: 25
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 1
Guests: 14
Total: 15
Vain

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