BUG..

All Helbreath Server Source Discussion here.
Dax
<3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Dshaked wrote: omg..
\Game.cpp(17824) : error C2065: 'bCheckLevelUp' : undeclared identifier
\Game.cpp(25131) : error C2065: 'SetNoHunterMode' : undeclared identifier
That happened when funktion look like this:
/*****************************************************************
**---------------------------FUNCTION---------------------------**
**             void Game::CheckLevelUp(int iClientH)            **
**-------------------------DESCRIPTION--------------------------**
** Level-Up                                                     **
**  - Level +1                                                  **
**  - +3 Level Up Points                                        **
**  - Level 5 and under receive +100 Bonus Gold                 **
**  - Level 20 and under receive +300 Bonus Gold                **
**  - Reset Next Level EXP                                      **
**  - Civilian Level Limit                                      **
**      Player mode switches to Combatant                       **
**      when the limit is reached                               **
** Max Level                                                    **
**  - Majestic Points +1                                        **
**  - EXP Reset to the previous Level (Rollover is carried)     **
**------------------------CREATION DATE-------------------------**
**                January 30, 2007; Dax                **
*****************************************************************/
void CGame::CheckLevelUp(int iClientH)
{
class CItem * pItem = NULL;
int iLUGold = NULL;

if (m_pClientList[iClientH] == NULL) return;
// If the player is a GM the function will return
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) return;
// If the player has not gained a level the function will return
if (m_pClientList[iClientH]->m_iExp < m_pClientList[iClientH]->m_iNextLevelExp) return;
// Level Up Loop
while (m_pClientList[iClientH]->m_iExp >= m_pClientList[iClientH]->m_iNextLevelExp)
{
// Max Level
if (m_pClientList[iClientH]->m_iLevel >= DEF_PLAYERMAXLEVEL)
{
  // Reset EXP to the previous Level (Returns any additional EXP)
  m_pClientList[iClientH]->m_iExp -= (m_pClientList[iClientH]->m_iNextLevelExp - m_iLevelExpTable[m_iPlayerMaxLevel]);
  // +1 Majestic Points
  if (m_pClientList[iClientH]->m_iGizonItemUpgradeLeft < DEF_MAXGIZONPOINT )
   m_pClientList[iClientH]->m_iGizonItemUpgradeLeft++;
  // Notify Player -> Update Client Majestic Points
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, 1, NULL, NULL);
}
// Level Up
else
{
  // +1 Level
  m_pClientList[iClientH]->m_iLevel++;
  // Level 5 and under receive +100 Bonus Gold
  if (m_pClientList[iClientH]->m_iLevel <= 5) iLUGold += 100;
  // Level 20 and under receive +300 Bonus Gold
  else if (m_pClientList[iClientH]->m_iLevel <= 20) iLUGold += 300;
  // +3 Level Up Points
  m_pClientList[iClientH]->m_iLU_Pool += 3;
  // Reset Next Level EXP
  m_pClientList[iClientH]->m_iNextLevelExp = m_iLevelExpTable[m_pClientList[iClientH]->m_iLevel + 1];
  // Notify Player -> Update Client Level
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_LEVELUP, NULL, NULL, NULL, NULL);
  // Reset Item Effects (Update stats for higher level)
  CalcTotalItemEffect(iClientH, -1, FALSE);
  // Civilian Level Limit
{
if( memcmp(m_pClientList[iClientH]->m_cLocation, "arehunter", 9) == 0 )
strcpy( m_pClientList[iClientH]->m_cLocation, "aresden" );
else if( memcmp(m_pClientList[iClientH]->m_cLocation, "elvhunter", 9) == 0 )
strcpy( m_pClientList[iClientH]->m_cLocation, "elvine" );
if (m_pClientList[iClientH]->m_bIsHunter == TRUE)
m_pClientList[iClientH]->m_bIsHunter = FALSE;
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
SendEventToNearClient_TypeA((short)iClientH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
}
}
}
// Notify Player -> Updated Client EXP
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_EXP, NULL, NULL, NULL, NULL);
// Give Level Up Gold Bonus
if(iLUGold != NULL)
{
pItem = new class CItem;
if (_bInitItemAttr(pItem, "Gold") == FALSE) { delete pItem; return; }
else { pItem->m_dwCount = (DWORD)iLUGold; bAddItem(iClientH, pItem, NULL); }
}
return;
}
Naw you've bugged it along the way. Replace it again with this:

Code: Select all

