Most of the plugins here are made by B3 users and the authors may not visit frequently. If you need support for plugins or if questions remain unanswered, you will have to contact the author directly. Read the full Support Disclaimer here
NOTE: Do not attach plugins to your forumtopics! Attachements are periodically removed by maintenance tasks. Upload your plugins to our Downloads section instead!

Pages: [1] 2 3 ... 5   Go Down
  Print  
Author Topic: Telnet plugin  (Read 4032 times) Bookmark and Share
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« on: June 08, 2011, 11:41:53 AM »


description
Makes your B3 bot a telnet server.

You can then connect to your bot with your favorite telnet client and issue B3 commands or chat with online players.

To login through telnet you need to use your B3 id (the one that would start with '@' in-game) and your password. To set your password, either do manually with phpmyadmin (look at table Clients) or use the password plugin : https://github.com/xlr8or/b3-plugin-password/zipball/master

Requires Python 2.7

download - RSS feed
« Last Edit: September 07, 2011, 02:03:28 PM by Courgette » Logged


XLRstats dev.
Dev. Team
*
OS: Linux
Type: Home user
Gameservers: COD5, COD7, BF3
Posts: 947
Offline Offline
WWW
Support Specialty: XLRstats webfront
« Reply #1 on: June 08, 2011, 01:48:43 PM »

Cool plugin!  Grin
Logged

Beta Testers
*
OS: Linux
Type: Home user
Gameservers: CoD4 SoF2
Posts: 103
Offline Offline
WWW
« Reply #2 on: June 08, 2011, 02:09:04 PM »

Nice! I'll have to check that out.
Logged
Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: COD6
Posts: 19
Offline Offline
BsK Legion
WWW
« Reply #3 on: June 08, 2011, 08:10:37 PM »

Awsome!!!
Logged

BsK Legion
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #4 on: June 10, 2011, 12:38:12 PM »

v1.4 released. Fix an issue when connecting from putty and assume your passwords are stored encrypted
Logged

Jr. Member
**
OS: Windows
Type: Home user
Gameservers: bfbc2
Posts: 13
Offline Offline
« Reply #5 on: July 08, 2011, 04:12:16 PM »

May be a silly question...... but is the ip for this (if none specified) the b3 bots ip? or is it the servers Ip?
Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #6 on: July 08, 2011, 04:23:25 PM »

it has to be the b3 bot ip
Logged

Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: alterIW
Posts: 652
Offline Offline
WWW
« Reply #7 on: July 09, 2011, 10:14:17 AM »

Dont know how I missed this one. I'll have to install this.
Logged
Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: alterIW
Posts: 652
Offline Offline
WWW
« Reply #8 on: July 10, 2011, 05:01:50 PM »

There's something wrong with the plugin. There is no telnet.py file in the "extplugins" folder in the archive. The archive has this format:

conf folder
plugin_telnet.xml

telnet folder
__init__.py
telnetserver.py
-dpkt subfolder
__init__.py
telnet.py

Your readme says nothing about a telnetserver.py file and the telnet.py file is in the wrong folder.

*edit*

Also, I installed the "setpass" plugin and it doesn't seem to do anything after I issue the command:

Code:
110710 20:50:25 CONSOLE '305:16 say;01100001b6f95025;1;[GK]GrossKopf;\x15!setpass (password) (username)'
110710 20:50:25 VERBOSE 'Queueing event Say !setpass  (password) (username)'
110710 20:50:25 DEBUG 'AdminPlugin: OnSay handle 5:"!setpass  (password) (username)"'
110710 20:50:25 DEBUG 'AdminPlugin: Handle command !setpass (password) (username)'
« Last Edit: July 10, 2011, 05:06:38 PM by GrossKopf » Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #9 on: July 10, 2011, 09:55:51 PM »

thanks for the report. Readme file updated. It should now read
Quote
copy the telnet folder into b3/extplugins

setpass plugin ? I'm unaware of such a plugin
Logged

Beta Testers
*
OS: Windows
Type: Owner dedicated server(s)
Gameservers: alterIW
Posts: 652
Offline Offline
WWW
« Reply #10 on: July 11, 2011, 03:54:56 AM »

thanks for the report. Readme file updated. It should now read
setpass plugin ? I'm unaware of such a plugin

I'm referring to the password plugin you linked to in the first post:

Quote

EIDT

Also, since that's the folder structure, should the b3.xml look like this:

