Donate to the B3 fund!

"even a small donation helps!"
Donate with PayPal!
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!

Author Topic: ForumLink  (Read 35483 times)

Offline xavierk

  • Jr. Member
  • **
  • Posts: 16
Re: ForumLink
« Reply #30 on: March 10, 2010, 04:14:03 AM »
I am having an issue with this plugin.

B3 is on the game server, lets say ip 10.10.10.10 and my mysql database is on the werbserver, lets say 100.100.100.100

Settings inside forumlink.xml:
    <set name="forumtype">phpbb3</set>
    <set name="host">100.100.100.100</set>
    <set name="username">forum</set>
    <set name="password">xxxxxxxx</set>
    <set name="db">phpbb3</set>
    <set name="prefix">phpbb_</set>

Error:
100309 20:59:31 ERROR   handler AdminPlugin could not handle event Say: OperationalError: (1044, "Access denied for user 'forum'@'10.10.10.10' to database 'phpbb3'") [('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/parser.py', 711, 'handleEvents', 'hfunc.parseEvent(event)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugin.py', 143, 'parseEvent', 'self.onEvent(event)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugin.py', 161, 'onEvent', 'self.handle(event)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugins/admin.py', 137, 'handle', 'self.OnSay(event)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugins/admin.py', 269, 'OnSay', 'results = command.execute(data, event.client)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugins/admin.py', 2094, 'execute', 'self.func(data, client, copy.copy(self))'), ('/home/cod/cod/b3/extplugins/forumlink.py', 172, 'cmd_linkaccounts', "c = self.query(self.forum['checkregistered'] % {'prefix':self._prefix, 'profilefieldid':self._profilefieldid, 'data':data})"), ('/home/cod/cod/b3/extplugins/forumlink.py', 106, 'query', 'if self._db or self.dbconnect():'), ('/home/cod/cod/b3/extplugins/forumlink.py', 96, 'dbconnect', "self._db = MySQLdb.connect(self.config.get('db','host'),self.config.get('db','username'),self.config.get('db','password'),self.config.get('db','db'))"), ('/usr/lib64/python2.4/site-packages/MySQLdb/__init__.py', 75, 'Connect', 'return Connection(*args, **kwargs)'), ('/usr/lib64/python2.4/site-packages/MySQLdb/connections.py', 164, '__init__', 'super(Connection, self).__init__(*args, **kwargs2)')]

you'll notice my settings are set to 100.100.100.100 but the error shows it is trying to connect to 10.10.10.10.  I've even tried renaming the host to dbhost in the xml and py file to make sure it wasn't conflicting with a system variable or something.

