You are an unregistered user, you can register here
Navigation

Information

Site

Donations
If you wish to make a donation you can by clicking the image below.


 
Go Back   The Unreal Admins Page > Forums > Unreal Admins > Unreal Tournament > UT Server - General Chat

Reply
Thread Tools Display Modes
  #1  
Unread 8th March, 2011, 05:42 PM
}IN{Banny }IN{Banny is offline
Forum Newcomer
 
Join Date: Feb 2011
Posts: 12
Default Iptocountry Problem - RUSH read this!

This is a main problem in all iptocountrys that the LOCAL IP is never recognized. I always have to set my country in the iptocountry.ini etc. Any 1 can code a lil bit to make it recognizable for LAN IP's too?
Reply With Quote
  #2  
Unread 8th March, 2011, 07:14 PM
SoNY_scarface SoNY_scarface is offline
Holy Shit!!
 
Join Date: Mar 2007
Posts: 1,726
Default

Local IP's are just that, local IP addresses. They cannot be traced to a country.
__________________




Reply With Quote
  #3  
Unread 8th March, 2011, 09:39 PM
Wormbo's Avatar
Wormbo Wormbo is offline
out of order
 
Join Date: Sep 2003
Posts: 3,383
Default

But you could code in a default country for local IPs.
__________________
Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives
Quote:
<@Mych|Lockdown> ...and the award for the most creative spelling of "Jailbreak" goes to ... "Gandis Jealbrake Server"
Reply With Quote
  #4  
Unread 8th March, 2011, 10:40 PM
back4more's Avatar
back4more back4more is offline
Holy Shit!!
 
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
Default

I forget how to do this but it's a change somewhere , where you configure localhost to a country. I have done this before just can't remember how .. sure I posted it somewhere here a while back.

one of the .php files I think or an .ini can't remember sorry.

vaguely remember a change being made in getstats.php?

Code:
			// Get player info.
			$query = "select name, country from uts_pinfo where id = $player_id limit 1";
			$result2 = mysql_query($query);
			$r2 = mysql_fetch_array($result2);
			$player_name = $r2['name'];
			$player_country = $r2['country'];
			mysql_free_result($result2);
			if (substr($player_name, -1) == '\\') {
				$player_name .= ' ';
			}
^_^ section where you add in an if statement like ;

if $r2 = "xx" then $r2="your_country_code";

something like this anyways.

then someone from another country not defined by the std 99 in the countries.php file and they also appear to be from your country as well hehe.

Last edited by back4more : 8th March, 2011 at 11:10 PM.
Reply With Quote
  #5  
Unread 8th March, 2011, 11:38 PM
rork's Avatar
rork rork is offline
Godlike
 
Join Date: Nov 2007
Posts: 265
Default

That should be

Code:
if($r2['country'] == 'xx') {
  $r2['country'] = 'nl';
}
But that would set a default country for every unknown country, not just the local network.

I don't know about the database being used (I've seen a few different implementations) but you should be able to add a record for your LAN ip-range.
__________________
Admin of XOL DOG CTF Fun server: 81.169.188.18 - Stats & dU Coop: 85.14.203.180:5555 - Forum
Reply With Quote
  #6  
Unread 8th March, 2011, 11:55 PM
back4more's Avatar
back4more back4more is offline
Holy Shit!!
 
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
Default

^_^ hehe and I think rork was the one that helped me last time with the same code in fact .

that will work.



Thanks rork .

maybe adding a little bit of code to the getstats.php or other.php that can allow for a custom variable for users to set their own country codes .

I remember i used to try changing my flag's / countries to others. but there was a range that did not work quite right gn,gl or something like this.
Reply With Quote
  #7  
Unread 9th March, 2011, 12:00 AM
back4more's Avatar
back4more back4more is offline
Holy Shit!!
 
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
Default

ok here's a thought;

edit countries.php;

and add this line after the following;

Code:
'xx' => 'Unknown country',
'00' => 'Lan'
then in the getstats.php;

if($r2['country'] == '00') {
$r2['country'] = 'nl';
}

might be the way to go...

*and then i re-read the Question and discover that he is asking about iptocountry not utstats DOH!

Last edited by back4more : 9th March, 2011 at 04:39 AM.
Reply With Quote
  #8  
Unread 10th March, 2011, 09:43 AM
Rush's Avatar
Rush Rush is offline
Holy Shit!!
 
Join Date: Apr 2003
Location: Texas
Posts: 1,157
Default

Other people are maintaining IpToCountry now. Resolving localhost IP to country doesn't make any sense, however an external PHP script could find out a real IP of the connection and return country for it.
__________________
[email address]
Reply With Quote
  #9  
Unread 10th March, 2011, 03:22 PM
back4more's Avatar
back4more back4more is offline
Holy Shit!!
 
Join Date: Oct 2008
Location: NextDoor
Posts: 1,908
Default

its just for the little flaggy to show up for the lan / users in the hud probably
Reply With Quote
  #10  
Unread 10th March, 2011, 03:25 PM
Sp0ngeb0b's Avatar
Sp0ngeb0b Sp0ngeb0b is offline
Godlike
 
Join Date: Sep 2008
Location: Germany
Posts: 488
Default

Add the local IP in the IpToCountry.ini and the flag appears. Done. Highly doubt that putting more work into this is useful ..
e.g.:
Code:
IPData[0]=your.local.ip:your.local.ip:GERMANY:DEU:de

Last edited by Sp0ngeb0b : 10th March, 2011 at 03:28 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:51 AM.


 

All pages are copyright The Unreal Admins Page.
You may not copy any pages without our express permission.