Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
db_mysql_error.inc.php
Go to the documentation of this file.
1 <?php
2 if(!defined('IN_GAME')) {
3  exit('Access Denied');
4 }
5 
6 $timestamp = time();
7 $errmsg = '';
8 
9 $dberror = $this->error();
10 $dberrno = $this->errno();
11 
12 if($dberrno == 1114) {
13 
14 ?>
15 <html>
16 <head>
17 <title>Max Onlines Reached</title>
18 </head>
19 <body bgcolor="#FFFFFF">
20 <table cellpadding="0" cellspacing="0" border="0" width="600" align="center" height="85%">
21  <tr align="center" valign="middle">
22  <td>
23  <table cellpadding="10" cellspacing="0" border="0" width="80%" align="center" style="font-family: Verdana, Tahoma; color: #666666; font-size: 9px">
24  <tr>
25  <td valign="middle" align="center" bgcolor="#EBEBEB">
26  <br><b style="font-size: 10px">Forum onlines reached the upper limit</b>
27  <br><br><br>Sorry, the number of online visitors has reached the upper limit.
28  <br>Please wait for someone else going offline or visit us in idle hours.
29  <br><br>
30  </td>
31  </tr>
32  </table>
33  </td>
34  </tr>
35 </table>
36 </body>
37 </html>
38 <?php
39 
40  function_exists('dexit') ? dexit() : exit();
41 
42 } else {
43 
44  if($message) {
45  $errmsg = "<b>BRA info</b>: $message\n\n";
46  }
47  if(isset($GLOBALS['_DSESSION']['bra_user'])) {
48  $errmsg .= "<b>User</b>: ".htmlspecialchars($GLOBALS['_DSESSION']['bra_user'])."\n";
49  }
50  $errmsg .= "<b>Time</b>: ".gmdate("Y-n-j g:ia", $timestamp + ($GLOBALS['timeoffset'] * 3600))."\n";
51  $errmsg .= "<b>Script</b>: ".$GLOBALS['PHP_SELF']."\n\n";
52  if($sql) {
53  $errmsg .= "<b>SQL</b>: ".htmlspecialchars($sql)."\n";
54  }
55  $errmsg .= "<b>Error</b>: $dberror\n";
56  $errmsg .= "<b>Errno.</b>: $dberrno";
57 
58  echo "</table></table></table></table></table>\n";
59  echo "<p style=\"font-family: Verdana, Tahoma; font-size: 11px; background: #FFFFFF;\">";
60  echo nl2br($errmsg);
61  if($GLOBALS['adminemail']) {
62  $errlog = array();
63  if(@$fp = fopen(GAME_ROOT.'./gamedata/dberror.log', 'r')) {
64  while((!feof($fp)) && count($errlog) < 20) {
65  $log = explode("\t", fgets($fp, 50));
66  if($timestamp - $log[0] < 86400) {
67  $errlog[$log[0]] = $log[1];
68  }
69  }
70  fclose($fp);
71  }
72 
73  if(!in_array($dberrno, $errlog)) {
74  $errlog[$timestamp] = $dberrno;
75  @$fp = fopen(GAME_ROOT.'./gamedata/dberror.log', 'w');
76  @flock($fp, 2);
77  foreach(array_unique($errlog) as $dateline => $errno) {
78  @fwrite($fp, "$dateline\t$errno");
79  }
80  @fclose($fp);
81  if(function_exists('errorlog')) {
82  errorlog('MySQL', basename($GLOBALS['_SERVER']['PHP_SELF'])." : $dberror - ".cutstr($sql, 120), 0);
83  }
84 
85  if($GLOBALS['dbreport']) {
86  echo "<br><br>An error report has been dispatched to our administrator.";
87  @sendmail($GLOBALS['adminemail'], '[bra!] MySQL Error Report',
88  "There seems to have been a problem with the database of your bra game\n\n".
89  strip_tags($errmsg)."\n\n".
90  "Please check-up your MySQL server and forum scripts, similar errors will not be reported again in recent 24 hours\n".
91  "If you have troubles in solving this problem, please visit loongyou Community http://www.loongyou.com");
92  }
93 
94  } else {
95  echo '<br><br>Similar error report has beed dispatched to administrator before.';
96  }
97 
98  }
99  echo '</p>';
100 
101  function_exists('gexit') ? gexit() : exit();
102 
103 }
104 
105 ?>
$log
Definition: botservice.php:34
const GAME_ROOT
Definition: clear.php:6
gexit($message= '', $file= '', $line=0)
Definition: global.func.php:30
if(!defined('IN_GAME')) $timestamp