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!

Web Status Page

orgis

Wanderer
Web Status Page

Here is a quick and simple guide to displaying your server status on your web site, this guide is for web status page that is hosted on same pc as the game.

Code:
		{
			if ( !Directory.Exists( "web" ) )
				Directory.CreateDirectory( "web" );

			using ( StreamWriter op = new StreamWriter( [COLOR="Red"]"C:/www/webroot/web/status.html"[/COLOR] ) )
			{
				op.WriteLine( "<html>" );
				op.WriteLine( "   <head>" );
				op.WriteLine( "      <title>Orgis World Server Status</title>");
				op.WriteLine( "   </head>" );
				op.WriteLine( "   [COLOR="Magenta"]<body bgcolor=\"white\">" );[/COLOR]
				op.WriteLine( "      <h1 align=\"center\">[COLOR="Sienna"]<img border=\"0\" src=\"http://i1.tinypic.com/o9if7p.gif\"></h1>[/COLOR]" ); //If you have a logo, put a copy of it in the same folder as the status.html (where it will be) then whatever your logo filename is just put that and the file ending. If you do not have a logo, either make one or comment this line out via a //
				op.WriteLine( "  <div align=\"center\">Online clients:<br>" );
				op.WriteLine( "      <table width=\"100%\">" );
				op.WriteLine( "         <tr>" );
				op.WriteLine( "            [COLOR="Blue"]<td bgcolor=\"black\">[/COLOR]<[COLOR="SeaGreen"]font color[/COLOR]=\"yellow\">Name</font></td><td bgcolor=\"black\"><f[COLOR="SeaGreen"]ont color[/COLOR]=\"red\">Kills</font></td><td [COLOR="Blue"]bgcolor[/COLOR]=\"black\"><[COLOR="SeaGreen"]font color[/COLOR]=\"yellow\">Karma / Fame</font></td>" );
				op.WriteLine( "         </tr>" );

What i done was copy the web folder(RunUO-2.0-RC1\web) into my web root folder which is located here "C:/www/webroot/" taking note of the use of the "/" instead of the "\" which explorer uses, change in "WebStatus.cs" the code in red to point to where your "status.html" is located e.g.

"C:/www/webroot/web/status.html"

Remember to use your file location as i noticed some people use different web servers(i use "Apache")

For customising the look follow the color guide below

Code:
[COLOR="Magenta"]This color is the background color of the complete web page[/COLOR]

[COLOR="Blue"]This will change  the color of the table back ground color[/COLOR]

[COLOR="SeaGreen"]This is the font color with in the table[/COLOR]

[COLOR="Sienna"]this line changes the logo you use to display i use tinypic to host it it works fine for me[/COLOR]


Any problems PM me ill try to help,

Orgis
 
Top