Jump to content

lecails

Members
  • Posts

    177
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by lecails

  1. Hello, I use a custom mangos so that follows is my fault however I don't understand how it's possible...

    If I create my mangos in release win32 mode, the loots don't work, my characters are blocked in "get loot mode"

    If I create my mangos in debug win32 mode, I can take the loot without problem.

    The project release is not the same as debug . Use the officiel repositery instead of custom .

  2. i had this database error

    2010-05-25 01:12:18 ERROR:[1742 ms] SQL: SELECT DISTINCT(ScriptName) FROM creature_template WHERE ScriptName <> '' UNION SELECT DISTINCT(ScriptName) FROM gameobject_template WHERE ScriptName <> '' UNION SELECT DISTINCT(ScriptName) FROM item_template WHERE ScriptName <> '' UNION SELECT DISTINCT(ScriptName) FROM areatrigger_scripts WHERE ScriptName <> '' UNION SELECT DISTINCT(script) FROM instance_template WHERE script <> ''
    

    i dont know what this mean, anyone knows?

    Your query is too long and the time for executed is so long (1742 ms),try improve more precisely your query .

  3. I use Mangos 9933+Patches by KAPATEJIb + YTDB. And for me the server has started to use much more memory. Yesterday at 20 players it used to 600 Mb. Today at 9 players - to 800 Mb. Sometimes there is that that of type of reset of memory and the server starts to use from 50 Mb and again grows step-by-step. For extract of maps I used http://filekeeper.org/download/insider/vmaps_rewrite/Compiled%20Mangos/addition/333_vmaps_rewrite_extractor_9927.7z

    Forgive me for bad English и спасибо Карателю за сборки ;)

    Have you enable vmap.indoorCheckInterval in mangosd.conf ?

  4. This is DB related,

    an idea to check additionly: do you already have this quest (.lookup <questname> with target yourself) and also: do you have the PrevQuest - and do you not have the follow-quest

    I already remove previous quest and follow quest and other, its not work , I check and recheck and its not in the quest side , I have added a working quest on the npc and its not work too.

    So , I would know if there is a possible conflict whith npc flag and other misc ?

  5. I have found for you the sql query, you need just insert online field in the two sql query (declined name and whithout):

    In characterHandler.cpp

    void WorldSession::HandleCharEnumOpcode( WorldPacket & /*recv_data*/ )
    {
       /// get all the data necessary for loading all characters (along with their pets) on the account
       CharacterDatabase.AsyncPQuery(&chrHandler, &CharacterHandler::HandleCharEnumCallback, GetAccountId(),
            !sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED) ?
       //   ------- Query Without Declined Names --------
       //           0               1                2                3                 4                  5                       6                        7
           "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
       //   8                9               10                     11                     12                     13                    14
           "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
       //  15                    16                   17                     18                   19
           "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache "
           "FROM characters LEFT JOIN character_pet ON characters.guid=character_pet.owner AND character_pet.slot='%u' "
           "LEFT JOIN guild_member ON characters.guid = guild_member.guid "
           "WHERE characters.account = '%u' ORDER BY characters.guid"
           :
       //   --------- Query With Declined Names ---------
       //           0               1                2                3                 4                  5                       6                        7
           "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
       //   8                9               10                     11                     12                     13                    14
           "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
       //  15                    16                   17                     18                   19                         20
           "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, character_declinedname.genitive "
           "FROM characters LEFT JOIN character_pet ON characters.guid = character_pet.owner AND character_pet.slot='%u' "
           "LEFT JOIN character_declinedname ON characters.guid = character_declinedname.guid "
           "LEFT JOIN guild_member ON characters.guid = guild_member.guid "
           "WHERE characters.account = '%u' ORDER BY characters.guid",
           PET_SAVE_AS_CURRENT, GetAccountId());
    }

    After add a condition (if online = 2 set to 0) in the void bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data ) in player.cpp as i say in the reply above.

  6. WorldSession.cpp

    //No SQL injection as AccountId is uint32
    -        CharacterDatabase.PExecute("UPDATE characters SET online = 0  WHERE account = '%u'",
    +        CharacterDatabase.PExecute("UPDATE characters SET online = 2 WHERE account = '%u'",
               GetAccountId());
           DEBUG_LOG( "SESSION: Sent SMSG_LOGOUT_COMPLETE Message" );

    I think , the loading part is in characterHandler.cpp more precisly in player.cpp:

    bool Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
    {
       //             0               1                2                3                 4                  5                       6                        7
       //    "SELECT characters.guid, characters.name, characters.race, characters.class, characters.gender, characters.playerBytes, characters.playerBytes2, characters.level, "
       //     8                9               10                     11                     12                     13                    14
       //    "characters.zone, characters.map, characters.position_x, characters.position_y, characters.position_z, guild_member.guildid, characters.playerFlags, "
       //    15                    16                   17                     18                   19                         20
       //    "characters.at_login, character_pet.entry, character_pet.modelid, character_pet.level, characters.equipmentCache, character_declinedname.genitive "
    
       Field *fields = result->Fetch();
    
       uint32 guid = fields[0].GetUInt32();
       uint8 pRace = fields[2].GetUInt8();
       uint8 pClass = fields[3].GetUInt8();
    
       PlayerInfo const *info = sObjectMgr.GetPlayerInfo(pRace, pClass);
       if(!info)
       {
           sLog.outError("Player %u has incorrect race/class pair. Don't build enum.", guid);
           return false;
       }
    
       *p_data << uint64(MAKE_NEW_GUID(guid, 0, HIGHGUID_PLAYER));
       *p_data << fields[1].GetString();                       // name
       *p_data << uint8(pRace);                                // race
       *p_data << uint8(pClass);                               // class
       *p_data << uint8(fields[4].GetUInt8());                 // gender
    
       uint32 playerBytes = fields[5].GetUInt32();
       *p_data << uint8(playerBytes);                          // skin
       *p_data << uint8(playerBytes >> 8);                     // face
       *p_data << uint8(playerBytes >> 16);                    // hair style
       *p_data << uint8(playerBytes >> 24);                    // hair color
    
       uint32 playerBytes2 = fields[6].GetUInt32();
       *p_data << uint8(playerBytes2 & 0xFF);                  // facial hair
    
       *p_data << uint8(fields[7].GetUInt8());                 // level
       *p_data << uint32(fields[8].GetUInt32());               // zone
       *p_data << uint32(fields[9].GetUInt32());               // map
    
       *p_data << fields[10].GetFloat();                       // x
       *p_data << fields[11].GetFloat();                       // y
       *p_data << fields[12].GetFloat();                       // z
    
       *p_data << uint32(fields[13].GetUInt32());              // guild id
    
       uint32 char_flags = 0;
       uint32 playerFlags = fields[14].GetUInt32();
       uint32 atLoginFlags = fields[15].GetUInt32();
       if(playerFlags & PLAYER_FLAGS_HIDE_HELM)
           char_flags |= CHARACTER_FLAG_HIDE_HELM;
       if(playerFlags & PLAYER_FLAGS_HIDE_CLOAK)
           char_flags |= CHARACTER_FLAG_HIDE_CLOAK;
       if(playerFlags & PLAYER_FLAGS_GHOST)
           char_flags |= CHARACTER_FLAG_GHOST;
       if(atLoginFlags & AT_LOGIN_RENAME)
           char_flags |= CHARACTER_FLAG_RENAME;
       if(sWorld.getConfig(CONFIG_BOOL_DECLINED_NAMES_USED))
       {
           if(!fields[20].GetCppString().empty())
               char_flags |= CHARACTER_FLAG_DECLINED;
       }
       else
           char_flags |= CHARACTER_FLAG_DECLINED;
    
       *p_data << uint32(char_flags);                          // character flags
       // character customize flags
       *p_data << uint32(atLoginFlags & AT_LOGIN_CUSTOMIZE ? CHAR_CUSTOMIZE_FLAG_CUSTOMIZE : CHAR_CUSTOMIZE_FLAG_NONE);
       // First login
       *p_data << uint8(atLoginFlags & AT_LOGIN_FIRST ? 1 : 0);
    
       // Pets info
       {
           uint32 petDisplayId = 0;
           uint32 petLevel   = 0;
           uint32 petFamily  = 0;
    
           // show pet at selection character in character list only for non-ghost character
           if (result && !(playerFlags & PLAYER_FLAGS_GHOST) && (pClass == CLASS_WARLOCK || pClass == CLASS_HUNTER || pClass == CLASS_DEATH_KNIGHT))
           {
               uint32 entry = fields[16].GetUInt32();
               CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry);
               if(cInfo)
               {
                   petDisplayId = fields[17].GetUInt32();
                   petLevel     = fields[18].GetUInt32();
                   petFamily    = cInfo->family;
               }
           }
    
           *p_data << uint32(petDisplayId);
           *p_data << uint32(petLevel);
           *p_data << uint32(petFamily);
       }
    
    
       Tokens data = StrSplit(fields[19].GetCppString(), " ");
       for (uint8 slot = 0; slot < EQUIPMENT_SLOT_END; slot++)
       {
           uint32 visualbase = slot * 2;
           uint32 item_id = GetUInt32ValueFromArray(data, visualbase);
           const ItemPrototype * proto = ObjectMgr::GetItemPrototype(item_id);
           if(!proto)
           {
               *p_data << uint32(0);
               *p_data << uint8(0);
               *p_data << uint32(0);
               continue;
           }
    
           SpellItemEnchantmentEntry const *enchant = NULL;
    
           uint32 enchants = GetUInt32ValueFromArray(data, visualbase + 1);
           for(uint8 enchantSlot = PERM_ENCHANTMENT_SLOT; enchantSlot <= TEMP_ENCHANTMENT_SLOT; ++enchantSlot)
           {
               // values stored in 2 uint16
               uint32 enchantId = 0x0000FFFF & (enchants >> enchantSlot*16);
               if(!enchantId)
                   continue;
    
               if ((enchant = sSpellItemEnchantmentStore.LookupEntry(enchantId)))
                   break;
           }
    
           *p_data << uint32(proto->DisplayInfoID);
           *p_data << uint8(proto->InventoryType);
           *p_data << uint32(enchant ? enchant->aura_id : 0);
       }
    
       *p_data << uint32(0);                                   // bag 1 display id
       *p_data << uint8(0);                                    // bag 1 inventory type
       *p_data << uint32(0);                                   // enchant?
       *p_data << uint32(0);                                   // bag 2 display id
       *p_data << uint8(0);                                    // bag 2 inventory type
       *p_data << uint32(0);                                   // enchant?
       *p_data << uint32(0);                                   // bag 3 display id
       *p_data << uint8(0);                                    // bag 3 inventory type
       *p_data << uint32(0);                                   // enchant?
       *p_data << uint32(0);                                   // bag 4 display id
       *p_data << uint8(0);                                    // bag 4 inventory type
       *p_data << uint32(0);                                   // enchant?
    
       return true;
    }

    You need analyse the code and insert into the sql query in top, online check then a condition for characters whith online='2' to set '0' .The better spot is just after the sql SELECT query and fetch array , just check if the field online is '2' set to '0' and continue .

  7.          data << uint8(0);                                   // new 2.4.0
            data << uint32( pzoneid );                          // player zone id
    
    -        // 50 is maximum player count sent to client
    -        if ((++clientcount) == 50)
    -            break;
    -    }
    
    -    uint32 count = m.size();
    -    data.put( 0, clientcount );                             // insert right count, listed count
    -    data.put( 4, count > 50 ? count : clientcount );        // insert right count, online count
    +    data.put( 0, clientcount );        // insert right count, listed count
    +    data.put( 4, clientcount );        // insert right count, online count
    

    I think you dnt need change this .

  8. if I get what you mean right...why not just create couple of characters which will not be used by anyone and set online=2 (doesn't have to be 1 just different from 0)

    Its a simple possibility to create couple of characters , but the goal is not the simplicity ,you need stuff your fake characters its take more time and at the end , the real player will see that couple of characters are fake because if its all the time the same characters are online and in the same zone (player say : they don't move?),the same level, i think we must choose between simplicity:basic way or difficulty but advanced way . With difficulty way , the fakeplayers are true player so they move zone change ,level change ,stuff change whithout that you lost more time . I will help you as soon as I have time , its a good project :D .

    Best regards

  9. I hav'nt test yet your patch but I test a small modification i have just put 1 in field online for 1 real character , I know that this characters will not show in who list but there is as i say a bug , when you try to login the client block on loading characters , I think online = 2 for difference between fake player and true in db and whith online = 2 you can modify properly for loading characters, create just a condition in loading characters part whith sql query for check online = 2 in this case sql query to put online = 0.

  10. still I dont know if this is gonna work because of

    HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
       for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)

    test it before and if it dosnt work he just need a exeption wich jump this code .

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