Author Topic: GeoIP by Falcon  (Read 2584 times)

0 Members and 1 Guest are viewing this topic.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
GeoIP by Falcon
« on: March 14, 2011, 02:52:07 am »
Name: GeoIP

Author: Falcon` (with my minor additions)
Script version: 1.0
Server version: 2.6.5
Release Date: 14.03.2011
Compile Test: Passed
Description:
Now you can easily check from which country a player is connected :)

Commands:
 * /locate X - shows where X is (X = ID or nickname part)
 * /locateall - shows everyone's location

Requirements:
 * Make sure you got database (HexGeoIP.dat) in your root soldatserver folder

Uses:
 * Explode function by DorkeyDear, CurryWurst
 * GeoIP API

---
If you're interested in raw GeoIP functions, not the script, check attachments or Click
---

---
Code: {snippets}
Code: [Select]
(...)
Procedure PlayerToCountry(ID: byte; Who: string);
var
foundid: byte;
begin
foundid := StrToId(Who);
if foundid = 254 then
WriteMessage(ID,'Player not found ('+Who+')',Red)
else
WriteMessage(ID,IdToName(foundid)+' is connected from: '+CountryNames[player[foundid].country],Violet);
end;

// Default Events

Procedure ActivateServer();
begin
InitializeGeoIP;
end;

function OnPlayerCommand(ID: Byte; Text: string): boolean;
var
i: byte;
begin
Result := FALSE;
case LowerCase(GetPiece(Text,' ', 0)) of
'/locate': PlayerToCountry(ID,Copy(Text,9,Length(Text)))
'/locateall': for i:=1 to 32 do
if not(IdToName(i)='') then
WriteConsole(ID,'['+CountryCodes[player[i].country]+']   '+IdToName(i),Violet);
end;
end;

(...)

Questions? Bugs? Report please --> macekmil@gmail.com
« Last Edit: March 14, 2011, 08:07:23 am by Mighty »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: GeoIP by Falcon
« Reply #1 on: March 14, 2011, 04:29:26 am »
i asked you to publish this as you're also part of the project. I did the functions, you did the script. That's something, isn't it?
« Last Edit: March 14, 2011, 07:32:36 am by FalconPL »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: GeoIP by Falcon
« Reply #2 on: March 15, 2011, 02:55:43 pm »
An evil player may crash a server using this script for lulz.

Offline KoGAi

  • Major(1)
  • Posts: 32
  • The Light of the Universe
Re: GeoIP by Falcon
« Reply #3 on: December 28, 2013, 05:18:54 pm »
Is there an updated IP DB for this?
=₳US7RAL|¹² is a growing Soldat Community making a difference by offering a wide variety of top-notch servers across North America- a new alternative to everyone.
Jump into our servers in NA with the new domain (austral12.com)! Check our Facebook Page.
_______
#austral12soldat @ QuakeNet ▲ facebook.com/AUS7RAL12 ▲ twitter.com/AUS7RAL12

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: GeoIP by Falcon
« Reply #4 on: December 29, 2013, 01:36:15 pm »
Attached zip containing converter (for linux, untested), it's source code, and newest GeoIP.dat converted (untested).

Short manual: Put GeoIP.dat in the same dir as converter (if it's GeoIP.dat.gz then first unpack it) and it should produce HexGeoIP.dat required by the script.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline KoGAi

  • Major(1)
  • Posts: 32
  • The Light of the Universe
Re: GeoIP by Falcon
« Reply #5 on: December 29, 2013, 08:28:34 pm »
Thanks a lot, man. I'll give it a shot. :)
=₳US7RAL|¹² is a growing Soldat Community making a difference by offering a wide variety of top-notch servers across North America- a new alternative to everyone.
Jump into our servers in NA with the new domain (austral12.com)! Check our Facebook Page.
_______
#austral12soldat @ QuakeNet ▲ facebook.com/AUS7RAL12 ▲ twitter.com/AUS7RAL12