<plugin config="@b3/extplugins/conf/telnet/dpkt/plugin_telnet.xml" name="telnet"/>
« Last Edit: July 11, 2011, 04:03:08 AM by GrossKopf » Logged
Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD2
Posts: 63
Offline Offline
« Reply #11 on: July 31, 2011, 10:19:50 AM »

Dear Courgette,

I was excited once i saw this plugin  Grin,

i have been testing it,
and found some bug(s) which should be fixed in the main version.

bug #1:
!telnetkick (#id) doesn't work since it searches for connected clients (ingame)

before fix:
Code:
   def cmd_telnetkick(self, data, client, cmd=None):
        sclient = self.findClientPrompt(cid, client)
        if sclient:
fix:
Code:
   def cmd_telnetkick(self, data, client, cmd=None):
        sclient = self.findClientPrompt(cid, client)
        if not sclient:
            for k, v in self.telnetClients.iteritems():
                if int(k) == int(cid):
                    sclient = v

        if sclient:

bug #2:
in the code _newClient(self, client):
once a client connect it gets an new number which is taken from the size of already connected players, the problem here is as follows:

client 1 connect > id # 1
client 2 connect > id # 2
client 1 diconnect
client 3 connect > id # 2 (see below)

Code:
   def _newClient(self, client):
        me = self.telnetClients
        client.cid = len(me) + 1
this code will overwrite already owned values, which make already connected clients 'invisible',

fix:
Code:
    def onLoadConfig(self):
        self._telnetClientNextId = 1;

        # get the admin plugin so we can register commands
        self._adminPlugin = self.console.getPlugin('admin')
     /////////////
       other part
    /////////////

    def _newClient(self, client):
        me = self.telnetClients
        cid = self._telnetClientNextId
        self._telnetClientNextId += 1

        client.cid = cid
this fix, should give every connected & authenticated client an unique id (1,2,3 ....)
Tip or suggestion:
if you enter random text as message,
it would be nice if b3 verify if the client is allowed to use the !say command,


Just to notice,
i really love this plugin,
just some bugfixes & it would rock.

Greets,
Selbie / Kikker916
« Last Edit: July 31, 2011, 10:35:11 AM by Kikker916 / Selbie » Logged
Senior Dev.
*
OS: Linux
Type: Home user
Posts: 3484
Offline Offline
WWW
Support Specialty: B3-Core, UrT/SmG/BFBC2 parsers, Plugin development
« Reply #12 on: July 31, 2011, 10:48:41 AM »

Hi,

First thank you for your comments Smiley

bug #1 : not a bug (or not the one you describe) as the self.findClientPrompt() is a method of the telnet/__init__.py file which looks for clients in self.telnetClients already.
If in your test the !telnetkick command does not find a telnet client, then the bug must be in https://github.com/courgette/b3-plugin-telnet/blob/master/extplugins/telnet/__init__.py#L226 instead. It would be nice to have a b3.log to trace what happened in your test.

bug #2 : I have no time to reproduce / dev a patch / properly test any time soon. A quick untested patch is available at https://gist.github.com/1117071/daf5292f67b41517e6b249a9ae90b4551903094f . Could you please try it out and confirm it does not introduce any regression and fixes this issue ?

Quote
if you enter random text as message,
it would be nice if b3 verify if the client is allowed to use the !say command,
No time for that either however I will welcome any patch that would implement that feature (or better fork the project on github and make a pull request from your github account)

Logged

Beta Testers
*
OS: Linux
Type: Owner dedicated server(s)
Gameservers: CoD2
Posts: 63
Offline Offline
« Reply #13 on: July 31, 2011, 11:47:27 AM »

bug #1 : I found out that the function findClientPrompt() doesn't work,
it keeps returning 'None' as information,
once i edited the function call to 'self.findClientPrompt(m[0], client)'
it was able to kick telnet clients by name.
but i still had the bug once i did '!telnetkick 3' it din't responded.
so for that one, i keep using my old fix.

bug #2 : Solved with your fix.

Issue: this plugin doesn't work on b3 1.4.1.

Issue: this plugin doesn't work on python 2.6.
Code:
110801 14:55:13 BOT    'www.bigbrotherbot.net (b3) v1.6.1 [posix] [Sedici]'
110801 14:55:13 BOT    'Python: 2.6.7 (r267:88850, Aug  1 2011, 14:43:28) \n[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)]'
110801 14:55:13 BOT    'Default encoding: ascii'
110801 14:55:13 BOT    'Starting Cod2EParser v1.2.5 extended for server *'
110801 14:55:32 DEBUG u'TelnetPlugin: Telnet Client Connected: [66] Selbie!! - *.*.*.*'
110801 14:55:34 INFO 'TelnetPlugin: options : {}'
110801 14:55:34 CONSOLE '66\t: /who'
110801 14:55:34 ERROR 'TelnetPlugin: [\'Traceback (most recent call last):\', \'  File "/b3/extplugins/telnet/telnetserver.py", line 154, in handle\', \'    self.processor.process(l)\', \'  File "/b3/extplugins/telnet/telnetserver.py", line 324, in process\', \'    return func(arg)\', \'  File "/b3/extplugins/telnet/telnetserver.py", line 375, in cmd_who\', \'    since = timedelta(seconds=int(tmp.total_seconds()))\', "AttributeError: \'datetime.timedelta\' object has no attribute \'total_seconds\'"]'
110801 14:55:39 INFO 'TelnetPlugin: options : {}'
110801 14:55:39 CONSOLE '66\t: !telnetlist'
110801 14:55:39 DEBUG 'AdminPlugin: OnSay handle 7:"!telnetlist"'
110801 14:55:39 DEBUG 'AdminPlugin: Handle command !telnetlist'
110801 14:55:39 ERROR 'TelnetPlugin: [\'Traceback (most recent call last):\', \'  File "/b3/extplugins/telnet/telnetserver.py", line 154, in handle\', \'    self.processor.process(l)\', \'  File "/b3/extplugins/telnet/telnetserver.py", line 329, in process\', "    adminPlugin.OnSay(self.plugin.console.getEvent(\'EVT_CLIENT_PRIVATE_SAY\', line, self.client))", \'  File "/b3/plugins/admin.py", line 368, in OnSay\', \'    results = command.execute(data, event.client)\', \'  File "/b3/plugins/admin.py", line 2010, in execute\', \'    self.func(data, client, copy.copy(self))\', \'  File "/b3/extplugins/telnet/__init__.py", line 185, in cmd_telnetlist\', \'    since = timedelta(seconds=int(tmp.total_seconds()))\', "AttributeError: \'datetime.timedelta\' object has no attribute \'total_seconds\'"]'

Idea : I have an 'first' version which isn't perfect but it's working correctly Wink
Code:
/* class 'TelnetCommandProcessor' function 'process' file: 'telnetserver.py'
unde the else statement (last one) */

        else:
            adminPlugin = self.plugin.console.getPlugin('admin')
            command = adminPlugin._commands['say']
            if b3.plugins.admin.Command.canUse(command, self.client):
                self.plugin.console.say("[%s] %s" %(self.client.name, line))
            else:
                self.client.message("Sorry, you don't have acces to the command !say")

/* this require to import b3 above in the *.py file */
« Last Edit: August 01, 2011, 04:58:10 AM by Kikker916 / Selbie » Logged
Beta Testers
*
OS: Windows
Type: Renting Server, no B3
Gameservers: COD4 | COD2 | COD BO (Ranked and Unranked) | MOH 2010
Posts: 129
Offline Offline
« Reply #14 on: August 16, 2011, 08:04:01 AM »

Hi

I am running the 1.7.0 standalone Beta and once I installed the plugin I am receiving the following error:

Code:
110816 17:02:41 BOT     'Loading Plugin #20 telnet [M:\\B3_Cod4\\extplugins\\conf\\telnet\\dpkt\\plugin_telnet.xml]'
110816 17:02:41 INFO 'Could not load built in plugin telnet (No module named telnet)'
110816 17:02:41 INFO 'trying external plugin directory : M:\\B3_Cod4\\extplugins'
110816 17:02:41 CRITICAL 'Error loading plugin: No module named SocketServer'
Traceback (most recent call last):
  File "b3\parser.pyo", line 604, in loadPlugins
  File "b3\parser.pyo", line 717, in pluginImport
  File "M:\B3_Cod4\extplugins\telnet\__init__.py", line 53, in <module>
  File "M:\B3_Cod4\extplugins\telnet\telnetserver.py", line 25, in <module>
ImportError: No module named SocketServer

Any Ideas?
Logged
Tags: telnet  remote  plugin 
Pages: [1] 2 3 ... 5   Go Up
  Print  
 
Jump to:  


Rate this page +1 at Google Search


SimplePortal 2.3.1 © 2008-2009, SimplePortal