RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Port-Forwarding, Server-Access, yet again.

Grimmy

Sorceror
It has been a while since I've run a server from home, and I'm having some troubles. I'm aware there's a post below regarding the same thing, but as this tends to be hardware specific, It wasn't much help.

Here's what I've done:
  • Forwarded ports 2000-3100 UDP/TCP (the ones I use for uo and centred)
  • Demilitarized my local IP
  • Set my local IP to static
  • Removed the Firewalls from both the router and my windows
The strange thing is, the Server is listening at a different IP than whatsmyip.org shows..

Any ideas?

The only thing I can think of is that my ISP has some sort of firewall in the modem (xfinity) but it's the middle of the night and I can't call right now.
 

Grimmy

Sorceror
I'm not sure what you're suggesting is wrong. I've already set my port and IP address in both files.

Code:
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using Server;
using Server.Misc;
using Server.Network;
 
namespace Server
{
    public class SocketOptions
    {
        private const bool NagleEnabled = false; // Should the Nagle algorithm be enabled? This may reduce performance
        private const int CoalesceBufferSize = 512; // MSS that the core will use when buffering packets
 
        private static IPEndPoint[] m_ListenerEndPoints = new IPEndPoint[]
            {
                new IPEndPoint( IPAddress.Any, 3000 ), // Default: Listen on port 2593 on all IP addresses
           
                // Examples:
                // new IPEndPoint( IPAddress.Any, 80 ), // Listen on port 80 on all IP addresses
                // new IPEndPoint( IPAddress.Parse( "1.2.3.4" ), 2593 ), // Listen on port 2593 on IP address 1.2.3.4
            };
 
        public static void Initialize()
        {
            SendQueue.CoalesceBufferSize = CoalesceBufferSize;
 
            EventSink.SocketConnect += new SocketConnectEventHandler( EventSink_SocketConnect );
 
            Listener.EndPoints = m_ListenerEndPoints;
        }
 
        private static void EventSink_SocketConnect( SocketConnectEventArgs e )
        {
            if( !e.AllowConnection )
                return;
 
            if( !NagleEnabled )
                e.Socket.SetSocketOption( SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1 ); // RunUO uses its own algorithm
        }
    }
}
Code:
using System;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using Server;
using Server.Network;
 
namespace Server.Misc
{
    public class ServerList
    {
        /*
        * The default setting for Address, a value of 'null', will use your local IP address. If all of your local IP addresses
        * are private network addresses and AutoDetect is 'true' then RunUO will attempt to discover your public IP address
        * for you automatically.
        *
        * If you do not plan on allowing clients outside of your LAN to connect, you can set AutoDetect to 'false' and leave
        * Address set to 'null'.
        *
        * If your public IP address cannot be determined, you must change the value of Address to your public IP address
        * manually to allow clients outside of your LAN to connect to your server. Address can be either an IP address or
        * a hostname that will be resolved when RunUO starts.
        *
        * If you want players outside your LAN to be able to connect to your server and you are behind a router, you must also
        * forward TCP port 2593 to your private IP address. The procedure for doing this varies by manufacturer but generally
        * involves configuration of the router through your web browser.
        *
        * ServerList will direct connecting clients depending on both the address they are connecting from and the address and
        * port they are connecting to. If it is determined that both ends of a connection are private IP addresses, ServerList
        * will direct the client to the local private IP address. If a client is connecting to a local public IP address, they
        * will be directed to whichever address and port they initially connected to. This allows multihomed servers to function
        * properly and fully supports listening on multiple ports. If a client with a public IP address is connecting to a
        * locally private address, the server will direct the client to either the AutoDetected IP address or the manually entered
        * IP address or hostname, whichever is applicable. Loopback clients will be directed to loopback.
        *
        * If you would like to listen on additional ports (i.e. 22, 23, 80, for clients behind highly restrictive egress
        * firewalls) or specific IP adddresses you can do so by modifying the file SocketOptions.cs found in this directory.
        */
 