If it helps: Python 2.4.3 (#1, Sep  3 2009, 15:37:37) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2


Your assistance is appreciated.  
« Last Edit: March 10, 2010, 04:31:45 AM by xavierk »

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: ForumLink
« Reply #31 on: March 10, 2010, 08:09:20 AM »
weird, probably something simple we're not seeing  :P

Can you do the following :
  • disable all plugins in b3.xml but the admin and forumlink plugins
  • restart the bot
  • post here your full b3.xml file (remove passwords)
  • post here your full forumlink.xml file (remove passwords)
  • post here your full b3.log file

Offline xavierk

  • Jr. Member
  • **
  • Posts: 16
Re: ForumLink
« Reply #32 on: March 10, 2010, 08:55:30 AM »
Quote from: Courgette
  • disable all plugins in b3.xml but the admin and forumlink plugins
  • restart the bot
Done; I changed any identifiers (guid, names, pw, ips, etc) but otherwise just what you wanted
Quote from: Courgette
  • post here your full b3.xml file (remove passwords)
Code: [Select]
<configuration plugin="forumlink">
  <settings name="commands">
    <set name="linkaccounts">1</set>
    <set name="newpms">1</set>
  </settings>
  <settings name="settings">
<!-- This can be the field identification value in phpBB3, or in SMF2, the ID of the custom field. In phpBB2, it's the name of the extra column in the users table. -->
    <set name="fieldid">1</set>
  </settings>
  <settings name="db">
<!-- Choices: smf2, phpbb3, or phpbb2 (no caps in either) -->
    <set name="forumtype">phpbb3</set>
    <set name="host">100.100.100.100</set>
    <set name="username">forum</set>
    <set name="password">xxxxxxxx</set>
    <set name="db">phpbb3</set>
    <set name="prefix">phpbb_</set>
  </settings>
</configuration>
Quote from: Courgette
  • post here your full forumlink.xml file (remove passwords)
Code: [Select]
<configuration>
  <settings name="b3">
    <!-- parser defines the game: cod/cod2/cod4/cod5/iourt41/etpro/wop/smg -->
    <set name="parser">cod</set>
    <set name="database">mysql://db3:[email protected]/b3</set>
    <set name="bot_name">b3</set>
    <set name="bot_prefix">^0(^2b3^0)^7:</set>
    <set name="time_format">%I:%M%p %Z %m/%d/%y</set>
    <set name="time_zone">CST</set>
    <!-- 9 = verbose, 10 = debug, 21 = bot, 22 = console -->
    <set name="log_level">9</set>
    <set name="logfile">~/cod/b3/logs/b3.log</set>
  </settings>
  <settings name="server">
    <set name="rcon_password">xxxxxxx</set>
    <set name="port">28960</set>
    <set name="game_log">~/.callofduty/uo/games_mp.log</set>
    <set name="public_ip">10.10.10.20</set>
    <set name="rcon_ip">10.10.10.20</set>
    <set name="punkbuster">on</set>
  </settings>
  <settings name="messages">
    <set name="kicked_by">%s^7 was kicked by %s^7 %s</set>
    <set name="kicked">%s^7 was kicked %s</set>
    <set name="banned_by">%s^7 was banned by %s^7 %s</set>
    <set name="banned">%s^7 was banned %s</set>
    <set name="temp_banned_by">%s^7 was temp banned by %s^7 for %s^7 %s</set>
    <set name="temp_banned">%s^7 was temp banned for %s^7 %s</set>
    <set name="unbanned_by">%s^7 was un-banned by %s^7 %s</set>
    <set name="unbanned">%s^7 was un-banned %s</set>
  </settings>
  <settings name="plugins">
    <set name="external_dir">~/cod/b3/extplugins</set>
  </settings>
  <plugins>
<!--
    <plugin name="censor" priority="1" config="~/cod/b3/conf/plugin_censor.xml"/>
    <plugin name="spamcontrol" priority="2" config="~/cod/b3/conf/plugin_spamcontrol.xml"/>
-->
    <plugin name="admin" priority="3" config="~/cod/b3/conf/plugin_admin.xml"/>
<!--
    <plugin name="tk" priority="4" config="~/cod/b3/conf/plugin_tk.xml"/>
    <plugin name="stats" priority="5" config="~/cod/b3/conf/plugin_stats.xml"/>
    <plugin name="pingwatch" priority="6" config="~/cod/b3/conf/plugin_pingwatch.xml"/>
    <plugin name="adv" priority="7" config="~/cod/b3/conf/plugin_adv.xml"/>
    <plugin name="status" priority="8" config="~/cod/b3/conf/plugin_status.xml"/>
    <plugin name="welcome" priority="9" config="~/cod/b3/conf/plugin_welcome.xml"/>
    <plugin name="publist" priority="10" config="~/cod/b3/conf/plugin_publist.xml"/>
    <plugin name="punkbuster" priority="11" config="~/cod/b3/conf/plugin_punkbuster.xml"/>
-->
    <plugin name="forumlink" priority="12" config="~/cod/b3/extplugins/conf/forumlink.xml"/>

<!--
  This is a non-standard plugin, and quite resource heavy. Please take a look in the
  B3 forums (look for XLR Extensions) for more information before enabling this.
  Extra database tables are necessary.
    <plugin name="xlrstats" priority="13" config="~/cod/b3/extplugins/conf/xlrstats.xml"/>
-->

  </plugins>
</configuration>
Quote from: Courgette
  • post here your full b3.log file
Code: [Select]
100310 01:34:57 BOT     www.BigBrotherBot.com (b3) v1.2.1 [posix] (Daniel)
100310 01:34:57 BOT     Python: 2.4.3 (#1, Sep  3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]
100310 01:34:57 BOT     Starting CodParser server for 10.10.10.20:28960
100310 01:34:57 BOT     --------------------------------------------
100310 01:34:57 BOT     Attempting to connect to database mysql://db3:[email protected]/b3...
100310 01:34:57 BOT     Connected to database [1 times]
100310 01:34:57 BOT     Game log /home/codgame/.callofduty/uo/games_mp.log
100310 01:34:57 BOT     Starting bot reading file /home/codgame/.callofduty/uo/games_mp.log
100310 01:34:57 VERBOSE RCON sending (10.10.10.20:28960) status
100310 01:34:58 BOT     Loading Plugin #3 admin [/home/codgame/cod/b3/conf/plugin_admin.xml]
100310 01:34:58 BOT     AdminPlugin: Loading config /home/codgame/cod/b3/conf/plugin_admin.xml for AdminPlugin
100310 01:34:58 DEBUG   Register Event: Stop Process: AdminPlugin
100310 01:34:58 DEBUG   Register Event: Program Exit: AdminPlugin
100310 01:34:58 BOT     Plugin admin (1.4.3 - ThorN) loaded
100310 01:34:58 BOT     Loading Plugin #12 forumlink [/home/codgame/cod/b3/extplugins/conf/forumlink.xml]
100310 01:34:58 INFO    Could not find built in plugin forumlink, trying external plugin directories.
No module named forumlink
100310 01:34:58 BOT     ForumlinkPlugin: Loading config /home/codgame/cod/b3/extplugins/conf/forumlink.xml for ForumlinkPlugin
100310 01:34:58 DEBUG   Register Event: Stop Process: ForumlinkPlugin
100310 01:34:58 DEBUG   Register Event: Program Exit: ForumlinkPlugin
100310 01:34:58 BOT     Plugin forumlink (0.1.1b - Bakes) loaded
100310 01:34:58 BOT     Loading Plugin publist
100310 01:34:58 BOT     PublistPlugin: No config file found for PublistPlugin. (was not required either)
100310 01:34:58 DEBUG   Register Event: Stop Process: PublistPlugin
100310 01:34:58 DEBUG   Register Event: Program Exit: PublistPlugin
100310 01:34:58 BOT     Plugin publist (1.1.11 - ThorN) loaded
100310 01:34:58 VERBOSE 0 cid changed from None to -1
100310 01:34:58 VERBOSE RCON sending (10.10.10.20:28960) say ^0(^2b3^0)^7: ^8www.BigBrotherBot.com ^0(^8b3^0) ^9v1.2.1 [posix] ^9(^3Daniel^9)^3 ^2[ONLINE]
100310 01:34:58 DEBUG   Client Connected: [-1] World - WORLD ({})
100310 01:34:58 DEBUG   Storage: getClient <b3.clients.Client object at 0xdb7c1d0>
100310 01:34:58 BOT     Client found in storage 1, welcome back World
100310 01:34:58 DEBUG   Storage: setClient <b3.clients.Client object at 0xdb7c1d0>
100310 01:34:58 DEBUG   Storage: setClient data {'time_add': 1267271428, 'time_edit': 1268206498, 'name': 'World', 'group_bits': 0, 'ip': '', 'auto_login': 1, 'greeting': '', 'pbid': 'WORLD', 'connections': 28, 'mask_level': 0, 'guid': 'WORLD', 'id': 1}
100310 01:34:58 DEBUG   Client Authorized: [-1] World - WORLD
100310 01:34:58 BOT     Starting Plugin admin
100310 01:34:58 DEBUG   Register Event: Say: AdminPlugin
100310 01:34:58 DEBUG   Register Event: Private Message: AdminPlugin
100310 01:34:58 DEBUG   AdminPlugin: Command "status (None)" registered with cmd_status for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "ci (None)" registered with cmd_ci for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "rules (r)" registered with cmd_rules for level (0, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warnclear (wc)" registered with cmd_warnclear for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "leveltest (lt)" registered with cmd_leveltest for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warn (w)" registered with cmd_warn for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "list (None)" registered with cmd_list for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warns (None)" registered with cmd_warns for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warntest (wt)" registered with cmd_warntest for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warninfo (wi)" registered with cmd_warninfo for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "greeting (None)" registered with cmd_greeting for level (9, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "nextmap (None)" registered with cmd_nextmap for level (2, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "cmdlevel (None)" registered with cmd_cmdlevel for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "lookup (l)" registered with cmd_lookup for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "b3 (None)" registered with cmd_b3 for level (9, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "seen (None)" registered with cmd_seen for level (2, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "find (None)" registered with cmd_find for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "pause (None)" registered with cmd_pause for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "kickall (kall)" registered with cmd_kickall for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "makereg (mr)" registered with cmd_makereg for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "admintest (None)" registered with cmd_admintest for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "regtest (None)" registered with cmd_regtest for level (1, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "rebuild (None)" registered with cmd_rebuild for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "maps (None)" registered with cmd_maps for level (2, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "ban (b)" registered with cmd_ban for level (60, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "ungroup (None)" registered with cmd_ungroup for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "delgroup (None)" registered with cmd_delgroup for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "banall (ball)" registered with cmd_banall for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "maprotate (None)" registered with cmd_maprotate for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "putgroup (None)" registered with cmd_putgroup for level (89, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "map (None)" registered with cmd_map for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "notice (None)" registered with cmd_notice for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "enable (None)" registered with cmd_enable for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "runas (su)" registered with cmd_runas for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "spankall (sall)" registered with cmd_spankall for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "tempban (tb)" registered with cmd_tempban for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "unmask (None)" registered with cmd_unmask for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "aliases (alias)" registered with cmd_aliases for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "disable (None)" registered with cmd_disable for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "editgroup (None)" registered with cmd_editgroup for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "groups (None)" registered with cmd_groups for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "baninfo (bi)" registered with cmd_baninfo for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "kick (k)" registered with cmd_kick for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "clientinfo (None)" registered with cmd_clientinfo for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "restart (None)" registered with cmd_restart for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "spams (None)" registered with cmd_spams for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "scream (None)" registered with cmd_scream for level (40, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "newgroup (None)" registered with cmd_newgroup for level (90, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "poke (None)" registered with cmd_poke for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "die (None)" registered with cmd_die for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "register (None)" registered with cmd_register for level (0, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "mask (None)" registered with cmd_mask for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "say (None)" registered with cmd_say for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "unban (None)" registered with cmd_unban for level (60, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "help (h)" registered with cmd_help for level (0, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "reconfig (None)" registered with cmd_reconfig for level (100, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "admins (None)" registered with cmd_admins for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "warnremove (wr)" registered with cmd_warnremove for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "permban (pb)" registered with cmd_permban for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "time (None)" registered with cmd_time for level (1, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "clear (kiss)" registered with cmd_clear for level (80, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "spam (s)" registered with cmd_spam for level (20, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "spank (sp)" registered with cmd_spank for level (60, 100)
100310 01:34:58 DEBUG   SELECT * FROM groups WHERE `keyword` = "superadmin" LIMIT 1
100310 01:34:58 DEBUG   Storage: getClientsMatching {'&group_bits': 128}
100310 01:34:58 BOT     Starting Plugin forumlink
100310 01:34:58 DEBUG   Register Event: Client Authenticated: ForumlinkPlugin
100310 01:34:58 DEBUG   AdminPlugin: Command "linkaccounts (None)" registered with cmd_linkaccounts for level (1, 100)
100310 01:34:58 DEBUG   AdminPlugin: Command "newpms (None)" registered with cmd_newpms for level (1, 100)
100310 01:34:58 DEBUG   ForumlinkPlugin: Started
100310 01:34:58 BOT     Starting Plugin publist
100310 01:34:58 DEBUG   Set cvar _B3 = [B3 v1.2.1 [posix]]
100310 01:34:59 VERBOSE RCON sending (10.10.10.20:28960) set _B3 "B3 v1.2.1 [posix]"
100310 01:34:59 DEBUG   PublistPlugin: publist will send heartbeat at 15:21 every day
100310 01:34:59 VERBOSE Added crontab <bound method PublistPlugin.update of <b3.plugins.publist.PublistPlugin instance at 0xdb14cf8>> (230820176) - 0s 21m 15h -1d -1M -1DOW
100310 01:34:59 BOT     Start reading...
100310 01:34:59 DEBUG   PublistPlugin: Sending heartbeat to B3 master...
100310 01:35:00 DEBUG   PublistPlugin: Server list updated
100310 01:36:19 CONSOLE 1660:42 say;123456;4;myusername;!admins
100310 01:36:19 DEBUG   No client - attempt join
100310 01:36:19 VERBOSE 0 cid changed from None to 4
100310 01:36:19 DEBUG   Client Connected: [4] myusername -  ({'codguid': '123456'})
100310 01:36:19 VERBOSE Queueing event Say !admins
100310 01:36:19 VERBOSE Parsing Event: Say: AdminPlugin
100310 01:36:19 DEBUG   AdminPlugin: OnSay handle 5:"!admins"
100310 01:36:19 DEBUG   AdminPlugin: Handle command !admins
100310 01:36:19 VERBOSE RCON sending (10.10.10.20:28960) tell 4 ^0(^2b3^0)^7: ^3[pm]^7 ^7Please try your command after you have been authenticated
100310 01:36:24 VERBOSE RCON sending (10.10.10.20:28960) PB_SV_PList
100310 01:36:25 VERBOSE authorizeClients() = {4: {'slot': '5', 'status': 'OK', 'name': '^1[T^7x^4M]^7X-Man', 'power': '1', 'ss': '0', 'ip': '192.168.10.100', 'auth': '3.1', 'pbid': '111myguid111', 'guid': '111myguid111', 'os': 'W', 'port': '28960'}}
100310 01:36:25 DEBUG   Storage: getClient <b3.clients.Client object at 0xdc20f10>
100310 01:36:25 BOT     Client found in storage 2, welcome back myusername
100310 01:36:25 DEBUG   Storage: setClient <b3.clients.Client object at 0xdc20f10>
100310 01:36:25 DEBUG   Storage: setClient data {'time_add': 1267273712, 'time_edit': 1268206585, 'name': 'myusername', 'group_bits': 128, 'ip': '192.168.10.100', 'auto_login': 1, 'greeting': 'Hello!', 'pbid': '111myguid111', 'connections': 23, 'mask_level': 0, 'guid': '111myguid111', 'id': 2}
100310 01:36:25 DEBUG   Client Authorized: [4] myusername - 111myguid111
100310 01:36:25 VERBOSE Queueing event Client Authenticated <b3.clients.Client object at 0xdc20f10>
100310 01:36:25 VERBOSE Parsing Event: Client Authenticated: ForumlinkPlugin
100310 01:36:25 ERROR   handler ForumlinkPlugin could not handle event Client Authenticated: OperationalError: (1044, "Access denied for user 'forum'@'10.10.10.10' to database 'phpbb3'") [('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/parser.py', 711, 'handleEvents', 'hfunc.parseEvent(event)'), ('/usr/lib/python2.4/site-packages/b3-1.2.1-py2.4.egg/b3/plugin.py', 143, 'parseEvent', 'self.onEvent(event)'), ('/home/codgame/cod/b3/extplugins/forumlink.py', 157, 'onEvent', 'self.dbconnect()'), ('/home/codgame/cod/b3/extplugins/forumlink.py', 96, 'dbconnect', "self._db = MySQLdb.connect(self.config.get('db','host'),self.config.get('db','username'),self.config.get('db','password'),self.config.get('db','db'))"), ('/usr/lib64/python2.4/site-packages/MySQLdb/__init__.py', 75, 'Connect', 'return Connection(*args, **kwargs)'), ('/usr/lib64/python2.4/site-packages/MySQLdb/connections.py', 164, '__init__', 'super(Connection, self).__init__(*args, **kwargs2)')]


Thank you!

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: ForumLink
« Reply #33 on: March 10, 2010, 10:43:44 AM »
I'm confuse because when I download the forumlink plugin (v0.1.1b) I have no code on line 96  :-\

Do you use an old version or a custom version ?

Offline xavierk

  • Jr. Member
  • **
  • Posts: 16
Re: ForumLink
« Reply #34 on: March 10, 2010, 10:49:04 AM »
Sorry in trying to get it working, I consolidated a couple select lines that were wrapped...

96 in the error = line 100

Code: [Select]
      self._db = MySQLdb.connect(self.config.get('db','host'),self.config.get('db','username'),self.config.get('db','password'),self.config.get('db','db'))

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: ForumLink
« Reply #35 on: March 10, 2010, 11:44:19 AM »
you could add
Code: [Select]
self.debug(self.config.get('db','host'))
before your error

Offline xavierk

  • Jr. Member
  • **
  • Posts: 16
Re: ForumLink
« Reply #36 on: March 10, 2010, 10:54:08 PM »
you could add
Code: [Select]
self.debug(self.config.get('db','host'))
before your error

Done, it outputs the correct Mysql (webserver) IP there. 

I even changed the line to
Code: [Select]
self._db = MySQLdb.connect(host = "100.100.100.100",user  = self.config.get('db','username'),passwd = self.config.get('db','password'),db = self.config.get('db','db'))

and I still get the same error.  The problem seems to be more specific to MySQLdb.connect then to your code.

Offline xavierk

  • Jr. Member
  • **
  • Posts: 16
Re: ForumLink
« Reply #37 on: March 10, 2010, 11:33:09 PM »
Ok, figured it out that error... I think... even though the webserver had a grant ip for the game server.  Which was working for B3 itself.  I removed it and added it again, which seems to have fixed the problem.  Something funky must have happened in setting the permission.

Sorry about the confusion.


X

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #38 on: June 24, 2010, 02:25:54 PM »
Ive made a xfire command that works with the PHPBB3 forum
It shows you the players xfire if they have that field filled in, on there profile. You will need to add xfire to the custom fields in your forum in order to use this.

Code: [Select]
    def cmd_xfire(self, data, client, cmd=None):
      """\
      <name> - Shows a users xfire.
      """
      m = self._adminPlugin.parseUserCmd(data)
      if m:
          sclient = self._adminPlugin.findClientPrompt(m[0], client)

      if not sclient:
        return False

      self.dbconnect()
      cursor = self.query("""SELECT `pf_xfire`, `pf_b3id` FROM `phpbb_profile_fields_data` WHERE `pf_b3id` = '%s'""" % (sclient.id))
      if cursor.rowcount > 0:
         r = cursor.fetchone()
        
         if r[0] == '':
             cmd.sayLoudOrPM(client, '%s has not filled in that field.' % (sclient.exactName))
         else:
             cmd.sayLoudOrPM(client, '%s\'s Xfire is %s' % (sclient.exactName, (r[0])))
      else:
         cmd.sayLoudOrPM(client, 'This user has not linked their accounts'

(Grammar fail Spoon :D)
fixed the (sclient.exactName)) must of deleted the second")"
« Last Edit: June 25, 2010, 02:29:20 AM by Spoon »

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #39 on: March 22, 2011, 09:57:58 PM »
Change a user's group based on server group_bits

I've wrote a bit of code to doing something like this but it changes players B3 group based on there forum group.(This has been coded for the PHPBB forum Only!)

add this "self.changelvl(event.client)"
below "t.start()" in foumlink.py

add this to forumlink.py
Code: [Select]
    def changelvl(self, client):
      forumid = client.var(self,'forumid',0).value
      self.dbconnect()
      cursor = self.query("""SELECT `group_id` FROM `phpbb_users` WHERE `user_id` = '%s'""" % (forumid))
      if cursor.rowcount > 0:
         r = cursor.fetchone()

         id = r[0]
         
         if id == IDHERE:
            group = clients.Group(keyword='superadmin')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Administrator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='serveradmin')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Server Administrator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='smod')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Senior Moderator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='mod')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the Moderator group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='ehd')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the EHD Members group' % client.exactName)
            return False
         elif id == IDHERE:
            group = clients.Group(keyword='vip')
            group = self.console.storage.getGroup(group)

            if client.inGroup(group):
                self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
            else:
                client.setGroup(group)
                client.save()
                self.console.say('%s has been added to the VIP group' % client.exactName)
            return False
         elif id == IDHERE:
            if client.maxLevel >= 2:
               group = clients.Group(keyword='user')
               group = self.console.storage.getGroup(group)

               if client.inGroup(group):
                   self.debug(self._adminPlugin.getMessage('groups_already_in', client.exactName, group.name))
               else:
                   client.setGroup(group)
                   client.save()
                   client.message('You have been reset to User')
               return False
            else:
               return False
         else:
            return False

