The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting up server status
Author Message
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #12
RE: Setting up server status
There is a built-in web server in sphere that you can enable using the following setting in sphere.ini:

Code:
// Use the built in http server
// 0 - disable http server and webpage generation
// 1 - disable http server and enable webpage generation
// 2 - enable http server and webpage generation (default)
UseHttp=1

You can define some more behavior for that webserver using these settings:

Code:
///////////////////////////////////////////////////////////////
//////// Webpage Settings
///////////////////////////////////////////////////////////////

// Note, that you can catch error codes by creating sphere404.htm and so on
// for all HTTP error codes sphere support.

[WEBPAGE 1]
// Determines what html file is used as base for the status page
WebPageSrc=scripts\web\spherestatusbase.html
// Determines where the status page is saved
WebPageFile=scripts\web\status.html
// In seconds, how often the status file is updated
WebPageUpdate=60
// Required PLevel to view this page (0 = anyone, 6 = admins only)
PLevel=0

If you want those html files to look different, then you need some other webserver to fetch and rewrite the content however you desire. Here is a primitive php sample for you to start from (note "10.0.1.100" is the internal IP of the sphereserver, and "athlore" is the name of the shard):

PHP Code:
<?php

  
print "The following players are in-game right now!  If you want to see what they are up to then you need to start playing!<br>";
  print 
"<table width='100%'>";
  print 
"<tr><th colspan=2><center>Sphere</center></th></tr>";
  print 
"<tr><td>";
  
$url "http://10.0.1.100/athlore/status.html";
  
$str file_get_contents($url);
  print 
$str;
  print 
"</td></tr>";
  print 
"</table>";

?>

If you don't know php, get a book from Amazon...

The web\spherestatusbase.html in that previous example was edited to look like this:

Code:
<table border="1" width="100%">
  <tr>
    <th><strong>Name</strong></th>
    <th><strong>Location</strong></th>
  </tr>
  <script language="Sphere">CLIENTLIST <tr %LISTCOL%><td>%NAME%</td><td>%REGION.NAME%</td></tr></script>
  <tr><td colspan="2"><em>Last updated:</em> %RTIME%</td></tr>
</table>

In that example, you can see that some primitive sphere script can be embedded. It may be possible to do more complex things with it, but I haven't really tried to push that envelope... Good luck!

There is no simple way to query sphereserver to find out what your players are wearing, so that is why people are suggesting triggers to write that sort of detail to a database etc.
(This post was last modified: 06-25-2013 04:34 PM by RanXerox.)
06-25-2013 10:19 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Setting up server status - Leonidas - 06-22-2013, 05:01 AM
RE: Setting up server status - Monty - 06-22-2013, 06:49 AM
RE: Setting up server status - Rattlehead - 06-22-2013, 09:09 AM
RE: Setting up server status - Leonidas - 06-22-2013, 12:32 PM
RE: Setting up server status - Monty - 06-22-2013, 06:00 PM
RE: Setting up server status - Leonidas - 06-23-2013, 01:27 PM
RE: Setting up server status - Leonidas - 06-24-2013, 01:40 PM
RE: Setting up server status - Rattlehead - 06-24-2013, 06:21 PM
RE: Setting up server status - Leonidas - 06-27-2013, 07:32 AM
RE: Setting up server status - Leonidas - 06-25-2013, 06:29 AM
RE: Setting up server status - Rattlehead - 06-25-2013, 08:57 AM
RE: Setting up server status - RanXerox - 06-25-2013 10:19 AM
RE: Setting up server status - Leonidas - 06-25-2013, 10:46 AM
RE: Setting up server status - Rattlehead - 06-25-2013, 01:58 PM
RE: Setting up server status - pinku - 06-25-2013, 02:45 PM
RE: Setting up server status - Rattlehead - 06-25-2013, 09:12 PM
RE: Setting up server status - Rattlehead - 06-27-2013, 08:55 AM
RE: Setting up server status - Coruja - 06-13-2014, 03:05 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)