Far funzionare Runuo RC2 sotto Windows Vista

Da Tomo della conoscenza - UOShards Wiki.

Jump to: navigation, search

RunUO RC2 non supporta il sistema operativo Windows Vista.
Gli aggiornamenti necessari si possono trovare nella SVN. ( chi non sa cosa sia, non si disperi e continui a leggere. )
In alternativa potete seguire quanto segue e rendere il vostro RunUO compatibile con Vista:

Andate in serverlist.cs linea 120 e sostituite in questa maniera :

	for ( int i = 0; i < ips.Length; ++i )
	{
		if ( ips[i].AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork( ips[i] ) )
			return true;
	}

linea 135

		if ( ip.AddressFamily == AddressFamily.InterNetworkV6 )
			return false;

ecco le funzioni complete:

		private static bool HasPublicIPAddress()
		{
			IPHostEntry iphe = Dns.GetHostEntry( Dns.GetHostName() );

			IPAddress[] ips = iphe.AddressList;

			for ( int i = 0; i < ips.Length; ++i )
			{
				if ( ips[i].AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork( ips[i] ) )
					return true;
			}

			return false;
		}

		private static bool IsPrivateNetwork( IPAddress ip )
		{
			// 10.0.0.0/8
			// 172.16.0.0/12
			// 192.168.0.0/16

			if ( ip.AddressFamily == AddressFamily.InterNetworkV6 )
				return false;

			if ( Utility.IPMatch( "192.168.*", ip ) )
				return true;
			else if ( Utility.IPMatch( "10.*", ip ) )
				return true;
			else if ( Utility.IPMatch( "172.16-31.*", ip ) )
				return true;
			else
				return false;
		}

NB:queste modifiche sono necessarie per chi usa Vista e non ha ip fisso(l'alternativa è dover cambiare ogni volta la stringa "Address")

Personal tools