/*****************************************************************
**---------------------------FUNCTION---------------------------**
**             void Game::CheckLevelUp(int iClientH)            **
**-------------------------DESCRIPTION--------------------------**
** Level-Up                                                     **
**  - Level +1                                                  **
**  - +3 Level Up Points                                        **
**  - Level 5 and under receive +100 Bonus Gold                 **
**  - Level 20 and under receive +300 Bonus Gold                **
**  - Reset Next Level EXP                                      **
**  - Civilian Level Limit                                      **
**      Player mode switches to Combatant                       **
**      when the limit is reached                               **
** Max Level                                                    **
**  - Majestic Points +1                                        **
**  - EXP Reset to the previous Level (Rollover is carried)     **
**------------------------CREATION DATE-------------------------**
**                January 30, 2007; Dax                **
*****************************************************************/
void CGame::CheckLevelUp(int iClientH)
{
class CItem * pItem = NULL;
int iLUGold = NULL;

if (m_pClientList[iClientH] == NULL) return;
// If the player is a GM the function will return
if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) return;
// If the player has not gained a level the function will return
if (m_pClientList[iClientH]->m_iExp < m_pClientList[iClientH]->m_iNextLevelExp) return;
// Level Up Loop 
while (m_pClientList[iClientH]->m_iExp >= m_pClientList[iClientH]->m_iNextLevelExp)
{
 // Max Level
 if (m_pClientList[iClientH]->m_iLevel >= DEF_PLAYERMAXLEVEL) 
 {
  // Reset EXP to the previous Level (Returns any additional EXP)
  m_pClientList[iClientH]->m_iExp -= (m_pClientList[iClientH]->m_iNextLevelExp - m_iLevelExpTable[m_iPlayerMaxLevel]);
  // +1 Majestic Points
  if (m_pClientList[iClientH]->m_iGizonItemUpgradeLeft < DEF_MAXGIZONPOINT )
   m_pClientList[iClientH]->m_iGizonItemUpgradeLeft++;
  // Notify Player -> Update Client Majestic Points
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, 1, NULL, NULL);
 }
 // Level Up
 else
 {
  // +1 Level
  m_pClientList[iClientH]->m_iLevel++;
  // Level 5 and under receive +100 Bonus Gold
  if (m_pClientList[iClientH]->m_iLevel <= 5) iLUGold += 100;
  // Level 20 and under receive +300 Bonus Gold
  else if (m_pClientList[iClientH]->m_iLevel <= 20) iLUGold += 300;
  // +3 Level Up Points
  m_pClientList[iClientH]->m_iLU_Pool += 3;
  // Reset Next Level EXP
  m_pClientList[iClientH]->m_iNextLevelExp = m_iLevelExpTable[m_pClientList[iClientH]->m_iLevel + 1];
  // Notify Player -> Update Client Level
  SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_LEVELUP, NULL, NULL, NULL, NULL);
  // Reset Item Effects (Update stats for higher level)
  CalcTotalItemEffect(iClientH, -1, FALSE);
  // Civilian Level Limit
  if ((m_pClientList[iClientH]->m_iLevel >= DEF_CIVILIANLIMIT) && (m_pClientList[iClientH]->m_bIsHunter == TRUE ) ) 
   {
if( memcmp(m_pClientList[iClientH]->m_cLocation, "arehunter", 9) == 0 )
 strcpy( m_pClientList[iClientH]->m_cLocation, "aresden" ); 
else if( memcmp(m_pClientList[iClientH]->m_cLocation, "elvhunter", 9) == 0 )
 strcpy( m_pClientList[iClientH]->m_cLocation, "elvine" );
if (m_pClientList[iClientH]->m_bIsHunter == TRUE)
 m_pClientList[iClientH]->m_bIsHunter = FALSE;
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
SendEventToNearClient_TypeA((short)iClientH, DEF_OWNERTYPE_PLAYER, MSGID_EVENT_MOTION, DEF_OBJECTNULLACTION, NULL, NULL, NULL);
}
 }
}
// Notify Player -> Updated Client EXP
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_EXP, NULL, NULL, NULL, NULL);
// Give Level Up Gold Bonus
if(iLUGold != NULL) 
{
 pItem = new class CItem;
 if (_bInitItemAttr(pItem, "Gold") == FALSE) { delete pItem; return; }
 else { pItem->m_dwCount = (DWORD)iLUGold; bAddItem(iClientH, pItem, NULL); }
}
return;
}
Search for bCheckLevelUp and replace ALL of them with CheckLevelUp. As for SetNoHunterMode I don't see where the error is, maybe try rebuilding so it does a fresh build. Post back with results.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

eh..
Game.cpp(25138) : error C2065: 'to' : undeclared identifier
Game.cpp(25138) : error C2143: syntax error : missing ')' before 'constant'
Game.cpp(25138) : error C2059: syntax error : ')'

And when I do this...
bIsLevelUp = bCheckLevelUp(iClientH); renamed to bIsLevelUp = CheckLevelUp(iClientH); it gave error
Game.cpp(35742) : error C2440: '=' : cannot convert from 'void' to 'int'

Line 25138:
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Dshaked wrote: eh..
Game.cpp(25138) : error C2065: 'to' : undeclared identifier
Game.cpp(25138) : error C2143: syntax error : missing ')' before 'constant'
Game.cpp(25138) : error C2059: syntax error : ')'

And when I do this...
bIsLevelUp = bCheckLevelUp(iClientH); renamed to bIsLevelUp = CheckLevelUp(iClientH); it gave error
Game.cpp(35742) : error C2440: '=' : cannot convert from 'void' to 'int'

Line 25138:
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
Yeah the errors would be easy to fix if you could show me line 25138. It's just somthing being pasted wrong.

