Max Gm Online.

Submit your code requests, and if you are good at coding come help others with their requests.
Post Reply
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

what would be away to calculate all the GMs that are online... i know increment.. but i tryed that and server crashed :(....

havent realy done much codeing with increments :(..

Code: Select all


  	// limit gms online marleys code
if (m_pClientList[i]->m_iAdminUserLevel > 0) {
int i;
int j;
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) {
j++;
}
}
	if (0 > m_imaxgms) { 
  	//m_iMaxClients = m_iTotalClients;
  	//GetLocalTime(&m_MaxUserSysTime);
  BOOL bflag2;
  bflag2 = FALSE;
  if (m_pClientList[iClientH]->m_iAdminUserLevel >= 8) bflag2 = TRUE;
  if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) bflag2 = TRUE;
  if(bflag2 == FALSE) {
  	wsprintf(G_cTxt, "Maximum GMS: %s was dissconnected", m_pClientList[iClientH]->m_cCharName);
  	PutLogFileList(G_cTxt);
  	return FALSE;
  }
  }
}
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Treax2
Loyal fan
Posts: 281
Joined: Fri Mar 04, 2005 5:05 pm
Location: Estonia
Contact:

Post by Treax2 »

why u need this ... if there are adminlist.cfg ...
and hg hack is a history for a long time =DS
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

marleythe9 wrote: what would be away to calculate all the GMs that are online... i know increment.. but i tryed that and server crashed :(....

havent realy done much codeing with increments :(..

Code: Select all


  	// limit gms online marleys code
if (m_pClientList[i]->m_iAdminUserLevel > 0) {
int i;
int j;
for (i = 0; i < DEF_MAXCLIENTS; i++) {
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) {
j++;
}
}
	if (0 > m_imaxgms) { 
  	//m_iMaxClients = m_iTotalClients;
  	//GetLocalTime(&m_MaxUserSysTime);
  BOOL bflag2;
  bflag2 = FALSE;
  if (m_pClientList[iClientH]->m_iAdminUserLevel >= 8) bflag2 = TRUE;
  if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) bflag2 = TRUE;
  if(bflag2 == FALSE) {
  	wsprintf(G_cTxt, "Maximum GMS: %s was dissconnected", m_pClientList[iClientH]->m_cCharName);
  	PutLogFileList(G_cTxt);
  	return FALSE;
  }
  }
}
this code is useless...

gm1 with 1 user lvl was connected
gm2 with 2 user lvl was connected
gm3 with 3 user lvl was connected

(max gms is 3)

Admin_GM4 with 4 user lvl was connected

and GM4 was disconnected cuz there is 3 gms online.
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Cleroth
Loyal fan
Posts: 416
Joined: Wed Jun 16, 2004 7:08 pm

Post by Cleroth »

  // limit gms online marleys useless code
if (m_pClientList->m_iAdminUserLevel > 0) { // marleys use of a non-initialized variable
int i;
int j;
for (i = 0; i < DEF_MAXCLIENTS; i++) { // marleys useless loop
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) {
j++; // marleys increment of a non-initialized variable
}
}
// marleys additionnal useless code
if (0 > m_imaxgms) {
  //m_iMaxClients = m_iTotalClients;
  //GetLocalTime(&m_MaxUserSysTime);
BOOL bflag2;
bflag2 = FALSE;
if (m_pClientList[iClientH]->m_iAdminUserLevel >= 8) bflag2 = TRUE;
if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) bflag2 = TRUE;
if(bflag2 == FALSE) {
  wsprintf(G_cTxt, "Maximum GMS: %s was dissconnected", m_pClientList[iClientH]->m_cCharName);
  PutLogFileList(G_cTxt);
  return FALSE;
}
}
}
<img src='http://ic1.deviantart.com/fs11/i/2006/1 ... leroth.gif' border='0' alt='user posted image' />
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

Code: Select all

  // limit gms online marleys useless code
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) { // marleys use of a non-initialized variable
int i;
int j = 0;
for (i = 0; i < DEF_MAXCLIENTS; i++) { // marleys useless loop
if (m_pClientList[i]->m_iAdminUserLevel > 0) {
j++; // marleys increment of a non-initialized variable
}
}
// marleys additionnal useless code
if (j > m_imaxgms) {
  //m_iMaxClients = m_iTotalClients;
  //GetLocalTime(&m_MaxUserSysTime);
BOOL bflag2;
bflag2 = FALSE;
if (m_pClientList[iClientH]->m_iAdminUserLevel >= 8) bflag2 = TRUE;
if (m_pClientList[iClientH]->m_iAdminUserLevel == 0) bflag2 = TRUE;
if(bflag2 == FALSE) {
  wsprintf(G_cTxt, "Maximum GMS: %s was dissconnected", m_pClientList[iClientH]->m_cCharName);
  PutLogFileList(G_cTxt);
  return FALSE;
}
}
}
heh i did the i wrong spot... that was just post... in code its diffrent.
i'v tryed makeing "j" = 0 but.. still crash.... increments not working.. GM connects then crashes.. and the.. it has nothing to do with non initialized veriabls, that was a bad post of code, cuz i deleted the code so i wont get crashed.

yes point of code is to limit the amout of gms loged on server.
i created 8 levels, some level gms cant drop trade stuff like that.
soo level 8 gms the max gm limit dont apply to them.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Post Reply