Jump to content

xeross155

Members
  • Posts

    702
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by xeross155

  1. Hey Folks,

    I've implemented mangchat into my core recently and noticed the .online command (To list all online players) crashes the server, me and Zor have been trying to fix this for 6 hours now and we're both out of ideas what the problem could be.

    The git repository: http://github.com/xeross/mangos

    The full backtrace of all threads: http://lecowow.com/gdb.txt

    Things tried so far:

    • * Adding guards to the source (As you can see in last commit).
      * Removed Intel Memory allocator.

    Hope someone on here can help me fix this crash,

    Thank you for your time, Xeross

  2. I've been working on improving mangchat and recently tried to implement checking if the player is already in the autojoin channel. However the invite and check are executed before the player has joined any channels.

    Currently I've added the autojoin function call to the bottom of "WorldSession::HandlePlayerLogin". and my autojoin code is as follows.

    // this function should be called on player login WorldSession::HandlePlayerLogin
    void IRCClient::AutoJoinChannel(Player *plr)
    {
       if(ChannelMgr* cMgr = channelMgr(plr->GetTeam()))
       {
        if(Channel *chn = cMgr->GetChannel(sIRC.ajchan,plr))
    	    return;
       }
    
       // this will work if at least 1 player is logged in regrdless if he is on the channel or not
       // the first person that login empty server is the one with bad luck and wont be invited, 
       // if at least 1 player is online the player will be invited to the chanel
    
       std::string m_name = sIRC.ajchan;
       WorldPacket data;
       data.Initialize(SMSG_CHANNEL_NOTIFY, 1+m_name.size()+1);
       data << uint8(CHAT_INVITE_NOTICE);
       data << m_name.c_str();
    
       HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
       for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
       {
           if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
           {
               data << uint64(itr->second->GetGUID());
               break;
           }
       }
       plr->GetSession()->SendPacket(&data);
    }
    

    So the check should work but it seems it gets executed before a player joins the channels like Local etc.

    So does anyone know how to fix this help is very much appreciated and once it's working these changes will be released to the public.

    Thank you for your time, Xeross

  3. Hey Folks,

    I'm in the process of modifying mangchat (Will release a patch once done), 1 thing I dislike is everyone gets a prompt if they want tot join channel X if you enable the autojoin. I was wondering it it's possible to make people automatically join a channel without a prompt or anything.

    Current code for making em join is.

    void IRCClient::AutoJoinChannel(Player *plr)
    {
       //this will work if at least 1 player is logged in regrdless if he is on the channel or not
       // the first person that login empty server is the one with bad luck and wont be invited, 
       // if at least 1 player is online the player will be inited to the chanel
    
       std::string m_name = sIRC.ajchan;
       WorldPacket data;
       data.Initialize(SMSG_CHANNEL_NOTIFY, 1+m_name.size()+1);
       data << uint8(CHAT_INVITE_NOTICE);
       data << m_name.c_str();
    
       HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
       for(HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
       {
           if (itr->second && itr->second->GetSession()->GetPlayer() && itr->second->GetSession()->GetPlayer()->IsInWorld())
           {
               data << uint64(itr->second->GetGUID());
               break;
           }
       }
       plr->GetSession()->SendPacket(&data);
    }
    

    Thanks for your time, Xeross

  4. Hey,

    I am working on implementing mangchat on my test server.

    However after compiling, testing on windows, and pushing to my remote git repo I encountered an error. on linux the config didn't load, I further analyzed it and came to the conclusion I needed to edit the IRCConf.h.in file, however after that change being made when I compile I get the error IRCConf.h not found.

    So what do I need to do so my IRCConf.h.in gets parsed, SystemConfig.h.in does get parsed and saved to SystemConfig.h so what do I need to do so that it happens with IRCConf.h.in too ?

    Thank you for your time, Xeross

  5. Yep that's working as intended it checks for both GM and item.

    MailStationery mailType = (pl->isGameMaster() && pl->HasItemCount(18154, 1, false)) ? MAIL_STATIONERY_GM : MAIL_STATIONERY_NORMAL;
    

    As you can see pl->isGameMaster() and pl->hasItemCount() are both checked, I could make it only check for GM level and item so you don't need .gm on if you want.

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