The next bIsLevelUp errors are related to the OLD level up gold methods. We need to remove all the bullshit(bIsLevel, etc) and just replace with 1 simple call of CheckLevelUp(iClientH).

I think that covers it. Just paste line 25138 and we should be done, lol.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

This is the line:
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

Dshaked wrote: This is the line:
SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_RESPONSE_HUNTMODE, NULL, NULL, NULL, m_pClientList[iClientH]->m_cLocation);
Yeah that's really odd. I don't see anything wrong with syntax in this function.

Heres a code without civ level limit(use it as a quick fix for now)

Code: Select all

/*****************************************************************
**---------------------------FUNCTION---------------------------**
**             void Game::CheckLevelUp(int iClientH)            **
**-------------------------DESCRIPTION--------------------------**
** Level-Up                                                     **
**  - Level +1                                                  **
**  - +3 Level Up Points                                        **
**  - Level 5 and under receive +100 Bonus Gold                 **
**  - Level 20 and under receive +300 Bonus Gold                **
**  - Reset Next Level EXP                                      **
**  - Civilian Level Limit                                      **
**      Player mode switches to Combatant                       **
**      when the limit is reached                               **
** Max Level                                                    **
**  - Majestic Points +1                                        **
**  - EXP Reset to the previous Level (Rollover is carried)     **
**------------------------CREATION DATE-------------------------**
**                January 30, 2007; Dax                **
*****************************************************************/
void CGame::CheckLevelUp(int iClientH)
{
	class CItem * pItem = NULL;
	int iLUGold = NULL;

	if (m_pClientList[iClientH] == NULL) return;
	// If the player is a GM the function will return
	if (m_pClientList[iClientH]->m_iAdminUserLevel > 0) return;
	// If the player has not gained a level the function will return
	if (m_pClientList[iClientH]->m_iExp < m_pClientList[iClientH]->m_iNextLevelExp) return;
	// Level Up Loop 
	while (m_pClientList[iClientH]->m_iExp >= m_pClientList[iClientH]->m_iNextLevelExp)
	{
  // Max Level
  if (m_pClientList[iClientH]->m_iLevel >= DEF_PLAYERMAXLEVEL) 
  {
  	// Reset EXP to the previous Level (Returns any additional EXP)
  	m_pClientList[iClientH]->m_iExp -= (m_pClientList[iClientH]->m_iNextLevelExp - m_iLevelExpTable[m_iPlayerMaxLevel]);
  	// +1 Majestic Points
  	if (m_pClientList[iClientH]->m_iGizonItemUpgradeLeft < DEF_MAXGIZONPOINT )
    m_pClientList[iClientH]->m_iGizonItemUpgradeLeft++;
  	// Notify Player -> Update Client Majestic Points
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_GIZONITEMUPGRADELEFT, m_pClientList[iClientH]->m_iGizonItemUpgradeLeft, 1, NULL, NULL);
  }
  // Level Up
  else
  {
  	// +1 Level
  	m_pClientList[iClientH]->m_iLevel++;
  	// Level 5 and under receive +100 Bonus Gold
  	if (m_pClientList[iClientH]->m_iLevel <= 5) iLUGold += 100;
  	// Level 20 and under receive +300 Bonus Gold
  	else if (m_pClientList[iClientH]->m_iLevel <= 20) iLUGold += 300;
  	// +3 Level Up Points
  	m_pClientList[iClientH]->m_iLU_Pool += 3;
  	// Reset Next Level EXP
  	m_pClientList[iClientH]->m_iNextLevelExp = m_iLevelExpTable[m_pClientList[iClientH]->m_iLevel + 1];
  	// Notify Player -> Update Client Level
  	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_LEVELUP, NULL, NULL, NULL, NULL);
  	// Reset Item Effects (Update stats for higher level)
  	CalcTotalItemEffect(iClientH, -1, FALSE);
  }
	}
	// Notify Player -> Updated Client EXP
	SendNotifyMsg(NULL, iClientH, DEF_NOTIFY_EXP, NULL, NULL, NULL, NULL);
	// Give Level Up Gold Bonus
	if(iLUGold != NULL) 
	{
  pItem = new class CItem;
  if (_bInitItemAttr(pItem, "Gold") == FALSE) { delete pItem; return; }
  else { pItem->m_dwCount = (DWORD)iLUGold; bAddItem(iClientH, pItem, NULL); }
	}
	return;
}
Send me a PM with your MSN so we can discuss the specifics of your files and cater a civ limit which works.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
Dshaked
&lt;3 bd long time
Posts: 747
Joined: Tue Oct 11, 2005 6:40 pm

Post by Dshaked »

Sent
Old Helbreath Nemesis Player<br><img src='http://img232.imageshack.us/img232/9784/dshakedqc5.jpg' border='0' alt='user posted image' /><br><img src='http://img232.imageshack.us/img232/6475 ... barqj0.jpg' border='0' alt='user posted image' /><br><a href='index.php?showtopic=7107&hl=' target='_blank'>MainServer Hexing Tutorial</a><br><a href='index.php?showtopic=7663&hl=x-mas' target='_blank'>My Files</a>
Post Reply