i have a wierd crash... im useing 3.01 exchange code cuz i figured it would work but, i get a crash if 1 player trade 1 item for 2.
depbug mode dosnt catch anything just some random 8000 number heh. witch probley is something to do with improper use of a veriable. if u know whats best version for working exchange post .
Exchange crash
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
<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' />
I know I used to do that on old HbSecret server, rofl to dupe like 600 zems xD cuz it kept rolling back haha.
So if u want it fixed u should ask Zero
Edit : it only crashes one HG btw, I had to use 4 accounts on different hgs, elv ares and ml to crash secret
if u want I can upload that client, I think I got it here somewhere
Cheers Tester
So if u want it fixed u should ask Zero
Edit : it only crashes one HG btw, I had to use 4 accounts on different hgs, elv ares and ml to crash secret
if u want I can upload that client, I think I got it here somewhere
Cheers Tester
I support a woman's right to choose<br><br>- In the Mouth?<br>- In the Ass ?<br>- In the Vagina?<br>- Between the Tits?
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
nah be nice to get some fix code , have alot code to do and i ran into this . dont have alot time to fix it. unless i just runinto prob. or i knew why it was doing it. eh i may try 2.24b exchange code hehe.
<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' />
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
Code: Select all
for (i = 0; i <m_pClientList[iExH]->m_iExchangeCount; i++){
if ((m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cItemType == DEF_ITEMTYPE_CONSUME) ||
(m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cItemType == DEF_ITEMTYPE_ARROW) ) {
if (m_pClientList[iExH]->m_iExchangeItemAmount[i] > m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[i]]->m_dwCount) {
_ClearExchangeStatus(iClientH);
_ClearExchangeStatus(iExH);
return;
}
pItemB[ i ] = new class CItem;
_bInitItemAttr(pItemB[ i ], m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cName);
pItemB[ i ]->m_dwCount = m_pClientList[iExH]->m_iExchangeItemAmount[ i ];
pItemBcopy[ i ] = new class CItem;
_bInitItemAttr(pItemBcopy[ i ], m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cName);
bCopyItemContents(pItemBcopy[ i ], pItemB[ i ]);
pItemBcopy[ i ]->m_dwCount = m_pClientList[iExH]->m_iExchangeItemAmount[ i ];
}
else {
pItemB[ i ] = (class CItem *)m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]];
pItemB[ i ]->m_dwCount = m_pClientList[iExH]->m_iExchangeItemAmount[ i ];
pItemBcopy[ i ] = new class CItem;
_bInitItemAttr(pItemBcopy[ i ], m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cName);
bCopyItemContents(pItemBcopy[ i ], pItemB[ i ]);
pItemBcopy[ i ]->m_dwCount = m_pClientList[iExH]->m_iExchangeItemAmount[ i ];
_bItemLog(DEF_ITEMLOG_EXCHANGE, iExH, iClientH, pItemBcopy[ i ], FALSE);
QuestItemObtain(iExH, 2);
}
}
for (i = 0; i<m_pClientList[iExH]->m_iExchangeCount; i++) {
if ((m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cItemType == DEF_ITEMTYPE_CONSUME) ||
(m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_cItemType == DEF_ITEMTYPE_ARROW) ) {
iAmountLeft = (int)m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]]->m_dwCount - m_pClientList[iExH]->m_iExchangeItemAmount[ i ];
if (iAmountLeft < 0) iAmountLeft = 0;
SetItemCount(iExH, m_pClientList[iExH]->m_cExchangeItemIndex[ i ], iAmountLeft);
}
else {
ReleaseItemHandler(iExH, m_pClientList[iExH]->m_cExchangeItemIndex[ i ], TRUE);
SendNotifyMsg(NULL, iExH, DEF_NOTIFY_GIVEITEMFIN_ERASEITEM, m_pClientList[iExH]->m_cExchangeItemIndex[ i ], m_pClientList[iExH]->m_iExchangeItemAmount[ i ], NULL, m_pClientList[ iClientH ]->m_cCharName);
m_pClientList[iExH]->m_pItemList[m_pClientList[iExH]->m_cExchangeItemIndex[ i ]] = NULL;
}
bAddItem(iClientH, pItemB[ i ], NULL);
delete pItemBcopy[i];
pItemBcopy[i] = NULL;
}
exh didnt have same amount items as iclienth it would cuase a random item name, makein it crash when that client loged off cuz none exist item / attribuits.
this is in function "CGame::ConfirmExchangeItem"
<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' />
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
wow the code i posted above cant even help 3.0 code lol. they fucked up the exchange. i would suggest just useing 2.24b exchange code only diffrence is they added item verible so it keeps track of the item 1st person exchanging on 2nd person, so in other words just compairs the exchange items make sure exchange items are what each client is supos say.
easy to add that, just do
m_pClientList[ sOwnerH ]->m_iExchangeAlterIndex[m_pClientList[ sOwnerH ]->m_iExchangeComplete] = (char)sItemIndex;
above m_pClientList[iClientH]->iExchangeCount++;
heh then add a
// March 20, 2005 - cancel trade if player is recieving an item which hasnt been dropped by the other player
if (m_pClientList[ iClientH ]->m_cExchangeItemIndex[ i ] != m_pClientList[iExH]->m_iExchangeAlterIndex[ i ]) {
_ClearExchangeStatus(iClientH);
_ClearExchangeStatus(iExH);
return;
}
in the comfirm function in the for( loop were it checks all the stuff like if item exist all that.
and i must say the cExchangeMode thing they did was 100% pointless, 3.00++ source exchange code 100% messed up. made it worse not better lol. dosnt just crash thers just sooooo much pointless stuff in it.
easy to add that, just do
m_pClientList[ sOwnerH ]->m_iExchangeAlterIndex[m_pClientList[ sOwnerH ]->m_iExchangeComplete] = (char)sItemIndex;
above m_pClientList[iClientH]->iExchangeCount++;
heh then add a
// March 20, 2005 - cancel trade if player is recieving an item which hasnt been dropped by the other player
if (m_pClientList[ iClientH ]->m_cExchangeItemIndex[ i ] != m_pClientList[iExH]->m_iExchangeAlterIndex[ i ]) {
_ClearExchangeStatus(iClientH);
_ClearExchangeStatus(iExH);
return;
}
in the comfirm function in the for( loop were it checks all the stuff like if item exist all that.
and i must say the cExchangeMode thing they did was 100% pointless, 3.00++ source exchange code 100% messed up. made it worse not better lol. dosnt just crash thers just sooooo much pointless stuff in it.
<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' />
Use the version it was released in. I think it was 2.18~2.19.marleythe9 wrote: wow the code i posted above cant even help 3.0 code lol. they fucked up the exchange. i would suggest just useing 2.24b exchange code only diffrence is they added item verible so it keeps track of the item 1st person exchanging on 2nd person, so in other words just compairs the exchange items make sure exchange items are what each client is supos say.
easy to add that, just do
m_pClientList[ sOwnerH ]->m_iExchangeAlterIndex[m_pClientList[ sOwnerH ]->m_iExchangeComplete] = (char)sItemIndex;
above m_pClientList[iClientH]->iExchangeCount++;
heh then add a
// March 20, 2005 - cancel trade if player is recieving an item which hasnt been dropped by the other player
if (m_pClientList[ iClientH ]->m_cExchangeItemIndex[ i ] != m_pClientList[iExH]->m_iExchangeAlterIndex[ i ]) {
_ClearExchangeStatus(iClientH);
_ClearExchangeStatus(iExH);
return;
}
in the comfirm function in the for( loop were it checks all the stuff like if item exist all that.
and i must say the cExchangeMode thing they did was 100% pointless, 3.00++ source exchange code 100% messed up. made it worse not better lol. dosnt just crash thers just sooooo much pointless stuff in it.
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>
-
- Loyal fan
- Posts: 391
- Joined: Sat Mar 26, 2005 12:41 am
nah 2.24b exchange source works fine , i added the 3.00 item checker veriable hehe.
<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' />