You will have to edit the ids and group keywords to work with your B3 and forum.

Offline JD1pinoy

  • Full Member
  • ***
  • Posts: 60
    • PDS=ManilaTactics=RAS
Re: ForumLink
« Reply #40 on: August 28, 2011, 01:12:02 PM »
Hi, Is this plugin still working?

I tried this but I got errors "Coudn't Process ..."

B3 log error:

Quote
110828 18:47:08   ERROR   'handler AdminPlugin could not handle event Say: ProgrammingError: (1146, "Table \'teamredt_b3tdm.forumlink_linkedusers\' doesn\'t exist") [(\'b3\\\\parser.pyo\', 961, \'handleEvents\', None), (\'b3\\\\plugin.pyo\', 157, \'parseEvent\', None), (\'b3\\\\plugin.pyo\', 175, \'onEvent\', None), (\'b3\\\\plugins\\\\admin.pyo\', 222, \'handle\', None), (\'b3\\\\plugins\\\\admin.pyo\', 367, \'OnSay\', None), (\'b3\\\\plugins\\\\admin.pyo\', 2009, \'execute\', None), (\'F:\\\\GAME_SERVERS\\\\BigBrotherBot\\\\extplugins\\\\forumlink.py\', 171, \'cmd_linkaccounts\', None), (\'b3\\\\storage.pyo\', 302, \'query\', None)]'

