Jump to content

Ruafo

Members
  • Posts

    51
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Ruafo

  1. I have a PHP website that I'm attempting to send commands via SOAP to the core. It has no problem handing commands like resetting password, etc.

    However when I try and send an item, I get:

    WorldSocket::handle_input_header: client sent malformed packet size = 20559 , cmd = 790647891
    

    Here is the command string I'm trying to send:

    send items TestPlayer1 "Items added" "Attached are the items you requested from the website" 2909:1
    

    That SHOULD send 1 Red Wool Bandana

    Any thoughts?

  2. Maybe this has been touched on before, for some reason I remember seeing it the old forums.

    Is it functionally realistic from a performance perspecitive to operate multiple realms from the same world DB? Obviously you need a separate character DB for each realm. But there isn't really anything being written to the world DB. Am I correct?

    Thanks

  3. Nope. Still not exactly right. Here is what I have after I modified what you gave me:

    //Transmit Achievement to IRC

    std::string irc_message = ("Player: %s achieved: %s",GetPlayer()->GetName(),achievement->name);

    std::string channel = std::string("#") + sIRC._irc_chan[sIRC.Status];

    sIRC.Send_IRC_Channel(channel, irc_message, irc_message, true);

    For reference, this is what I wrote for player.cpp to echo the level when someone achieves a new level. Not sure if that will help at all.

    char plevel [3];

    sprintf(plevel, "%u", level);

    std::string pname = GetName();

    std::string channel = std::string("#") + sIRC._irc_chan[sIRC.anchn].c_str();

    sIRC.Send_IRC_Channel(channel, "\\00311["+pname+"] : Has Reached Level: "+plevel, true);

    (Might be hard to believe, but I actually helped to develop MangChat. I'm Shinzon... I started the thread for it when mangos converted over to the new forum.)

  4. could you please post the definition of the Send_irc.... function aswell?

    Oh. Certainly:

    // Send a message to the specified IRC channel

    void Send_IRC_Channel(std::string sChannel, std::string sMsg, bool NoPrefix = false, std::string nType = "PRIVMSG");

    Lillecarl, You like a challenge don't you? Not the first time you've helped me. I have a lot of respect for your coding talents. I'm very strong with PHP, but C++ has always been more of a challenge for me.

  5. See above. Apparently I was editing the post while you posted. :)

    // broadcast realm first reached

    WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+1+8+4+4);

    data << GetPlayer()->GetName();

    data << GetPlayer()->GetObjectGuid();

    data << uint32(achievement->ID);

    data << uint32(0); // 1=link supplied string as player name, 0=display plain string

    //Transmit Achievement to IRC

    std::string pname = GetPlayer()->GetName();

    std::string a_title = achievement->name

    std::string channel = std::string("#") + sIRC._irc_chan[sIRC.Status];

    sIRC.Send_IRC_Channel(channel, "\\00311["+pname+"] : Has Achieved: "+a_title, true);

    sWorld.SendGlobalMessage(&data);

  6. I'm actually trying to output achievements for MangChat. So I am building the string for what will be broadcast into the IRC module.

    In Visual Studio when I try to get "name" for "achievement" (i.e. achievement->name ) using string I get "no suitable constructor exists". So, I know I'm not assembling it right, I just can't seem to get my head around 'how'.

    Here is the whole piece of code I'm working with (for reference):

    // broadcast realm first reached

    WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+1+8+4+4);

    data << GetPlayer()->GetName();

    data << GetPlayer()->GetObjectGuid();

    data << uint32(achievement->ID);

    data << uint32(0); // 1=link supplied string as player name, 0=display plain string

    //Transmit Achievement to IRC

    std::string pname = GetPlayer()->GetName();

    std::string a_title = achievement->name

    std::string channel = std::string("#") + sIRC._irc_chan[sIRC.Status];

    sIRC.Send_IRC_Channel(channel, "\\00311["+pname+"] : Has Achieved: "+a_title, true);

    sWorld.SendGlobalMessage(&data);

  7. I am working with AchievementMgr.cpp. This section in particular:

    // broadcast realm first reached

    WorldPacket data(SMSG_SERVER_FIRST_ACHIEVEMENT, strlen(GetPlayer()->GetName())+1+8+4+4);

    data << GetPlayer()->GetName();

    data << GetPlayer()->GetObjectGuid();

    data << uint32(achievement->ID);

    data << uint32(0); // 1=link supplied string as player name, 0=display plain string

    sWorld.SendGlobalMessage(&data);

    I want to extract the Player's name and the Achievement name as string values. I'm not certain on the code though.

    Can anyone verify if I'm on the right track?

    std::string pname = GetPlayer()->GetName();

    std::string atitle = achievement->name();

    NOTE: I know I am off base on the achievement name... but I think the player name will work. Thoughts?

  8. • I'm working on the "add", "del", "list" commands from IRCCmde.cpp that aren't working. I think I know what the problem is.

    Yeah, okay. That wasn't hard. You guys are missing part of the Database Structure. LOL!

    I'll post a patch soon.

  9. This hasn't been updated in awhile. I am back with mangos. TC made me mad. Here is an updated patch for the current mangosR2 rev (10:16am central time 2012-01-16)

    eventually I will figure out how to grab revision numbers. been awhile :)

    manngchat

    This has been patched on mangosR2 but should patch fine on mangos.

    LordPsyan, I'm actually Shinzon, the one who converted MangChat way back when. (been away from Mangos for a while)

    • I'm curious, why was the ACE priority set to high in the Master.cpp?

    //Start up MangChat

    ACE_Based::Thread irc(new IRCClient);

    irc.setPriority (ACE_Based::High);

    • I'm working on the "add", "del", "list" commands from IRCCmde.cpp that aren't working. I think I know what the problem is.

    • I also have created new code to announce achievements which I will post at some point soon.

  10. Ok, I guess I was wrong. I thought it worked... but I was wrong.

    Vlad,

    Here is my existing code. Is there anything wrong with it? The part in Green is the part I'm most concerned with. But maybe there is something else conflicting?

    {

    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)

    {

    uint32 p_team = _player->Player::GetTeam();

    uint32 t_team = target->Player::GetTeam();

    // Check that other player is same faction

    if (!(p_team == t_team))

    {

    SendSysMessage(LANG_NOTELE_OPPOSING_FACTION);

    SetSentErrorMessage(true);

    return false;

    }

  11. Ok, I'm trying develop a custom command for players. Similar to .goname but not exactly.

    Basically I want players to be able to goname each other, but not go to opposite factions.

    The problem I'm running into is for the life of me I can't figure out a good way to get the faction of the player and the target for comparison.

    Here is where I'm going with the code:

    uint8 p_race = _player->GetTeam();

    uint8 t_race = target->GetTeam();

    uint32 p_faction = Player::TeamForRace(p_race);

    uint32 t_faction = Player::TeamForRace(t_race);

    // Check that other player is same faction

    if (!p_faction == t_faction)

    {

    SendSysMessage(LANG_NOTELE_OPPOSING_FACTION);

    SetSentErrorMessage(true);

    return false;

    }

    but I know I'm not doing it right because I can still go to opposite factions. What's the best way to call each player's faction?

    (This is being created in the Level0.cpp file)

    Thank you in advance for any help you can offer

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