        public static readonly string Address = "***.*.220.***";
        public static readonly string ServerName = "The Server";
 
        public static readonly bool AutoDetect = false;
 
        public static void Initialize()
        {
            if( Address == null )
            {
                if( AutoDetect )
                    AutoDetection();
            }
            else
            {
                Resolve( Address, out m_PublicAddress );
            }
 
            EventSink.ServerList += new ServerListEventHandler( EventSink_ServerList );
        }
 
        private static IPAddress m_PublicAddress;
 
        private static void EventSink_ServerList( ServerListEventArgs e )
        {
            try
            {
                NetState ns = e.State;
                Socket s = ns.Socket;
 
                IPEndPoint ipep = (IPEndPoint)s.LocalEndPoint;
 
                IPAddress localAddress = ipep.Address;
                int localPort = ipep.Port;
 
                if( IsPrivateNetwork( localAddress ) )
                {
                    ipep = (IPEndPoint)s.RemoteEndPoint;
                    if( !IsPrivateNetwork( ipep.Address ) && m_PublicAddress != null )
                        localAddress = m_PublicAddress;
                }
 
                e.AddServer( ServerName, new IPEndPoint( localAddress, localPort ) );
            }
            catch
            {
                e.Rejected = true;
            }
        }
 
        private static void AutoDetection()
        {
            if( !HasPublicIPAddress() )
            {
                Console.Write( "ServerList: Auto-detecting public IP address..." );
                m_PublicAddress = FindPublicAddress();
 
                if( m_PublicAddress != null )
                    Console.WriteLine( "done ({0})", m_PublicAddress.ToString() );
                else
                    Console.WriteLine( "failed" );
            }
        }
 
        private static void Resolve( string addr, out IPAddress outValue )
        {
            if( IPAddress.TryParse( addr, out outValue ) )
                return;
 
            try
            {
                IPHostEntry iphe = Dns.GetHostEntry( addr );
 
                if( iphe.AddressList.Length > 0 )
                    outValue = iphe.AddressList[iphe.AddressList.Length - 1];
            }
            catch
            {
            }
        }
 
