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!

Server Status?

carve

Wanderer
Server Status?

Anyone been successful with retrieving the Server Status via the packets:

"\x7f\x01\x01\x01"
"\xf1\x00\x04\xff"

I recently switched my Live Server to a CentOS Version of our old Live Server. I realized, as well as some of my players that our status on JoinUO aswell as from the script on my site that we use to retrieve stats and such could not actually retrieve any information.

Has anyone had to overcome this problem yet?

My Specs:

Quad Core 3.2Ghz 64bit AMD
2GB Ram DDR3
250GB Raid III - Hardware (I believe its III)
100mbit line

OS: CentOS 5.4 (latest x64)
RunUO: RunUO 2.1 (latest devel) w/ Custom Scripts - No core edits.

Thanks in advance.
 

_Epila_

Sorceror
try this packet to retrieve the server info
"0x7f, 0x00, 0x00, 0x01, 0xf1, 0x00, 0x04, 0xff"

is a little different than yours
 

carve

Wanderer
I tried it as One Line, it worked the first time, after that it sends nothing back, any idea why?
 

Jeff

Lord
Code:
                network = new ClientNetwork();
                network.Register<SphereInfoResponsePacket>(0x53, "Sphere Information Response", 0, delegate(IRecvPacket p)
                {
                    SphereInfoResponsePacket packet = (SphereInfoResponsePacket)p;

                    OnPollingSuccess(this, new PollingSuccessEventArgs(state.Info, packet.Age, packet.ClientCount,
                        packet.ItemCount, packet.MobileCount, packet.Memory));
                    network.Disconnect();

                    complete = true;
                });

                network.Register<RunUOInfoResponsePacket>(0x52, "RunUO Information Response", 0, delegate(IRecvPacket p)
                {
                    RunUOInfoResponsePacket packet = (RunUOInfoResponsePacket)p;

                    OnPollingSuccess(this, new PollingSuccessEventArgs(state.Info, packet.Age, packet.ClientCount,
                        packet.ItemCount, packet.MobileCount, packet.Memory));

                    network.Disconnect();

                    complete = true;
                });

                network.Connect(state.Info.HostAddress, state.Info.Port);

                if (network.IsConnected)
                {
                    online = true;

                    byte[] seed = new byte[4] { 1, 2, 3, 4 };

                    network.Send(seed, 0, 4);
                    network.Send(new UOInfoResponsePacket());
                }

Here is the code i use for the ConnectUO poller...

Here is the UOInforResponsePacket (ya, it should be called UOInfoRequestPacket i know)

Code:
    public class UOInfoResponsePacket : SendPacket
    {
        public UOInfoResponsePacket()
            : base(0xF1, "UOG Information Request", 4)
        {
            Stream.Write((short)4);
            Stream.Write((byte)0xFF);
        }
    }

From what i can tell, both of the examples.. the one from carve, and the one from _Epila_ are exactly the same...and are also the same as mine.

Can your players connect to the server from the outside world?
 

_Epila_

Sorceror
check your Scripts\Engines\RemoteAdmin\PacketHandlers.cs and look for ServerInfoRequest packet handler
 

Jeff

Lord
Is the server on ConnectUO? If so whats the name, and is ConnectUO polling it porperly?
 

carve

Wanderer
Jeff;830663 said:
Is the server on ConnectUO? If so whats the name, and is ConnectUO polling it porperly?

The server IS on ConnectUO, but it IS NOT polling properly.
 

Jeff

Lord
Carve... your problem is, you installed this RunUO Administrator from our talks the other night, and that code is not tested, and or approved to be in production since its a work in progress, i bet this is the problem... heavily modified remote administration code...duhhhhhhhhhhhhhh ;)
 

carve

Wanderer
Jeff;830678 said:
Carve... your problem is, you installed this RunUO Administrator from our talks the other night, and that code is not tested, and or approved to be in production since its a work in progress, i bet this is the problem... heavily modified remote administration code...duhhhhhhhhhhhhhh ;)

Actually I reverted back to the one from devel on svn. Also my server name is "UO Retribution".

Thanks Guys.
 

Jeff

Lord
carve;830680 said:
Actually I reverted back to the one from devel on svn. Also my server name is "UO Retribution".

Thanks Guys.

Ah, damn, thought i had it... oh well, Console.WriteLine all over the place to see where it is hanging is your only answer. ConnectUO's poller is giving this error [Error polling UO Retribution] - Reason: The timeout threshold was reached, which means your server answered the connection, but didnt reply back to my request for the UOG packet within 30 seconds.
 

PitHelvit

Sorceror
I've been meaning to ask this on the CUO forums for a while now.

My shard runs on Linux as well, and I get the same problem as carve.
Well sorta. Once in a long while the Max players changes, but I can never get the online count. I also get the timeout error.


PitHelvit

PS: Shard's name is Phantasyas. Everything else works perfectly ( connecting, patching )
 

carve

Wanderer
PitHelvit - you explained my issue to a T. Very randomly my server will reply with the Server Info string (very randomly though!). I assume this has to do with the way linux handles sockets?
 

Jeff

Lord
[13:29] <Jeff-> Mark, you have any idea about this?
[13:30] <Jeff-> Server Status? - RunUO - Ultima Online Emulation
[13:30] <Jeff-> its not connectuo only, seems to be any poller
[13:30] <Jeff-> but seems to be linux specific
[13:32] <&Mark> yep
[13:32] <&Mark> i already diagnosed that a while ago
[13:32] <&Mark> its a mono bug
[13:32] <Jeff-> ah ok
[13:32] <&Mark> notice the Dispose() after the reply
[13:32] <&Mark> its killing the response
[13:32] <Jeff-> oh,
[13:32] <&Mark> should flush it, but it doesnt
 

Jeff

Lord
Carve, for kicks, try this.

In Scripts/Engines/RemoteAdmin/Network.cs

find this

Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Dispose();
			}

and make it this

Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Flush();
                                DelayedDisconnect( state );
			}
 

Kons.snoK

Sorceror
Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
#if MONO
				Timer.DelayCall(TimeSpan.FromSeconds(0.1), new TimerStateCallback(Disconnect), state);
#else
				state.Dispose();
#endif
			}

may not be clean, but works.
 

Jeff

Lord
Kons.snoK;830766 said:
Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
#if MONO
				Timer.DelayCall(TimeSpan.FromSeconds(0.1), new TimerStateCallback(Disconnect), state);
#else
				state.Dispose();
#endif
			}

may not be clean, but works.
This still has the potential of failing, You should manually force the Flush.
 

PitHelvit

Sorceror
Jeff;830752 said:
Carve, for kicks, try this.

In Scripts/Engines/RemoteAdmin/Network.cs

find this

Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Dispose();
			}

and make it this

Code:
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Flush();
                                DelayedDisconnect( state );
			}


This works wonders on mine as well. I'm guessing this should be added to stock RunUO?

Code:
#if !MONO
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Dispose();
			}
#else
			else if ( cmd == 0xFF )
			{
				string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K", Server.Misc.ServerList.ServerName, (int)(DateTime.Now-Server.Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(System.GC.GetTotalMemory(false)/1024) );
				state.Send( new UOGInfo( statStr ) );
				state.Flush();
                DelayedDisconnect( state );
			}
#endif

^^ My version

Thanks again :)

PitHelvit
 
Top