Jump to content
×
×
  • Create New...

Drop Item's Destroy Time Info


Recommended Posts

  • Honorable Member

Download
Metin2 Download

 

Hidden Content

    Give reaction to this post to see the hidden content.

2819150UYZqLT.png

 

Me and @Gurgarath tested it on windows server, we didn't see any problem.

If you have a problem with time(_t) or another bug, let me know so I can fix it.

Idea is from Sogma

  • Metin2 Dev 44
  • Eyes 2
  • Love 31
  • Love 6
  • Good 15
  • Think 1
  • Confused 1
  • Sad 1
  • Dislove 1
Link to comment
Share on other sites

  • Bot
3 minutes ago, ReFresh said:

@ Cryptex Server source problem, it's just your fault. Check your server source files to find the real number of item destroy time. 

In my server the timer is 5 seconds I check 2 hours and everything is right like in the files 

english_banner.gif

Link to comment
Share on other sites

  • Moon
Posted (edited)

@ Cryptex Just search and use your brain, believe me, it's not too hard to find the functions. Sources are different, problem can be in configs in serverfiles too.

Spoiler
For dropped items without ownership
//item.h

void StartDestroyEvent(int iSec=300);

//item.cpp

void CItem::StartDestroyEvent(int iSec)

 

Edited by ReFresh

I'll be always helpful! 👊 

Link to comment
Share on other sites

  • Bot
Posted (edited)
10 hours ago, ReFresh said:

@ Cryptex Just search and use your brain, believe me, it's not too hard to find the functions. Sources are different, problem can be in configs in serverfiles too.

  Hide contents
For dropped items without ownership
//item.h

void StartDestroyEvent(int iSec=300);

//item.cpp

void CItem::StartDestroyEvent(int iSec)

 

is so hard to understand?.. i have everywhere 5 seconds and is the same.. it's show me 225 second.. 2 hours i spend to to be like in the tutorials... and is the same.

if i put 5 seconds it show me 225 seconds.. if i put 3 minutes (180seconds) it show me 335 seconds.. where is the problem ?

spacer.png

For dropped items without ownership 

//item.h 

void        StartDestroyEvent(int iSec=5);

//item.cpp

void CItem::StartDestroyEvent(int iSec)
{
    if (m_pkDestroyEvent)
        return;

    item_event_info* info = AllocEventInfo<item_event_info>();
    info->item = this;

    SetDestroyEvent(event_create(item_destroy_event, info, PASSES_PER_SEC(iSec)));
    TPacketGCItemDestroyTime p;
    p.bHeader = HEADER_GC_ITEM_DESTROY_TIME;
    p.dwVID = m_dwVID;
    p.tDestroyTime = tDestroyTime = time(0) + iSec;
    PacketAround(&p, sizeof(p));
}

//char_item.cpp

pkItemToDrop->StartDestroyEvent(5);

Edited by Cryptex
  • Good 1

english_banner.gif

Link to comment
Share on other sites

  • Moderator
Posted (edited)

Cryptex is right, it is not properly working on FreeBSD, it is working perfectly fine on Windows though. He will have 225 seconds displayed but the item will vanish after 5. You can also see it above in the thread. It's most likely a time_t mismatch

Edited by Gurgarath

Gurgarath
coming soon

Link to comment
Share on other sites

  • Bot
6 minutes ago, Gurgarath said:

Cryptex is right, it is not properly working on FreeBSD, it is working perfectly fine on Windows though. He will have 225 seconds displayed but the item will vanish after 5. You can also see it above in the thread. It's most likely a time_t mismatch

So, what can we do ?

english_banner.gif

Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.