Jump to content

lillecarl

Members
  • Posts

    893
  • Joined

  • Last visited

  • Donations

    0.00 GBP 

Posts posted by lillecarl

  1. No problem! ;) Actually i think that you did try to make a uint32 value containing "NONE", "ALLIANCE" or "HORDE", maby if you put it into a string it would have worked to compare the variables, because as far as i know you can pus whatever possible data into a string ^^,

    Anyways, here is wikipedias explanation of the datatype enum and to e honest, i didnt understand everything there! xD

    http://en.wikipedia.org/wiki/Enumerated_type

  2. This should do it

    bool ChatHandler::HandleGonameCommand(char* args)
    {
       Player* target;
       ObjectGuid target_guid;
       std::string target_name;
       if (!ExtractPlayerTarget(&args, &target, &target_guid, &target_name))
           return false;
    
       Player* _player = m_session->GetPlayer();
       if (target == _player || target_guid == _player->GetObjectGuid())
       {
           SendSysMessage(LANG_CANT_TELEPORT_SELF);
           SetSentErrorMessage(true);
           return false;
       }
    
    
       if (target)
       {
           if (target->GetTeam() != _player->GetTeam())
               return false;
    
           // check online security
           if (HasLowerSecurity(target))
               return false;
    
           std::string chrNameLink = playerLink(target_name);
    
           Map* cMap = target->GetMap();
           if (cMap->IsBattleGroundOrArena())
           {
               // only allow if gm mode is on
               if (!_player->isGameMaster())
               {
                   PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str());
                   SetSentErrorMessage(true);
                   return false;
               }
               // if both players are in different bgs
               else if (_player->GetBattleGroundId() && _player->GetBattleGroundId() != target->GetBattleGroundId())
               {
                   PSendSysMessage(LANG_CANNOT_GO_TO_BG_FROM_BG,chrNameLink.c_str());
                   SetSentErrorMessage(true);
                   return false;
               }
               // all's well, set bg id
               // when porting out from the bg, it will be reset to 0
               _player->SetBattleGroundId(target->GetBattleGroundId(), target->GetBattleGroundTypeId());
               // remember current position as entry point for return at bg end teleportation
               if (!_player->GetMap()->IsBattleGroundOrArena())
                   _player->SetBattleGroundEntryPoint();
           }
           else if(cMap->IsDungeon())
           {
               // we have to go to instance, and can go to player only if:
               //   1) we are in his group (either as leader or as member)
               //   2) we are not bound to any group and have GM mode on
               if (_player->GetGroup())
               {
                   // we are in group, we can go only if we are in the player group
                   if (_player->GetGroup() != target->GetGroup())
                   {
                       PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str());
                       SetSentErrorMessage(true);
                       return false;
                   }
               }
               else
               {
                   // we are not in group, let's verify our GM mode
                   if (!_player->isGameMaster())
                   {
                       PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str());
                       SetSentErrorMessage(true);
                       return false;
                   }
               }
    
               // if the player or the player's group is bound to another instance
               // the player will not be bound to another one
               InstancePlayerBind *pBind = _player->GetBoundInstance(target->GetMapId(), target->GetDifficulty());
               if (!pBind)
               {
                   Group *group = _player->GetGroup();
                   // if no bind exists, create a solo bind
                   InstanceGroupBind *gBind = group ? group->GetBoundInstance(target->GetMapId(), target) : NULL;
                   // if no bind exists, create a solo bind
                   if (!gBind)
                   {
                       DungeonPersistentState *save = ((DungeonMap*)target->GetMap())->GetPersistanceState();
    
                       // if player is group leader then we need add group bind
                       if (group && group->IsLeader(_player->GetObjectGuid()))
                           group->BindToInstance(save, !save->CanReset());
                       else
                           _player->BindToInstance(save, !save->CanReset());
                   }
               }
    
               _player->SetDifficulty(target->GetDifficulty());
           }
    
           PSendSysMessage(LANG_APPEARING_AT, chrNameLink.c_str());
           if (needReportToTarget(target))
               ChatHandler(target).PSendSysMessage(LANG_APPEARING_TO, GetNameLink().c_str());
    
           // stop flight if need
           if (_player->IsTaxiFlying())
           {
               _player->GetMotionMaster()->MovementExpired();
               _player->m_taxi.ClearTaxiDestinations();
           }
           // save only in non-flight case
           else
               _player->SaveRecallPosition();
    
           // to point to see at target with same orientation
           float x,y,z;
           target->GetContactPoint(_player,x,y,z);
    
           _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
       }
       else
       {
           // check offline security
           if (HasLowerSecurity(NULL, target_guid))
               return false;
    
           std::string nameLink = playerLink(target_name);
    
           PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
    
           // to point where player stay (if loaded)
           float x,y,z,o;
           uint32 map;
           bool in_flight;
           if (!Player::LoadPositionFromDB(target_guid, map,x,y,z,o,in_flight))
               return false;
    
           return HandleGoHelper(_player, map, x, y, &z);
       }
    
       return true;
    }
    

    Just added this 2 lines on the first line after the if target bracket.

    if (target->GetTeam() != _player->GetTeam())

    return false;

    EDIT: Lol it should be == not != xD

    and as i can see it, the getteam function does not return a uint32 value, a simple hint when debugging is to just chat or slog your variables to the command executor, you will probably not get either 67 or 469 as feedback if you print those variables out.

    Look at the definition for m_team and then look at the definition of Team after that.

    // In fact !=0 values is alliance/horde root faction ids

    enum Team

    {

    TEAM_NONE = 0, // used when team value unknown or not set, 0 is also meaning that can be used !team check

    HORDE = 67,

    ALLIANCE = 469,

    };

    Idk what enum means really, but im sure it does not say uint32 to me, anyways you should never create a variable you do not need to use more then once! ;)

  3. I think the graveyards are fetched from DBC, but i think you can override the dbc values with the database values. But i do not think you can create new ones (This is just guessing since i have never actually done it, just read the code once quick while looking for alternatives to my server, but decided not to)

  4. how can you say its a problem that mangos hasn't had any updates for weeks?

    Most of these other "cores" are BASED off mangos, and every important feature IE warden, all get backported from mangos. Lets not forget mmaps too.

    Mangos is a learning project first and foremost, not to provide people with constant updates for their public servers.\\

    When it comes to real important implementations, I don't see anybody else releasing these apart from mangos.

    True Shithttp://s3.amazonaws.com/ragefaces/77e0fd22f2f37e0b78f2773be1efcc05.png[/img]

    Also, for example mangos were first with the implementation of achievements as i recall

  5. No there aint, then show me the code and give me the reason to why mangos would limit the account of connections from the same ip address? Imagine a LAN-Party? I had 9 simultaneous connections from the same ip address to my mangos server, and none of them were gamemaster accounts. There are no reason to why they would waste their time on coding such thing. It's not blizzlike, not usable for anything good etc... so that is a big no. Unless there are some config to enable/disable this feature.

  6. Could you share the 2.4.3 spellwork? I want to start learning "spellfixing", since it is the most game breaking thing, when a spell doesnt work

    EDIT: Also could you share your scriptdev fork if you happen to have any? Would be good to review and get the fixes into scriptdev2 "offy" :)

  7. Could we try to summit this?

    you got a setup like this?

    Server:

    External_Server (Hosted somewhere)

    Home Network:

    Router (Managing computer1 and computer2)

    computer1

    computer2

    If that is the case, then the problem is not related to mangos, because mangos accepts unlimited connections from the same ip address. If the server is on your home network like this:

    Home Network:

    Router

    Server and wow computer

    wow computer

    Then the problem might be that you bond your realmlist to 127.0.0.1 (Home) and that makes noone else able to log on to your server. There are probably some more scenarios, but i just want to get a clue about your setup.

    Also paste your configuration files on http://paste2.org and also paste the data of your "realmlist" database table and then link them here (But do not forget to change the config passwords so you dont get vurnerable)

  8. mangos is an educational project. This means, our primary interest is to learn and teach us and our users more about C++ project development in a large scale. Our software is not intended for running public servers, and we do not support that.

    First of all, 255 is something everyone on this forum probably hates 255 servers.

    But in battleground_template you can raise the max level to 255. If that doesnt work then "idk"

×
×
  • 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