DEV V Fixes
Posted: Fri May 16, 2014 2:55 pm
Ok so great work Vetyst! Made a few fixes they do work on my server but my coding skills are beginner so it might be messy
so this in World Packets
and in World Server
we enter this packet
this should now deduct itemmall points properly and update the amount so when you log back in the points dont return
so this in World Packets
- // Observe: Buy Spins
- bool CWorldServer::pakLuckySpinBuy ( CPlayer* thisclient, CPacket* P )
- {
- DWORD spins = GETDWORD((*P), 0);
- if(thisclient->CharInfo->Itemmall < spins*10 )
- {
- BEGINPACKET ( pak, 0x7f0 );
- ADDBYTE ( pak, 2 );
- ADDDWORD ( pak, thisclient->CharInfo->LuckySpins );
- thisclient->client->SendPacket( &pak );
- Log(MSG_WARNING,"%s tried buying spins with %i Points", thisclient->CharInfo->charname, thisclient->CharInfo->Itemmall);
- } else {
- thisclient->CharInfo->Itemmall -= spins*10;
- thisclient->CharInfo->LuckySpins += spins;
- BEGINPACKET ( pak, 0x7f0 );
- ADDBYTE ( pak, 1 );
- ADDDWORD ( pak, thisclient->CharInfo->LuckySpins );
- ADDDWORD ( pak, thisclient->CharInfo->Itemmall );
- thisclient->client->SendPacket( &pak );
- {
- GServer->DB->QStore("SELECT itemmall_points FROM accounts WHERE lastchar='%s'", thisclient->CharInfo->charname);
- Log(MSG_INFO,"%s's iPoints: %i", thisclient->CharInfo->charname, thisclient->CharInfo->Itemmall);
- GServer->DB->FreeResult( );
- RESETPACKET( pak, 0x7c9 ); // Send Itemmall Points to client
- ADDBYTE ( pak, 0 );
- ADDQWORD ( pak, thisclient->CharInfo->Itemmall );
- thisclient->client->SendPacket( &pak);
- }
- }
- return true;
- }
and in World Server
- // Incoming packet
- bool CWorldServer::OnReceivePacket( CClientSocket* thisclient, CPacket *P )
we enter this packet
- case 0x7c9: return pakLuckySpinBuy ( (CPlayer*)thisclient->player, P );//we activate this packet
this should now deduct itemmall points properly and update the amount so when you log back in the points dont return