Raised This Month: $51 Target: $400
 12% 

GeoIPCity


Post New Thread Reply   
 
Thread Tools Display Modes
Darkthrone
Senior Member
Join Date: Jun 2009
Old 07-18-2010 , 12:09   Re: [EXTENSION] GeoIPCity
Reply With Quote #31

Quote:
Originally Posted by GoD-Tony View Post
If you are using the sample plugin, then you need to edit the cannounce_messages.txt file in your sourcemod/data/ folder. Insert the {PLAYERCITY} tag in there.
you mean cannounce_settings.txt
__________________
all the best for your Zombie:Reloaded server
Auto !zspawn | ZProp | Infinite Ammo | Anti-Doorblock

Darkthrone is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 07-18-2010 , 16:07   Re: [EXTENSION] GeoIPCity
Reply With Quote #32

Quote:
Originally Posted by Darkthrone View Post
you mean cannounce_settings.txt
Yes! Thank you Darkthrone. I don't know how you stay on top of everyones posts like this. You're one of the greats
GoD-Tony is offline
Darkthrone
Senior Member
Join Date: Jun 2009
Old 07-19-2010 , 23:51   Re: [EXTENSION] GeoIPCity
Reply With Quote #33

i'm not so great as you, because i do not have written such a great extension
for me this extension is more usefull than geocity inc, because it allows to easily update geolitecity database
__________________
all the best for your Zombie:Reloaded server
Auto !zspawn | ZProp | Infinite Ammo | Anti-Doorblock

Darkthrone is offline
supergreg
Senior Member
Join Date: Jul 2007
Location: Oslo, Norway
Old 02-09-2011 , 00:43   Re: [EXTENSION] GeoIPCity
Reply With Quote #34

Hey and thanks for a useful extension. I like how it trades a bit extra memory for huge speed improvements. I tried to add this to a L4D2-server now, and it seems to work fine, I see messages in server console regarding both GeoIP and GeoIPCity. My problem is that neither {PLAYERREGION} nor {PLAYERCITY} yields any output. My question is what do I check, where do I start debugging?

from cannounce_settings.txt, admins block:
"playerjoin" "{GREEN}{PLAYERNAME} {DEFAULT}({LIGHTGREEN}{PLAYERTYPE}{DEFAULT}) connected from {GREEN}{PLAYERCOUNTRY} {DEFAULT}({LIGHTGREEN}{PLAYERCITY}-{PLAYERREGION}{DEFAULT})"

This gives a line like this: "... from France (-)"

Any hints appreciated. Thanks.
supergreg is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 02-09-2011 , 02:09   Re: [EXTENSION] GeoIPCity
Reply With Quote #35

For some players (IP addresses) it will not return a result for the city or region because it's simply not in the database. Try testing it with other players joining the server to see if shows the city.

You can also try the !geolist command to confirm this.
GoD-Tony is offline
supergreg
Senior Member
Join Date: Jul 2007
Location: Oslo, Norway
Old 02-11-2011 , 00:36   Re: [EXTENSION] GeoIPCity
Reply With Quote #36

Thanks for the prompt reply! Having tested some more, I see it works fine as you describe. I'm just nitpicking here, I find it a bit annoying that the symbols I've created around the city+region are left without content, would prefer to be able to remove those as well... maybe an IFCITY and IFREGION.. so if no city found, remove the entire content of IFCITY:
{IFCITY}{DEFAULT}({GREEN}{PLAYERCITY}{DEFAULT }){/IFCITY}

I might edit the .sp myself to do what I want, I just wanted to air the opinion in case you'd like to take on the challenge.
supergreg is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 02-11-2011 , 04:29   Re: [EXTENSION] GeoIPCity
Reply With Quote #37

This would be something you could add in yourself. The modified plugin that I posted is only there as an example for the extension.
GoD-Tony is offline
sipster19
Senior Member
Join Date: Mar 2011
Old 08-28-2011 , 08:30   Re: [EXTENSION] GeoIPCity
Reply With Quote #38

I made a few changes to this plugin. If you have {PLAYERCITY}, {PLAYERCOUNTRY} or {PLAYERREGION}, {PLAYERCOUNTRY} in cannounce_messages and the player's city or region can't be found, it will print:

Code:
Player has connected from , USA.
I made it so it removed the space and the comma and just leaves the country.

Code:
Player has connected from USA.

Last edited by psychonic; 08-28-2011 at 11:41.
sipster19 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-28-2011 , 11:41   Re: [EXTENSION] GeoIPCity
Reply With Quote #39

Quote:
Originally Posted by sipster19 View Post
I made a few changes to this plugin. If you have {PLAYERCITY}, {PLAYERCOUNTRY} or {PLAYERREGION}, {PLAYERCOUNTRY} in cannounce_messages and the player's city or region can't be found, it will print:

Code:
Player has connected from , USA.
I made it so it removed the space and the comma and just leaves the country.

Code:
Player has connected from USA.
Please do not post plugins without the matching source code.
psychonic is offline
sipster19
Senior Member
Join Date: Mar 2011
Old 08-28-2011 , 16:24   Re: [EXTENSION] GeoIPCity
Reply With Quote #40

Fair enough.

Changes

if (StrContains(rawmsg, "{PLAYERCITY}") != -1 )
{
ReplaceString(rawmsg, sizeof(rawmsg), "{PLAYERCITY}", city);

if ( StrEqual(city, "") )
{
//strip comma
ReplaceString(rawmsg, sizeof(rawmsg), ", ", "");
}
}

if (StrContains(rawmsg, "{PLAYERREGION}") != -1 )
{
ReplaceString(rawmsg, sizeof(rawmsg), "{PLAYERREGION}", region);

if ( StrEqual(region, "") )
{
//strip comma
ReplaceString(rawmsg, sizeof(rawmsg), ", ", "");
}
}

Carriage returns - http://forums.alliedmods.net/showthr...61#post1542261

Note - You must download GeoIPCity and place the header file in your includes file when you compile it.
Attached Files
File Type: zip connect_announce_mod.zip (16.1 KB, 242 views)

Last edited by sipster19; 09-03-2011 at 21:38.
sipster19 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:31.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode