Jump to content

ErNabbone

Inactive Member
  • Posts

    14
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Posts posted by ErNabbone

  1. It seems like all characters's methods are undefined in offlineshop_manager.cpp;
    You can try looking for the .cpp module where CHARACTER's methods are defined and including it in "offlineshop_manager.cpp".

    I can't check its name right now but it should be something like "char.cpp".

    In the offlineshop_manager.cpp's header add

    #include "char.cpp"

     

    [€dit]: I suggest you to examine all errors and warnings generated, like "this decimal constant is unsigned only in ISO C90" (add "u" suffix to all unsigned initializations) or other references error like the last one including the char's methods module where you found "undefined reference to `CHARACTER::*"

  2. Update ports first (type #portsnap fetch update);
    after you may try to make reinstall in per15.18-5.18.4_22 port doing so:
    move your self in the per15 directory (should be /usr/ports/lang/per15.18) and "make reinstall" to upgrade it.

    If it doesn't works, you can try to "make deinstall" on the per15 dir. and then to re-try to install mysql too.

  3.  

               if map == 1 or map == 3 or map == 21 or map == 23 or map == 41 or map == 43 then
    
    	 
    
    	                local sub_set = 0
    
    	 
    
    	                if pc.get_level() >= 10 then
    
    	            local CTRL = true
    
    	            while(CTRL) do
    
    	                    sub_set = select("Údolí orků ", "Velká poušť ", "Ledová země ", "DALŠÍ OBLASTI ","ZRUŠIT ")
    
    	                    if sub_set == 5 then
    
    	                        return
    
    	                        notice("Teleportér: Tak zatím nashledanou.")
    
    	                    end
    
    	                    if sub_set == 4 then
    
    	                        say_title(mob_name(npc.get_race())..": ")
    
    	                        say_size(350,380)
    
    	                        say("Tak kam tě mám přesunout?")
    
    	                        say_reward("Cena za přesun je "..cost.." Yangů. ")
    
    	                        sub_set = select("Ohnivá země ", "Zelený les", "Červený les", "Červený les", "Červený les", "Červený les", "Červený les", "ZRUŠIT")
    
    	                        if sub_set == 4 then
    
    	                            return
    
    	                            notice("Teleportér: Tak zatím nashledanou.")
    
    	                        end
    
    	            end
    
    	                    end
    
    	                end
    
     

    Take a look at the sub_set index: the second choice will replace the first; you should update the sub_set index:

    "sub_set = select("Ohnivá země ", "Zelený les", "Červený les", "Červený les", "Červený les", "Červený les", "Červený les", "ZRUŠIT")+5"

     

    So you'll can use sub_set[a] where { a=>1 & a<=5 } means the answers in the first select(), and { a => 6 & a <=13} will represent the second selection function.

    NOTE: You'll need to add "CTRL = false" where you want to break the cycle (f.e., if {sub_set => 1 and sub_set<=3} or {sub_set => 6 and sub_set <= 12} then CTRL = false end), otherwise you'll follow in a loop.

     

    [€dit]: if you want an assembly-like code, you can use the goto token, user documented here.

     

    Example:

    local x = 3
    local y = 5
    
    ::restart::
    
    if (x+3y) < 100 then
    
                   x = x+1
                   y = y+1
                   
                   goto restart
    
    else
    
                   print("now x+3y is >= than 100")
                   
    end

     


     

  4. Hello guys!

    To start I'd like to apologize for my bad english; sooner or later I'll improve it :D

    I'm not new to C++ but I never played much with metin2 server sources.
    Yesterday I was developing a little script in game/party.cpp, in the end of the function "void CParty::P2PJoin(DWORD)", where I need to store all party's Players ID.

    I get an error on a CParty method: "no matching function for call to 'CParty::ForEachOnlineMember(CParty::P2PJoin(DWORD)::FPartyPIDCollector&, long int)'";

    It's like I wouldn't initialized that function but I already included the header "party.h", where that (public) method is declared in the CParty class as "template <class Func> void ForEachOnlineMember(Func & f);" and where it is also defined as follow:

    template <class Func> void CParty::ForEachOnlineMember(Func & f)
    
    	{
    
    	   TMemberMap::iterator it;
       for (it = m_memberMap.begin(); it != m_memberMap.end(); ++it)
         if (it->second.pCharacter)
           f(it->second.pCharacter);
    }
    


    The critical section of my code is...

    [...]
    	LPCHARACTER leader = CHARACTER_MANAGER::instance().FindByPID(pid);
    
    	if (leader && leader->GetDesc())
    
    	 {
    
    	   LPPARTY pParty = leader->GetParty();
    
    	   if (pParty) {
    
    	        struct FPartyPIDCollector // <- thanks to "Dash" @metin2dev.org for this struct
    
    	         {
    
    	         std::vector <DWORD> vecPIDs;
    
    	         FPartyPIDCollector() {}
    
    	         void operator () (LPCHARACTER ch)
    
    	         {
    
    	             vecPIDs.push_back(ch->GetPlayerID());
    
    	         }
    
    	         };
    
    	        FPartyPIDCollector f;
    
    	        pParty->ForEachOnlineMember(f);
        [...]
       }
      [...]
    }
    
    


    I'm almost sure that it's just a noobs thing, but I really can't understand what's the reason of this error u.u
    Maybe are there differences between CParty and LPPARTY?



    Best regards,
    Erich

  5. Ok, this time the error is
    db.cpp: At global scope:
    db.cpp:142: error: redefinition of 'void DBManager::ReturnQuery(int, DWORD, void*, const char*, ...)'
    db.cpp:112: error: 'void DBManager::ReturnQuery(int, DWORD, void*, const char*, ...)' previously defined here
    db.cpp:162: error: redefinition of 'SQLMsg* DBManager::PopResult()'
    db.cpp:132: error: 'SQLMsg* DBManager::PopResult()' previously defined here

    so I was wrong supposing that the 2nd function name is "DBManager::ReturnQuery":

     

    43 minutes ago, ErNabbone said:

    But I don't know which function is this:

    (should be "void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...)" but I'm not sure)

     

    
    {
    
    	    char szQuery[4096];
    
    	    va_list args;
    
    
     va_start(args, c_pszFormat);
        vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
        va_end(args);
    
        return m_sql_direct.DirectQuery(szQuery);
    }

     

     

    But there is also another similiar error here:
    db.cpp:162: error: redefinition of 'SQLMsg* DBManager::PopResult()'
    db.cpp:132: error: 'SQLMsg* DBManager::PopResult()' previously defined here

     

     

    Don't you have a previous backup?

    • Love 1
  6. So, you forgot the function names:

     

    {
    
    	char szQuery[4096];
    
    	va_list args;
        va_start(args, c_pszFormat);
        vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
        va_end(args);
    
        m_sql.AsyncQuery(szQuery);
    }
    
    


    Should be "void DBManager::Query(const char * c_pszFormat, ...)".
     


    But I don't know which function is this:

    (should be "void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...)" but I'm not sure)

     

    {
    
    	    char szQuery[4096];
    
    	    va_list args;
    
    
     va_start(args, c_pszFormat);
        vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
        va_end(args);
    
        return m_sql_direct.DirectQuery(szQuery);
    }

      

    If it's like I do suppose, you should replace 95's from "{" to "void DBManager::Query(const char * c_pszFormat, ...) {" and the 116's even from "{" to "void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...) {".

    • Love 1
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.