Hello
I'm struggling with a C++ code in TFS1.5
I'm trying to get a information about the current premium_points value from player account in MySQL database.
I have created a protocolgame.cpp entry, I know the SQL query (SELECT
but I cannot get it to work.
It looks like there is no way to get the player account id in protocolgame.cpp. Should I use some function in game.cpp? or maybe player.cpp?
I tried to get it done through game.cpp with:
But I think it is not the best way to do it. Maybe I should somehow get this value from iologindata and provide it to the protocolgame.cpp somehow?
I would appreciate any idea/suggestion in this case.
Thanks in advance all!
I'm struggling with a C++ code in TFS1.5
I'm trying to get a information about the current premium_points value from player account in MySQL database.
I have created a protocolgame.cpp entry, I know the SQL query (SELECT
premium_points
FROM accounts
WHERE id='ACCOUNT_ID'
It looks like there is no way to get the player account id in protocolgame.cpp. Should I use some function in game.cpp? or maybe player.cpp?
I tried to get it done through game.cpp with:
C++:
case 0xF2: // Premium points request
addGameTaskTimed(DISPATCHER_TASK_EXPIRATION, &Game::playerRequestPremiumPoints, player->getID());
But I think it is not the best way to do it. Maybe I should somehow get this value from iologindata and provide it to the protocolgame.cpp somehow?
C++:
void ProtocolGame::sendPremiumPoints(uint32_t points)
{
NetworkMessage msg;
msg.addByte(0xF3); // Premium points response packet
msg.add<uint32_t>(points);
writeToOutputBuffer(msg);
}
I would appreciate any idea/suggestion in this case.
Thanks in advance all!