Jump to content

Draveniou1

Active Member
  • Posts

    252
  • Joined

  • Last visited

  • Days Won

    2
  • Feedback

    100%

Posts posted by Draveniou1

  1. 1 hour ago, Gurgarath said:

    Understand that it has nothing to do with the Lycan. Check my post and Trial's to see that this is unrelated with Lycan. Syreldar clearly summed up what I said in my post in 3 lines.

    The default value on some mounts create this issue with the TP check, and I don't feel comfortable with the server having default values when some monsters have specific accumulation values. It makes every server check mismatching with the client (you see a monster on (X, Y) coordinate while for the server it is at (X-10, Y+20) for example). This is what I meant by "undefined behavior". The game is intended to be populated with data matching the client.

    I am glad it helped 😄

     

    My msm gr2 data is working perfect with mob_proto i not see problems... and i have again this problem  why? all files are correct

  2. 36 minutes ago, Syreldar said:

    Place the correct files in the data folder serverside of the monster to fix, take them from the client.

    Then assign the monster to that folder in the mob_proto, and the problem is gone.

    There is no need to use c++ or weird workarounds for this.

    I know that

    but it never worked on my server I tried thousands of times

  3. Sorry i can't test for lycan

    for me working 100% without bug or problems 

    please check up thanks brothers

    4 hours ago, Gurgarath said:

    Hello,

    I am not convinced by any of these fixes. Removing folders and mob_proto data will cause undefined behavior when it comes to server checks and PVE scenario. Calling "UpdateSectree" at every of your movement tick when riding a mount is the best way of making your server use way more resources than it should, for instance, use a ChatPacket to see how often Move() is called, now imagine that for UpdateSectree.

    I personally got rid of every of my issues like this (and I think it is a good read):

    And on the one hand, Trial's post is also really interesting and it is a good idea to add his solution as well.

     

    my server not have lycan i not have test with lycan

  4.  

     

    1) my msm gr2 server_client all ready good working

    2) data/client msm/gr2/etc all ready good working

    i have this bug on 2023 again and again

    on my pc with anydesk 5 develope from france for see this problem

     

    We fixed it (temporarily)

    My server working BEST without bug mount

    (temporarily for find an even better fix)

     

    1) OPEN  INPUT_MAIN
      
    2) SEARCH:
    
    	const float fDist = DISTANCE_SQRT ((ch->GetX() - pinfo->lX) / 100, (ch->GetY() - pinfo->lY) / 100);
    	if (((false == ch->IsRiding() && fDist > 750) || fDist > 999) && OXEVENT_MAP_INDEX != ch->GetMapIndex())
    	{
    		sys_log (0, "MOVE: %s trying to move too far (dist: %.1fm) Riding(%d)", ch->GetName(), fDist, ch->IsRiding());
    		ch->Show (ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
    		ch->Stop();
    		return;
    	}
    
    3) ADD AFTER
    
    	if (true == ch->IsRiding())
    	{
    		ch->UpdateSectree();
    	}

     

     

     

     

     

     

     

     

     

     

  5. 2 minutes ago, Syreldar said:

    wdym?

    As you can read, the change I made adds an arg to the RemoveAffect function.

    The purpose of this arg is to make the func call behave differently based on an arbitrary condition, in this case we need to not execute the ComputePoints() call inside the function cause we need to only make it once, after all the good/bad affects have been cleared.

    I have already wrote why we need to do that in the topic, because ComputePoints() is a "heavy" function, and it will lag a big by itself, so calling it once per affect to clear is not only useless but is also what causes the lag we're talking about.

    I will test on these now and come back with newer ones

  6. 3 minutes ago, Syreldar said:

    Read my message again, if possible.

        if (single)
            if (AFFECT_REVIVE_INVISIBLE != pkAff->dwType)
                ComputePoints();
            else
                UpdatePacket();
        else
            UpdatePacket();

     

    Why are there 2 NULL? if it is suddenly activated to true what will happen?

  7. 1 minute ago, Syreldar said:

    The change I posted has been tested on default mainlines, like all the releases I made.

    Also, I believe the code I changed is the same on every rev that has been leaked 9 years ago.

    In short, there's nothing wrong with my release.

    i know your fix is ok as we give a chance to add people who have had such problems to their files 

    some don't want mainline or main sources

    I never said that your solution is not good I have seen these errors on 20 small servers Also the solution I suggested has already helped some people

  8. 4 minutes ago, Syreldar said:

    I made 2 .gifs after coding the fix, you can find them in the topic.

    It shows that warrior skills clear just fine.

    You didn't understand, for example some serverfiles don't accept your fix 

    I have added your fix to some server files and there are problems 

    check video for you see problem .gif

     

    this problem exists in many servers 

    but your solution is still the best as long as you find the serverfiles to match it

    @ SyreldarFor example  download fliege serverfiles or another serverfiles and check your fix with your method and the my method and you see

  9. Just now, Syreldar said:

    The fix i posted has been thoroughly tested by many users, myself included.

    There's no problem whatsoever, but feel free to use whatever suits you best.

    i have your fix  i have  problem's

    1o problem = warrior skill not clear  why?

    2o problem = if have pottion stackable why ?

     

    i don't know and in another serverfiles have game.core 

    i have remade your fix and it works on all server files without problems this

  10. const std::vector<WORD> BadAffects =
    {
    	AFFECT_FIRE,
    	AFFECT_POISON,
    	AFFECT_STUN,
    	AFFECT_SLOW,
    	SKILL_TUSOK
    };
    
    void CHARACTER::RemoveBadAffect()
    {
    	for (auto it : BadAffects)
    	{
    		auto pkAff = FindAffect(it);
    		auto pkAffoff = RemoveAffect(it);
    		if (pkAff)
    		{
    			switch (it)
    			{
    				case AFFECT_FIRE:
    				{
    					event_cancel(&m_pkFireEvent);
    					break;
    				}
    				case AFFECT_POISON:
    				{
    					event_cancel(&m_pkPoisonEvent);
    					break;
    				}
    				pkAffoff;
    				break;
    			}
    		}
    	}
    
    	ComputePoints();
    	UpdatePacket();
    }
    
    
    
    ---------------------------------------
      ---------------------------------
      ---------------------------------
      const std::vector<WORD> GoodAffects =
    {
    	AFFECT_MOV_SPEED,
    	AFFECT_ATT_SPEED,
    	AFFECT_STR,
    	AFFECT_DEX,
    	AFFECT_INT,
    	AFFECT_CON,
    	AFFECT_CHINA_FIREWORK,
    	SKILL_JEONGWI,
    	SKILL_GEOMKYUNG,
    	SKILL_CHUNKEON,
    	SKILL_EUNHYUNG,
    	SKILL_GYEONGGONG,
    	SKILL_GWIGEOM,
    	SKILL_TERROR,
    	SKILL_JUMAGAP,
    	SKILL_MANASHILED,
    	SKILL_HOSIN,
    	SKILL_REFLECT,
    	SKILL_GICHEON,
    	SKILL_KWAESOK,
    	SKILL_JEUNGRYEOK
    };
    
    void CHARACTER::RemoveGoodAffect()
    {
    	for (auto it : GoodAffects)
    	{
    		auto pkAff = FindAffect(it);
    		auto pkAffofef = RemoveAffect(it);
    		if (pkAff)
    		{
    			pkAffofef;
    		}
    	}
    
    	ComputePoints();
    	UpdatePacket();
    }

    @ Gurgarath It can also be done like this

    It has not been tested, maybe I will test it soon

    I like it that way

     

  11. 4 minutes ago, Gurgarath said:

    Hello,

    Why would you do this? It is a less performant version of what Syreldar already shared.

    Thank you for your release however

    @ Syreldar  good fix  only have 2-5 problem's  with removed affect and stackable bonus i find full bug 

    I have configured his fix and it has been tested on quite a few people before it is published 

     

     

  12. Hello,

    In this I fixed several problems

    Now with the new method the problems have all been solved

    [Please it has been tested before publishing]

    1) OPEN char_affect.cpp
    search:
    void CHARACTER::RemoveBadAffect()
    {
      ..........
    }
    
    Change with:
    
    void CHARACTER::RemoveBadAffect()
    {
    	for (auto it = 0; it < SKILL_MAX_NUM; it++)
    	{
    		const CAffect * pkAff = FindAffect(it);
    		if (pkAff)
    		{
    			switch (it)
    			{
    				case AFFECT_FIRE:
    				{
    					RemoveAffect (AFFECT_FIRE);
    					event_cancel(&m_pkFireEvent);
    					break;
    				}
    				case AFFECT_POISON:
    				{
    					RemoveAffect (AFFECT_POISON);
    					event_cancel(&m_pkPoisonEvent);
    					break;
    				}
    				case AFFECT_STUN:
    				case AFFECT_SLOW:
    				case SKILL_TUSOK:
    				{
    					RemoveAffect (it);
    					break;
    				}
    			}
    		}
    	}
    
    	ComputePoints();
    	UpdatePacket();
    }
    
    --------------------
      ----------
    
    2. search:
    void CHARACTER::RemoveGoodAffect()
    {
      ..........
    }
    
    change with:
    
    void CHARACTER::RemoveGoodAffect()
    {
    	for (auto it = 0; it < SKILL_MAX_NUM; it++)
    	{
    		const CAffect * pkAff = FindAffect(it);
    		if (pkAff)
    		{
    			switch (it)
    			{
    				case AFFECT_MOV_SPEED:
    				case AFFECT_ATT_SPEED:
    				case AFFECT_STR:
    				case AFFECT_DEX:
    				case AFFECT_INT:
    				case AFFECT_CON:
    				case AFFECT_CHINA_FIREWORK:
    				case SKILL_JEONGWI:
    				case SKILL_GEOMKYUNG:
    				case SKILL_CHUNKEON:
    				case SKILL_EUNHYUNG:
    				case SKILL_GYEONGGONG:
    				case SKILL_GWIGEOM:
    				case SKILL_TERROR:
    				case SKILL_JUMAGAP:
    				case SKILL_MANASHILED:
    				case SKILL_HOSIN:
    				case SKILL_REFLECT:
    				case SKILL_GICHEON:
    				case SKILL_KWAESOK:
    				case SKILL_JEUNGRYEOK:
    				{
    					RemoveAffect (it);
    					break;
    				}
    			}
    		}
    	}
    
    	ComputePoints();
    	UpdatePacket();
    }

     

     

     

    (If you haven't solved the UpdatePacket and ComputePoints issues please don't use this method)

    (90% people have martysama and owsap serverfiles there is no problem)

     

    I worked many hours to fix all the problems from the fix @ Syreldar

    it has been tested before I publish it  (I Have test and in martysama serverfiles and in Owsap to be sure it will work properly)

     

    thanks you.

     

    • Metin2 Dev 1
    • Love 1
  13. 23 hours ago, PetePeter said:

    It's not about "normal" ways.
     

    1. You didn't add any return to the function after the player is kicked, so the rest of the function is executed normally
    2. You never reset the counter, it's only reset after a kick as the script continue his path and reach the "if (NewFixGuildCommente >= 3)" again
    3. (Optionnal) Consider using smart pointers (like std::unique_ptr) instead of raw pointers for better memory management and exception safety. I know the sql function is not made by you, but if we edit this function we can optimise everything also


     

    I don't want a timer

    if at the same time 90-160 players add the timer then the game that has low connection and you will send a message to the company to solve your problem 

    I have 50 methods with a timer, do you think I'm stupid not to set a timer? 

     

    one tip: Don't set timers to do something 

    Timer = lag's problem's server 

     

     

    He doesn't have a professional mind, man, we're dealing with you, speak for yourself -> 0% professionalism @PetePeter

     

    • kekw 3
  14. 2 hours ago, PetePeter said:

    Did you recheck your code ? Here is a possible solution:

     

    void CGuild::DeleteComment(LPCHARACTER ch, DWORD comment_id)
    {
        const int maxAttempts = 3;
        const int resetIntervalMinutes = 10;  // Change this to the desired interval in minutes
    
        time_t currentTime = time(0);
        int attempts = ch->GetQuestFlag("Newfixxed.Newguildcomment");
        time_t lastAttemptTime = ch->GetQuestFlag("Newfixxed.LastAttemptTime");
    
        // If the user's last attempt was longer than the reset interval ago, reset their attempts
        if (difftime(currentTime, lastAttemptTime) >= resetIntervalMinutes * 60)
        {
            attempts = 0;
        }
    
        // Check if the user has reached the maximum number of attempts
        if (attempts >= maxAttempts)
        {
            ch->GetDesc()->DelayedDisconnect(0);
            return;
        }
    
        std::unique_ptr<SQLMsg> pmsg;
    
        // Execute the appropriate query based on the user's guild grade
        if (GetMember(ch->GetPlayerID())->grade == GUILD_LEADER_GRADE)
        {
            pmsg.reset(DBManager::instance().DirectQuery("DELETE FROM guild_comment WHERE id = %u AND guild_id = %u", comment_id, m_data.guild_id));
        }
        else
        {
            pmsg.reset(DBManager::instance().DirectQuery("DELETE FROM guild_comment WHERE id = %u AND guild_id = %u AND name = '%s'", comment_id, m_data.guild_id, ch->GetName()));
        }
    
        uint32_t affectedRows = pmsg->Get()->uiAffectedRows;
    
        // Check if the comment was successfully deleted
        if (affectedRows == 0 || affectedRows == (uint32_t)-1)
        {
            ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 삭제할 수 없는 글입니다."));
        }
        else
        {
            RefreshCommentForce(ch->GetPlayerID());
        }
    
        // Update the user's attempt count and last attempt time
        ch->SetQuestFlag("Newfixxed.Newguildcomment", attempts + 1);
        ch->SetQuestFlag("Newfixxed.LastAttemptTime", currentTime);
    }

     

    I don't want to use time_t I prefer the normal one because if I wanted time I have 5000 solutions with times

    i will use the normal way is better

    • kekw 1
  15. for fix pstition

    2. Any character being automatically attacked by another character is unable to move, to run away or to attack (Pre-fix in Spoilers)

     

    there will be enough problems if a player has low internet ?

    how could this be solved with no short?  it's a fix I'm trying to make on my own server but I don't want to short and with this method

  16. 35 minutes ago, Megvagyokkoszi said:

    Its the free version. I don't want to pay, becuz i don't planed to open a server 

    Free = Better demon 

    you go buy for better and greater security

    if buy offlineshop not search people from turkey-romania-germany = not good method you buy from people arabic

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