source: branches/posledni/inc/update_state.php

Last change on this file was 683, checked in by george, 15 years ago
  • Přidáno: Nové sloupce Enabled pro povolení/zakázání světů, přihlšaovacích serverů a počítačů.
File size: 1.1 KB
Line 
1<?php
2
3include_once('config.php');
4include_once('error.php');
5include_once('database.php');
6include_once('html.php');
7include_once('system.php');
8include_once('player.php');
9include_once('server.php');
10include_once('realm.php');
11
12
13// Check logon servers
14$System = new System($Config);
15$DbResult = $System->Database->query('SELECT Logon.Id, Host.Address, Logon.Port FROM Logon JOIN Host ON Host.Id=Logon.Host AND Logon.Enabled=1');
16while($Logon = $DbResult->fetch_assoc())
17{
18 //echo($Logon['Id'].',');
19 if($System->NetworkPortState($Logon['Address'], $Logon['Port'])) $State = 1;
20 else $State = 0;
21 $System->Database->query('UPDATE Logon SET Online='.$State.' WHERE Id='.$Logon['Id']);
22}
23
24// Check realms
25$DbResult = $System->Database->query('SELECT Realm.Id, Host.Address, Realm.Port FROM Realm JOIN Host ON Host.Id=Realm.Host AND Realm.Enabled=1');
26while($Realm = $DbResult->fetch_assoc())
27{
28 //echo($Realm['Id'].',');
29 if($System->NetworkPortState($Realm['Address'], $Realm['Port'])) $State = 1;
30 else $State = 0;
31 $System->Database->query('UPDATE Realm SET Online='.$State.' WHERE Id='.$Realm['Id']);
32}
33
34?>
Note: See TracBrowser for help on using the repository browser.