DragonPrime - LoGD Resource Community
Welcome Guest
  • Good afternoon, Guest.
    Please log in, or register.
  • October 22, 2017, 03:32:51 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Maximum Users Online Mod - anpera  (Read 2652 times)
0 Members and 1 Guest are viewing this topic.
Arune
Member
Mod God
*****
Offline Offline

Posts: 718


Arune Vai - khatfield


View Profile WWW
« on: February 25, 2004, 01:13:30 PM »

Mod by anpera - I just translated..
Many servers have limited bandwidth or just have a problem processing data or accessing MYSQL once a certain amount of users have been reached. This allows the LoGD administrator the ability to decide how many users he/she will allow online simultaneously.

To install:
Code:
-----
Open:
configuration.php

-----
Find:
   "gameadminemail"=>"Admin Email",

-----
After Add:
   "maxonline"=>"Maximum users online (0 for unlimited),int",


-----
Open:
index.php

-----
Find:
output("Enter your name and password to enter the realm.`n");

-----
After Add:
$sql="SELECT laston,loggedin FROM accounts WHERE locked=0 AND loggedin=1 AND laston>'".date("Y-m-d
H:i:s",strtotime("-".getsetting("LOGINTIMEOUT",900)." seconds"))."' ORDER BY level DESC";
$result = db_query($sql) or die(sql_error($sql));
for ($onlinecount=0;$onlinecount<db_num_rows($result);$onlinecount++);
db_free_result($result);
if ($onlinecount<getsetting("maxonline",10) || getsetting("maxonline",10)==0){

-----
Find:
// Without this, I had one user constantly get 'badnav.php' :/  Everyone else worked, but he didn't
addnav("","login.php");

-----
Before Add:
} else {
output("`^`bThe Server has currently reached its maximum number of users online.`b`nPlease wait until a spot becomes available. `n`n");

if ($_GET['op']=="timeout"){
   $session['message'].=" Your session has timed out, you must log in again.`n";
   if (!isset($_COOKIE['PHPSESSID'])){
      $session['message'].=" Also, it appears that you may be blocking cookies from this site.  At least session cookies
must be enabled in order to use this site.`n";
   }
}
if ($session[message]>"") output("`b`\$$session[message]`b`n");
output("<table width='212' height='234' border='0' cellpadding='0' cellspacing='0' background='images/logindragon.gif'
class='noborder'>
   <tr>
      <td valign='bottom' align='center' class='noborder'>
         <br>`b`\$Server<br><br>
         voll!`b<br><br><br>
         <img src='images/trans.gif' width='1' height='37' align='absmiddle' alt=''>
      </td>
   </tr>
</table>
`c",true);
}
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
29 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search