reset()

18 views
Skip to first unread message

Austin Holloway

unread,
Oct 13, 2023, 10:34:55 PM10/13/23
to LDMud Talk
In my mud, reset() is being called every 2s (heartbeat frequency).

I would like reset() to be called on an object upon creation (compat mode)
And reset(1) called every so often.

I can run command-line param such as:
--reset-time 120
But that only waits 120 ticks until reset is called the FIRST time, then it is called every 2s again after that.

Could be a bug in the code. While I savvy in LPC, my C skills are not as up-to-date and I don't know how the driver does the code so I can't see if there is a bug.

Is there a better way to do this on objects?

Thanks,
Austin


Stephan Weinberger

unread,
Oct 14, 2023, 3:11:30 AM10/14/23
to ldmud...@googlegroups.com
Hi Austin,

The driver will use the return value to determine the delay to the next
call:

        If the result of this call is a positive number, it is used as
        the interval to wait before the next reset(). If the result
        is 0, the default interval computed from TIME_TO_RESET is
        used. If the result is a negative number, the object will not
        be reset again, unless directed otherwise by set_next_reset().

(see https://github.com/ldmud/ldmud/blob/master/doc/hook/reset)

do you return 2 in your reset()? Or is it maybe called from heart_beat()
in your lib?

hth,
  Stephan
> --
> You received this message because you are subscribed to the Google
> Groups "LDMud Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ldmud-talk+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ldmud-talk/8d474c21-1472-4947-93eb-935115d9325cn%40googlegroups.com
> <https://groups.google.com/d/msgid/ldmud-talk/8d474c21-1472-4947-93eb-935115d9325cn%40googlegroups.com?utm_medium=email&utm_source=footer>.


Austin Holloway

unread,
Oct 20, 2023, 11:14:25 PM10/20/23
to LDMud Talk
This is very helpful! Thanks!
Reply all
Reply to author
Forward
0 new messages