• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ parsing groupID(TFS)

jestem pro

That is the question
Joined
Apr 20, 2013
Messages
650
Solutions
14
Reaction score
87
Hello, my dears. I wanna parse groupID(coz OTClient doesn't have this).
And I stuck in game.cpp(last what must be added)

C++:
void Game::parsePlayerGroupID(uint32_t playerId, uint8_t groupID)
{
Player* player = getPlayerByID(playerId);
if(player || player->isRemoved())
return;

Group* group = player->getGroupId(groupID);
?????????????????????????
}

This is extendedOpcode it's for an example:
C++:
[LIST=1]
[*]void Game::parsePlayerExtendedOpcode(uint32_t playerId, uint8_t opcode, const std::string& buffer
[*]{
[*]    Player* player = getPlayerByID(playerId);
[*]    if(!player || player->isRemoved())
[*]        return;
[*]

[*]    CreatureEventList extendedOpcodeEvents = player->getCreatureEvents(CREATURE_EVENT_EXTENDED_OPCODE);
[*]    for(CreatureEventList::iterator it = extendedOpcodeEvents.begin(); it != extendedOpcodeEvents.end(); ++it)
[*]       (*it)->executeExtendedOpcode(player, opcode, buffer);
[*]}
[/LIST]
But I really really really don't know how to make it :((

How to add that groupId(GOD, CM e.t.c)

Could someone tell me? it's so important for me.

Thank you

@edit
Has this the right to work how it should:
C++:
int32_t Game::parsePlayerGroupID(uint32_t playerId, uint8_t groupID)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved())
return 1;

return player->getGroupId();
}

But how put groupID in here coz int32_t doesnt want it in getGroupId(HERE)?
 
Last edited:
Nobody know how to add this fucking groupId in the script above?

in protocolgame.cpp I use addbyte (0xF2)
I dont really know what this number means but was free.

In OTClient side everthing should be fine. Only that one.
 
I would like to think that you're making this more complicated than it needs to be. You can send a player's group ID through sendBasicData (TFS), and pick it up with parsePlayerInfo (OTC). Don't forget to add an enum for the group IDs ;)
 
I would like to think that you're making this more complicated than it needs to be. You can send a player's group ID through sendBasicData (TFS), and pick it up with parsePlayerInfo (OTC). Don't forget to add an enum for the group IDs
yea now you complicated my life :)

Ok in OTClient side I understand what you said but "sendBasicData"? What the hell is it?

@edit
enum added, and in parsePlayerInfo
int groupAccess = msg->getU8 ();

but how to include it further? I dont know xd in OTC
 
Last edited:
in protocolgame.cpp in AddPlayerStats I have:

C++:
    msg->AddByte(player->getPlayerInfo(PLAYERINFO_GROUPID));

in OTClient in parsePlayerStats:
C++:
int groupId = msg->getU8(); // groupId

In TFS there isn't parsePlayerInfo maybe AddCreature?
but in OTClient there is parsePlayerInfo.

And looking at this really I don't know how it works together.
 
Back
Top