        private static bool HasPublicIPAddress()
        {
            NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
 
            foreach ( NetworkInterface adapter in adapters ) {
                IPInterfaceProperties properties = adapter.GetIPProperties();
 
                foreach ( IPAddressInformation unicast in properties.UnicastAddresses ) {
                    IPAddress ip = unicast.Address;
 
                    if ( !IPAddress.IsLoopback( ip ) && ip.AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork( ip ) )
                        return true;
                }
            }
 
            return false;
 
 
            /*
            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;
        }
 
        private static IPAddress FindPublicAddress()
        {
            try
            {
                WebRequest req = HttpWebRequest.Create( "http://www.runuo.com/ip.php" );
                req.Timeout = 15000;
 
                WebResponse res = req.GetResponse();
 
                Stream s = res.GetResponseStream();
 
                StreamReader sr = new StreamReader( s );
 
                IPAddress ip = IPAddress.Parse( sr.ReadLine() );
 
                sr.Close();
                s.Close();
                res.Close();
 
                return ip;
            }
            catch
            {
                return null;
            }
        }
    }
}
 

Twlizer

Sorceror
My serverlist.cs

public static readonly string Address = "174.78.31.44";
public static readonly string ServerName = "Addiction";


Your sockets loots correct for port 3000
 

Grimmy

Sorceror
I don't follow. The syntax is the same. There's no difference, it's obviously not the problem. I've run the server on another machine. And my friend has the exact same model router and he can host through it. He set my settings to match his, and still no go. I've added excepting to my firewall, I've turned my firewall off. I've made my IP static, I've setup a DHCP server, I've attempted using port 8080. The online port checker can't reach a single port. Does anyone have experience with hosting through Comcast?
 

Dian

Sorceror
I really dont think you should need to adjust anything in Sockets.cs and when RunUO is running, and posts the listening results, it will typically just show the network address's, like your 192.168.## and 127.0.0.1 :2593

You should only need to enter your true WAN IP adress into ServerList.cs and the port number you wish to use, if you want to use a different one.

If you are still having issue's, list your equipment again,
 

wlrdwawoolard

Sorceror
RunUO - [www.runuo.com] Version 2.0, Build 3567.2838
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 64-bit processors
Scripts: Compiling C# scripts...done (cached)
Scripts: Skipping VB.NET Scripts...done (use -vb to enable)
Scripts: Verifying...done (2761 items, 755 mobiles)
Enter the Ultima Online directory:
> C:\Program Files (x86)\Electronic Arts\Ultima Online Classic
ACC Registered: Server.ACC.CM.CentralMemory
Regions: Loading...done
World: Loading...done (185455 items, 37075 mobiles) (9.98 seconds)
Restricting client version to 7.0.29.2. Action to be taken: LenientKick

----------
Loading ACC...
- Loading Central Memory - Done.
Done in 0.0 seconds.
----------

Xanthos.Utilities.ConfigParser attempting to load Data/ClaimConfig.xml...
Xanthos.Utilities.ConfigParser success!
Xanthos.Utilities.ConfigParser attempting to load Data/SafeResConfig.xml..
Xanthos.Utilities.ConfigParser success!
Stargate System : Checking...
Stargate System : Startup Running...
Stargate System : Removing Previous Components...
Stargate System : Delete Command Issued
Stargate System : Deletion done, Reloading From Existing File...
Stargate System : Building 92 Stargates...
Stargate System : Loading Compleated Successfully... (92 Entries, 0.5 seco
Xanthos.Utilities.ConfigParser attempting to load Data/SpellCraftConfig.xm
Xanthos.Utilities.ConfigParser success!
Xanthos.Utilities.ConfigParser attempting to load Data/ShrinkConfig.xml...
Xanthos.Utilities.ConfigParser success!

Joeku's Staff Runebook: Loading...
Account: Administrator... done.

Listening: fe80::3106:700f:d9e1:94a8%16:2593
Listening: 169.254.148.168:2593
Listening: fe80::5412:fe6b:d64:c3be%15:2593
Listening: 169.254.195.190:2593
Listening: fe80::9168:fd7f:770e:5c42%14:2593
Listening: 192.168.1.30:2593
Listening: fe80::5537:1aa1:51c4:5483%13:2593
Listening: 169.254.84.131:2593
Listening: ::1:2593
Listening: 127.0.0.1:2593
------------------------------------------------------------------------------------------------------------------

now my user account control on java. do you think it could be dealing with that and its blocking the server somehow??

canyouseeme.org says my port is open as you can see.

what else can i do???
 

Attachments

  • ServerList.cs
    5.8 KB · Views: 1
  • canyouseeme.png
    772.5 KB · Views: 3

wlrdwawoolard

Sorceror
at all the shard i had i never had this problem of making it open i spent 24 hours of research of y this was happening and still cant config
 

Twlizer

Sorceror
Forward Port on the router 2593 to the ip 192.168.1.30

Also make the Ip a static Ip address on the computer your using of 192.168.1.30

your default gateway should be 192,168.1.1

Your subnet should be 255.255.255.0

To login to your router in your internet explore address line type 192.168.1.1 and a login page should show up
 

wlrdwawoolard

Sorceror
i fixed it never mind i never did this before but you have to enable your dmz host after u port forward and i got a public ip so in the feature this is what you do :)
 

Dian

Sorceror
strange, yeah. Having the DMZ set to the PC running the server, and the correct IP: Port listed on ServerList.cs is typically all that needs done for a basic open server.
 

Twlizer

Sorceror
Translation should have nothing to do with running a server.... Provided the ports are open and forwarded correctly..

For future reference please post your router type and connection type
 
Top