My question:

Where do I put the Forumlink SQL?
in the forum database or b3 database?

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #41 on: August 31, 2011, 12:30:40 PM »
in the b3 database

Offline JD1pinoy

  • Full Member
  • ***
  • Posts: 60
    • PDS=ManilaTactics=RAS
Re: ForumLink
« Reply #42 on: September 01, 2011, 08:13:25 AM »
Thanks for the reply Spoon

Quote
<configuration plugin="forumlink">
  <settings name="commands">
    <set name="linkaccounts">0</set>
    <set name="newpms">0</set>
  </settings>
  <settings name="settings">
<!-- This can be the field identification value in phpBB3, or in SMF2, the ID of the custom field. In phpBB2, it's the name of the extra column in the users table. -->
    <set name="fieldid">8</set>
  </settings>
  <settings name="db">
<!-- Choices: smf2, phpbb3, or phpbb2 (no caps in either) -->
    <set name="forumtype">smf2</set>
    <set name="host">myweburl.net</set>
    <set name="username">mydb_username</set>
    <set name="password">mydbpassword</set>
    <set name="db">mydb</set>
    <set name="prefix">smf_</set>
  </settings>
</configuration>

is this correct? or I am missing something here?

Thanks

Offline Spoon

  • Sr. Member
  • ****
  • Posts: 255
    • EHD Gaming
Re: ForumLink
« Reply #43 on: September 01, 2011, 04:14:07 PM »
<set name="fieldid">8</set>

should be somthing like b3id or b3_id its the name of the field on your forum.

Offline JD1pinoy

  • Full Member
  • ***
  • Posts: 60
    • PDS=ManilaTactics=RAS
Re: ForumLink
« Reply #44 on: September 01, 2011, 04:40:14 PM »
Spoon thank you very much for the assist... Working perfectly now with SMF2.  8)

 


Rate this page +1 at Google Search