You are here: Big Brother Bot ForumCommunity DevelopersPlugin DevelopersCustom command - adminplugin died
Pages: [1]   Go Down
  Print  
Author Topic: Custom command - adminplugin died  (Read 512 times) Bookmark and Share
Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« on: October 21, 2011, 07:07:14 AM »

Hiya, I have a problem with writing b3 plugin. I'm not a 'pro' coder but I know some stuff. I've written a plugin with help of Bakes' code from github but after loading it up, every single plugin depending on adminplugin died. The only one left is pingwatcher, and shockingly it works well.

This is my plugin: http://pastebin.com/J03hpprH (yes, I know, it fails, still learning)
And here is its xml: http://pastebin.com/7SEnxwDJ

I can't supply b3.log as it already exceeded max filesize and it got auto-deleted.
Thanks for any help in advance, Arthur.
Logged

Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #1 on: October 21, 2011, 09:05:33 AM »

B3 log shouldn't get auto deleted, if it gets too big it gets rotated, b3.log.1 etc

We really need it to see what is going on in order to help.

Logged
Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« Reply #2 on: October 21, 2011, 11:44:27 AM »

It seems like my host has installed some software that automatically deletes b3.log.*
All I really ask for is for somebody to point me into right direction to create a plugin that does what mine is supposed to do, which is:
When 100 lvl admin executes !wzmmake (nick of player) (human/zombie), b3 should execute command like in rcon, which is set Make_User_(human/zombie from command) (guid of a player from command).
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #3 on: October 21, 2011, 03:04:00 PM »

You're plugin seems pretty complicated, but I see no reason why it should break plugin admin... b3.log (especially part from start until all plugins are started is necessary).

In your code, the function for executin rcon is not really necessary. You could try instead of:
Code:
result = executeRcon("set Make_User_Human ", sclient.guid)

write:
Code:
self.console.write("set Make_User_Human %s" % (sclient.guid))

but your way with exception and separate function is more universal:)

Also, your plugin uses only one command, so why you need to sweep whole xml config file for commands, while you can directly enter:
Code:
self._adminPlugin.registerCommand(self, wzmmake, 100, cmd_wzmmake, alias)

But my plugin experience is based on many failures, so you'd better have distance to my advices in this matter.
Logged

Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« Reply #4 on: October 22, 2011, 12:11:03 AM »

I realise it's easier to just add the command without bothering with XML config, but I like having a possibility to easily add a command. I'll try to add the plugin once again, and this time give you a log.

http://pastebin.com/8D0kDXu0
Seems like it can't connect to rcon now which is weird.

Well, that was a weird problem, solved.
Now though, I thought that I'll add this command to MakeRoom plugin (by Courgette).
http://pastebin.com/aFUfhV0r - def wzmmake is line 200

http://pastebin.com/DcmzxdYL
Here is a piece of b3.log

Lines 206-208:
        if not data:
            client.message('expecting nick of a player')
            return
What could have I possibly done wrong there?
« Last Edit: October 22, 2011, 06:44:27 AM by TheBeaST » Logged
Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« Reply #5 on: October 23, 2011, 04:21:46 AM »

*Bump*
Would nobody answer if I just edit the post?
Logged
Dev. Team
*
OS: Windows
Type: Gameserver Rental Co.
Gameservers: COD2,COD4,COD5
Posts: 1098
Offline Offline
« Reply #6 on: October 23, 2011, 09:04:43 AM »

Does the rest of the modified makeroom plugin work?
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #7 on: October 23, 2011, 09:08:07 AM »

If you edit post it's not shown on recent posts:)

First things first, the first link you provided shows manual shutdown of the BBB, nothing unusual there. You should always try to provide log showing start of the BBB.

Second, have you tried defining function without these "None" values?
Code:
def cmd_wzmmake(self, data, type, client, cmd=None):

Logged

Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« Reply #8 on: October 23, 2011, 02:39:20 PM »

Does the rest of the modified makeroom plugin work?
!makeroom works just as intended.
If you edit post it's not shown on recent posts:)

First things first, the first link you provided shows manual shutdown of the BBB, nothing unusual there. You should always try to provide log showing start of the BBB.

Second, have you tried defining function without these "None" values?
Code:
def cmd_wzmmake(self, data, type, client, cmd=None):
I don't think it'd make any difference, do you? It's just defining variable a None value before handling it so that when a function is called, these values are optional, can't see anything wrong with that. What's more, every def in makeroom plugin is constructed this way - there is no way this could have any impact on it not working. Anyway, I changed my def to this: http://pastebin.com/qbY0ZqBG
I'm not sure how b3 passes arguments into defs, but for this to find out if it works I have to wait for my VPS admin to restart B3 (long story short, after using !restart it fu*** up)
Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: UrT
Posts: 244
Offline Offline
« Reply #9 on: October 23, 2011, 02:53:00 PM »

Yea, I know, but I used client.message function without any problems...
Also you might want to change:
client.message('text')
into:
cmd.sayLoudOrPM(client, 'text')

Second function distinguish between !command, @command and &command.


Just had an idea, that you might not be importing something... Try:
import b3.plugin
from b3 import clients
Logged

Newbie
*
OS: Linux
Type: Renting Server with B3
Gameservers: CoD6
Posts: 6
Offline Offline
« Reply #10 on: October 25, 2011, 10:16:23 AM »

Yea, I know, but I used client.message function without any problems...
Also you might want to change:
client.message('text')
into:
cmd.sayLoudOrPM(client, 'text')

Second function distinguish between !command, @command and &command.


Just had an idea, that you might not be importing something... Try:
import b3.plugin
from b3 import clients
Thank you, import worked Shocked
Every single time it's always a stupid mistake ;p Consider the thread closed.
« Last Edit: October 25, 2011, 02:25:22 PM by TheBeaST » Logged
Tags:
Pages: [1]   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal