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: Location Plugin  (Read 10437 times)

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Location Plugin
« on: November 05, 2013, 05:37:39 PM »
Description

A BigBrotherBot plugin which introduces some new commands useful to display clients geolocation information. The plugin can also be enabled to display a geowelcome message when a new player connects to the server.

Installation

Installation instructions and download link can be found on the Github repository: https://github.com/danielepantaleone/b3-plugin-location
« Last Edit: March 19, 2015, 03:06:26 PM by Fenix »

Offline U.F.O.

  • Newbie
  • *
  • Posts: 2
Re: Location Plugin
« Reply #1 on: November 28, 2013, 02:00:55 PM »
Hi Fenix, I put plugin on my server but only shows the same server location for all connected clients :( any solution? I use chiv server, thanks

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Re: Location Plugin
« Reply #2 on: November 28, 2013, 08:43:53 PM »
Can you set your b3 log to VERBOSE (9) and post the log here pls? (mask your password first)

Offline U.F.O.

  • Newbie
  • *
  • Posts: 2
Re: Location Plugin
« Reply #3 on: November 29, 2013, 01:52:35 AM »
Hi Fenix, here is, running b3, connected player and type !locate:

in XXX.XXX.XXX.XXX client ip, appears public server ip, i guess that is the issue, many thanks ;)

Code: [Select]
131128 22:22:26	BOT    	'Loading Plugin #13 location [C:\\BigBrotherBot\\extplugins\\conf\\location.xml]'
131128 22:22:26 INFO 'location is not a built-in plugin (No module named location)'
131128 22:22:26 INFO 'trying external plugin directory : C:\\BigBrotherBot\\extplugins'
131128 22:22:26 BOT     'LocationPlugin: Loading config C:\\BigBrotherBot\\extplugins\\conf\\location.xml for LocationPlugin'
131128 22:22:26 DEBUG 'Register Event: Stop Process: LocationPlugin'
131128 22:22:26 DEBUG 'Register Event: Program Exit: LocationPlugin'
131128 22:22:26 BOT     'Plugin location (1.3.4 - Fenix - http://www.urbanterror.info) loaded'
131128 22:22:26 BOT     'Loading Plugin publist'
131128 22:22:26 BOT     'PublistPlugin: No config file found for PublistPlugin. (was not required either)'
131128 22:22:26 DEBUG 'Register Event: Stop Process: PublistPlugin'
131128 22:22:26 DEBUG 'Register Event: Program Exit: PublistPlugin'
131128 22:22:26 BOT     'Plugin publist (1.10.2 - ThorN, Courgette) loaded'
131128 22:22:26 DEBUG 'creating the event queue with size 50'
131128 22:22:26 BOT     'Starting parser'
131128 22:22:27 VERBOSE 'SpreePlugin: spree-messages are loaded in memory'
131128 22:22:27 DEBUG 'LocationPlugin: loaded announce setting: True'
131128 22:22:27 DEBUG 'LocationPlugin: loaded verbose setting: True'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (locate): ^7%(client)s ^3is connected from ^7%(country)s'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (distance): ^7%(client)s ^3is ^7%(distance).2f ^3km away from you'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (locate_city): ^7%(client)s ^3is connected from ^7%(city)s ^3(^7%(country)s^3)'
131128 22:22:27 DEBUG "LocationPlugin: loaded message (distance_self): ^7Sorry, I'm not that smart...meh!"
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (connect_city): ^7%(client)s ^3from ^7%(city)s ^3(^7%(country)s^3) connected'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (distance_failed): ^7Could not compute distance with ^1%(client)s'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (connect): ^7%(client)s ^3from ^7%(country)s ^3connected'
131128 22:22:27 DEBUG 'LocationPlugin: loaded message (locate_failed): ^7Could not locate ^1%(client)s'
131128 22:29:01 DEBUG "Storage: setClient data {'time_add': 1384037110, 'password': u'', 'time_edit': 1385674141, 'name': u'\\u2563vG\\u2560 \\xdf\\u03b1\\u0161\\u2020\\xef\\u2295\\u0438', 'group_bits': 1, 'ip': '', 'auto_login': 1, 'greeting': u'', 'pbid': u'', 'connections': 18, 'mask_level': 0, 'login': u'', 'guid': '76561198090031324', 'id': 37}"
131128 22:29:01 DEBUG u'Client Authorized: [\u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438] \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438 - 76561198090031324'
131128 22:29:01 VERBOSE u'Queueing event Client Authenticated Client<@37:76561198090031324|:"\u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438":\u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438>'
131128 22:29:01 VERBOSE 'Queueing event Client Join Team None'
131128 22:29:02 DEBUG u"LocationPlugin: retrieved location data for \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438: {u'status': u'success', u'city': u'Madrid', u'zip': u'', u'countryCode': u'ES', u'country': u'Spain', u'region': u'29', u'isp': u'Telefonica de Espana', u'lon': u'-3.6922', u'as': u'AS3352 TELEFONICA DE ESPANA', u'query': u'XXX.XXX.XXX.XXX', u'org': u'Telefonica de Espana', u'lat': u'40.4086', u'timezone': u'Europe/Madrid', u'regionName': u'Madrid'}"
131128 22:29:02 VERBOSE 'Parsing Event: Client Authenticated: WelcomePlugin'
131128 22:29:02 VERBOSE 'Parsing Event: Client Authenticated: CtimePlugin'
131128 22:29:02 DEBUG u'CtimePlugin: CTIME CONNECTED: Player \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438^7 started playing at: 2013-11-28 22:29:02.205000'
131128 22:29:02 VERBOSE 'Parsing Event: Client Join Team: XlrstatscontrollerPlugin'
131128 22:29:02 DEBUG 'XlrstatscontrollerPlugin: Checking number of players online. Minimum = 3, Current = 1'
131128 22:29:02 DEBUG 'XlrstatscontrollerPlugin: Nothing to do at the moment. XLRstats is already Disabled'
131128 22:29:32 DEBUG 'formatting time with timezone [CET], tzOffset : 3600'
131128 22:29:32 DEBUG 'WelcomePlugin: LastVisit: 04:38PM CET 28/11/13'
131128 22:29:32 DEBUG 'formatting time with timezone [CET], tzOffset : 3600'
131128 22:30:00 VERBOSE 'FirstkillPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:30:00 VERBOSE 'StatsPlugin Game Round Start : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:30:00 VERBOSE 'TkPlugin Game Round Start : (ms) min(0.2), max(0.2), mean(0.2), stddev(0.0)'
131128 22:30:00 VERBOSE 'CtimePlugin Client Authenticated : (ms) min(0.7), max(0.7), mean(0.7), stddev(0.0)'
131128 22:30:00 VERBOSE 'WelcomePlugin Client Authenticated : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:30:00 VERBOSE 'XlrstatsPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:30:00 VERBOSE 'LocationPlugin Client Connect : (ms) min(211.4), max(211.4), mean(211.4), stddev(0.0)'
131128 22:30:00 VERBOSE 'XlrstatscontrollerPlugin Client Join Team : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:30:00 VERBOSE 'XlrstatscontrollerPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:30:00 DEBUG 'Events waiting in queue stats : (ms) min(0.0), max(1000.0), mean(500.0), stddev(577.4)'
131128 22:30:08 VERBOSE u'Queueing event Say LOL'
131128 22:30:08 VERBOSE 'Parsing Event: Say: AdminPlugin'
131128 22:30:08 DEBUG u'AdminPlugin: OnSay handle 5:"LOL"'
131128 22:30:08 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
131128 22:30:08 VERBOSE u'ChatloggerPlugin: ALL, 37, \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438, LOL'
131128 22:30:08 DEBUG 'ChatloggerPlugin: rowcount: 1, id:21239'
131128 22:30:30 VERBOSE u'Queueing event Say !locate vg'
131128 22:30:30 VERBOSE 'Parsing Event: Say: AdminPlugin'
131128 22:30:30 DEBUG u'AdminPlugin: OnSay handle 5:"!locate vg"'
131128 22:30:30 DEBUG u'AdminPlugin: Handle command !locate vg'
131128 22:30:30 VERBOSE "Queueing event Admin Command (Command<locate>, u'vg', None)"
131128 22:30:30 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
131128 22:30:30 VERBOSE u'ChatloggerPlugin: ALL, 37, \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438, !locate vg'
131128 22:30:30 DEBUG 'ChatloggerPlugin: rowcount: 1, id:21240'
131128 22:30:30 VERBOSE 'Parsing Event: Admin Command: ChatloggerPlugin'
131128 22:30:30 VERBOSE u'ChatloggerPlugin: 37, \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438, Command<locate>, vg, None'
131128 22:30:30 DEBUG 'ChatloggerPlugin: rowcount: 1, id:1397'
131128 22:30:41 VERBOSE u'Queueing event Say xd'
131128 22:30:41 VERBOSE 'Parsing Event: Say: AdminPlugin'
131128 22:30:41 DEBUG u'AdminPlugin: OnSay handle 5:"xd"'
131128 22:30:41 VERBOSE 'Parsing Event: Say: ChatloggerPlugin'
131128 22:30:41 VERBOSE u'ChatloggerPlugin: ALL, 37, \u2563vG\u2560 \xdf\u03b1\u0161\u2020\xef\u2295\u0438, xd'
131128 22:30:41 DEBUG 'ChatloggerPlugin: rowcount: 1, id:21241'
131128 22:31:00 VERBOSE 'FirstkillPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:31:00 VERBOSE 'StatsPlugin Game Round Start : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:31:00 VERBOSE 'TkPlugin Game Round Start : (ms) min(0.2), max(0.2), mean(0.2), stddev(0.0)'
131128 22:31:00 VERBOSE 'CtimePlugin Client Authenticated : (ms) min(0.7), max(0.7), mean(0.7), stddev(0.0)'
131128 22:31:00 VERBOSE 'AdminPlugin Say : (ms) min(0.7), max(1.7), mean(1.0), stddev(0.6)'
131128 22:31:00 VERBOSE 'WelcomePlugin Client Authenticated : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:31:00 VERBOSE 'XlrstatsPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:31:00 VERBOSE 'ChatloggerPlugin Say : (ms) min(0.8), max(0.9), mean(0.8), stddev(0.0)'
131128 22:31:00 VERBOSE 'ChatloggerPlugin Admin Command : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:31:00 VERBOSE 'LocationPlugin Client Connect : (ms) min(211.4), max(211.4), mean(211.4), stddev(0.0)'
131128 22:31:00 VERBOSE 'XlrstatscontrollerPlugin Client Join Team : (ms) min(0.8), max(0.8), mean(0.8), stddev(0.0)'
131128 22:31:00 VERBOSE 'XlrstatscontrollerPlugin Game Round Start : (ms) min(0.9), max(0.9), mean(0.9), stddev(0.0)'
131128 22:31:00 DEBUG 'Events waiting in queue stats : (ms) min(0.0), max(1000.0), mean(250.0), stddev(462.9)'

« Last Edit: November 29, 2013, 02:01:18 AM by U.F.O. »

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Re: Location Plugin
« Reply #4 on: November 29, 2013, 11:27:29 AM »
I just did a test myself and works perfectly fine:

Code: [Select]
131129 11:18:43	DEBUG	'LocationPlugin: contacting http://ip-api.com to retrieve location data for valter)))...'
131129 11:18:43 DEBUG "LocationPlugin: retrieved location data for valter))): {u'status': u'success', u'city': u'Chernogolovka', u'zip': u'', u'countryCode': u'RU', u'country': u'Russian Federation', u'region': u'47', u'isp': u'ArtX CJSC', u'lon': u'38.3667', u'as': u'AS20985 ArtX CJSC', u'query': u'X.X.X.X', u'org': u'ArtX CJSC', u'lat': u'56', u'timezone': u'Europe/Moscow', u'regionName': u'Moskva'}"
131129 11:18:47 DEBUG 'LocationPlugin: contacting http://ip-api.com to retrieve location data for [Gore]Dr.Kyle...'
131129 11:18:47 DEBUG "LocationPlugin: retrieved location data for [Gore]Dr.Kyle: {u'status': u'success', u'city': u'Gloucester', u'zip': u'', u'countryCode': u'GB', u'country': u'United Kingdom', u'region': u'E6', u'isp': u'Sky Broadband', u'lon': u'-2.25', u'as': u'AS5607 British Sky Broadcasting Limited', u'query': u'X.X.X.X', u'org': u'Sky Broadband', u'lat': u'51.8333', u'timezone': u'Europe/London', u'regionName': u'Gloucestershire'}"

As you can see players have different information retrieved from the API. In your b3 log there is just 1 player highlighted. Can you post a log after using !locate multiple times on different players?

Offline Canta

  • Jr. Member
  • **
  • Posts: 15
Re: Location Plugin
« Reply #5 on: January 25, 2014, 05:24:15 PM »
hello does not work for me. cod4
error:

Code: [Select]
140125 17:18:53	DEBUG	'AdminPlugin: Command "locate (None)" registered with cmd_locate for level (1, 100)'
140125 17:18:53 DEBUG 'AdminPlugin: Command "distance (None)" registered with cmd_distance for level (1, 100)'
140125 17:18:53 ERROR 'Could not start plugin location'
Traceback (most recent call last):
  File "D:\sistema\Escritorio\b3_s\b3-1.9.1\b3\parser.py", line 789, in startPlugins
    start_plugin(plugin_name)
  File "D:\sistema\Escritorio\b3_s\b3-1.9.1\b3\parser.py", line 772, in start_plugin
    p.onStartup()
  File "D:\sistema\Escritorio\b3_s\b3-1.9.1\b3\extplugins\location.py", line 103, in onStartup
    self.registerEvent(b3.events.EVT_CLIENT_CONNECT, self.onConnect)
TypeError: registerEvent() takes exactly 2 arguments (3 given)
« Last Edit: January 25, 2014, 05:29:55 PM by Canta »

Offline Courgette

  • Senior Dev.
  • Hero Member
  • *
  • Posts: 4882
    • Github repository
Re: Location Plugin
« Reply #6 on: January 25, 2014, 06:55:58 PM »
since v1.5 this plugin requires B3 v1.10.

You can either install the latest B3 v1.10 or use v1.4 of the location plugin

Offline Canta

  • Jr. Member
  • **
  • Posts: 15
Re: Location Plugin
« Reply #7 on: January 26, 2014, 12:42:57 AM »
Ok, thanks Courgette

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Re: Location Plugin
« Reply #8 on: January 26, 2014, 01:03:56 AM »
Indeed I forgot to update the readme  ;D ;D ;D ;D My bad

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Re: Location Plugin
« Reply #9 on: March 18, 2014, 01:47:26 PM »
Plugin updated to version 1.9: https://github.com/FenixXx/b3-plugin-location/releases/tag/1.9
I added backward compatibility with b3 version < 1.10dev since many people requested it.

Offline 4ft3rM4tH

  • Jr. Member
  • **
  • Posts: 15
Re: Location Plugin
« Reply #10 on: March 18, 2014, 08:34:55 PM »
Hello there.

Working like charm now.

Just a couple of questions:

-What i must do if i dont want to see the city and just the country?
(Removing the text from the line on config arhive maybe?)

-Since i cant send PM and i dont know why can you tell me something about this?:

http://forum.bigbrotherbot.net/general-usage-support/remove-%27console%27-in-front-of-every-message/msg43469/#lastPost

I want to make it in our server too but i dont know how.

Thanks in advance.
Cheers.

Offline Fenix

  • Dev. Team
  • Hero Member
  • *
  • Posts: 984
    • GitHub
Re: Location Plugin
« Reply #11 on: March 18, 2014, 08:52:26 PM »
What i must do if i dont want to see the city and just the country?
In the configuration file there is a configuration value verbose = yes: change it to verbose: no

About the second question: it's not something b3 can do. You need to check if you can customize (and thus remove) such prefix from your server engine configuration file. In Urban Terror we have 2 CVARs to control the prefix: sv_sayprefix and sv_tellprefix. Maybe there is something like that in MW3 too but I can't tell since I have never played such game nor I own a server

Offline 4ft3rM4tH

  • Jr. Member
  • **
  • Posts: 15
Re: Location Plugin
« Reply #12 on: March 19, 2014, 12:49:40 AM »
In the configuration file there is a configuration value verbose = yes: change it to verbose: no

About the second question: it's not something b3 can do. You need to check if you can customize (and thus remove) such prefix from your server engine configuration file. In Urban Terror we have 2 CVARs to control the prefix: sv_sayprefix and sv_tellprefix. Maybe there is something like that in MW3 too but I can't tell since I have never played such game nor I own a server

Okey fine i just had changed it.

I try the other thing like this:

Code: [Select]
seta sv_tellprefix 0
seta sv_sayfrefix 0

But it doesnt work maybe i must have the right CVARs but i dont know how or where, i have what is supose to be a full CVARs list but i can see nothing related to it.

And i know its possible because there some scripts who run with other tools who can do it.
So ill keep searching thanks for your plugin and for your help.
Cheers.

Offline Gamer0069

  • Jr. Member
  • **
  • Posts: 23
Re: Location Plugin
« Reply #13 on: August 25, 2014, 08:48:37 PM »
Can you please also add Region in this plugin
thanks  :)

Offline Gamer69

  • Jr. Member
  • **
  • Posts: 26
GeoIP welcome plugin
« Reply #14 on: March 12, 2015, 08:27:27 AM »
Thanks for making the Location plugin. It rocks. But can this plugin also be used as a welcome plugin by a little modification? It can ;D  Because you have the intelligence to do it brother.

When someone joins the server it will say this message and everybody could see it

Welcome Player <Playername> From <Country> <State/Province> <City>

By using this site http://www.ipinfodb.com/

This will be very cool......please help. :(
« Last Edit: March 12, 2015, 09:09:48 AM by Gamer69 »

 


Rate this page +1 at Google Search

anything