Jump to content

tsecurity & psecurity


Guest filo

Recommended Posts

Hello, I need clarify different between psecurity & tsecurity:

Player *player = objmgr.GetPlayer(to.c_str());
           uint32 tSecurity = GetSecurity();
           uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
           if (!player || (tSecurity == SEC_PLAYER && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
           {
               WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
               data<<to;
               SendPacket(&data);
               return;
           }

           if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity == SEC_PLAYER && pSecurity == SEC_PLAYER )
           {
               uint32 sidea = GetPlayer()->GetTeam();
               uint32 sideb = player->GetTeam();
               if( sidea != sideb )
               {
                   WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
                   data<<to;
                   SendPacket(&data);
                   return;
               }
           }

Becouse I create these account types:

0-sec_player

1-sec_donator

2-sec_moderator

...

->I must replace tSecurity == SEC_PLAYER for tSecurity <= SEC_MODERATOR its true?

Thanks a lot ;-)

Link to comment
Share on other sites

Becouse I create new account type (sec_donator = 1), and I need edit code for it.

Becouse, when I disable two side interraction chat in config, accounts with gmlevel 1 (sec_donator), will be able to chat with opposite side, and this I do not want.

OK, I edit code like this:

Player *player = objmgr.GetPlayer(to.c_str());
           uint32 tSecurity = GetSecurity();
           uint32 pSecurity = player ? player->GetSession()->GetSecurity() : SEC_PLAYER;
           if (!player || (tSecurity <= SEC_MODERATOR && pSecurity > SEC_PLAYER && !player->isAcceptWhispers()))
           {
               WorldPacket data(SMSG_CHAT_PLAYER_NOT_FOUND, (to.size()+1));
               data<<to;
               SendPacket(&data);
               return;
           }

           if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && tSecurity <= SEC_MODERATOR && pSecurity == SEC_PLAYER )
           {
               uint32 sidea = GetPlayer()->GetTeam();
               uint32 sideb = player->GetTeam();

Its true?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use