Jump to content

  •  

Bug Tracker Migration

June 3rd
Good news everyone! The staff has decided that it is time to slowly kill off this Bug Tracker. We will begin the process of slowly migrating from this Bug Tracker over to our Github Issues which can be found here: https://github.com/HerculesWS/Hercules/issues

Over the next couple of days, I will be closing off any opportunity to create new reports. However, I still will keep the opportunity to reply to existing Bug Reports. Doing this will allow us to slowly fix any bug reports we have listed here so that we can easily migrate over to our Issue Tracker.

Update - June 7th 2015: Creating new bug posts has been disabled. Please use our https://github.com/HerculesWS/Hercules/issues tracker to post bugs. Users are still able to reply to existing bug posts.

- Administration

Issue Information

Issue Confirmations

  • Yes (2)No (0)
Photo

delete_timer error

Posted by Hercules Bot on 17 February 2012 - 05:46 PM

Originally posted by EvilPuncker
[Error]: delete_timer error : function mismatch 005387FD(npc_timerevent) != 00538203(unknown timer function)

it happens when using:

#define SECURE_NPCTIMEOUT 60

#define SECURE_NPCTIMEOUT_INTERVAL 1


after talking with any NPC

Originally posted by Ind
Fixed in [rev=15598]

Originally posted by Napster
found bug when npc use script command input

mes "test input";
next;   <---- INVALID_TIMER close;
input .@num;

if npc idle timer INVALID_TIMER

variable input save on player

click this npc again show debug in server & dialog npc notrespond

[DEBUG]: script: menu: script:menu: unexpected selection (0)


Edited by Napster, 18 February 2012 - 09:05 AM.


Originally posted by Wildcard
I can confirm the behavior described above. This is the script I needed to get both to work.

    mes "a";
    menu "a:b",-;
    mes "a";
    next;
    // let the timeout occur here while waiting for input, then close the input box and talk to the npc again for a total of 3 debug messages
    input .@num;
    mes "a";
    close;

I have quick fixes for both, but it somehow feels to me like this whole "abort script" shebang should be properly encapsulated in a npc_ function, since it is done in more than one place and has a couple nontrivial cleanup to do, as can be seen in clif_parse_LoadEndAck:

// abort currently running script
sd->state.using_fake_npc = 0;
sd->state.menu_or_input = 0;
sd->npc_menu = 0;

if(sd->npc_id)
    npc_event_dequeue(sd);


Originally posted by Epoque
I believe a particular 'abort' code needs implementing to signal that the player's NPC code was terminated through the time-out feature. For instance, if the time-out occurs then the player's npc_id is reset to 0, and all instances of the script are destroyed. However, if the player then continues to type something into an input; command, the script engine doesn't perform any checks for a 'time-out terminated' clause, and will throw errors/debug messages.

clif.c:clif_parse_NpcAmountInput
int npcid = RFIFOL(fd,2);
int amount = (int)RFIFOL(fd,6);

sd->npc_amount = amount;
npc_scriptcont(sd, npcid);

npc.c:npc_scriptcont
if( id != sd->npc_id ){
TBL_NPC* nd_sd=(TBL_NPC*)map_id2bl(sd->npc_id);
TBL_NPC* nd=(TBL_NPC*)map_id2bl(id);
ShowDebug("npc_scriptcont: %s (sd->npc_id=%d) is not %s (id=%d).\n",
nd_sd?(char*)nd_sd->name:"'Unknown NPC'", (int)sd->npc_id,
  nd?(char*)nd->name:"'Unknown NPC'", (int)id);
return 1;
}

We need some sort of signal flag or something to prevent this from occurring.

Originally posted by EvilPuncker
Any news on this, guys? btw seems like i'm the only one using that setting atm :P but since it is an official behavior it should be looked into still xd


@new issue

cutins doesn't disappear too!

Edited by EvilPuncker, 11 May 2012 - 12:06 AM.


Originally posted by Ind
the client doesn't sign that the player closed the stuff its hard to tell .-.

Originally posted by Napster
Bump!

this problem can fix ?

http://trac.rathena....t/16949/rathena

Originally posted by EvilPuncker
bump't'bump

we should remove this feature them if it no one is able to fix :(

Ind 
changed status to: Fixed

Thanks to malufett's suggestion I thought of something I think fixes this once and for all


we dont seem able to figure the way the client tells the server when a npc is closed.

maybe this is how it works
click npc - timer starts
mes something...timer is now running
next -> restart timer
mes something...timer is now running
<timer timeout>
close <- issued
next -> no more
so maybe 'next' just restart the timer and no more checking if it was close or not.just terminate timer and upon termination check if the player is still dealing with the npc then thats the time we issue 'close' command...

:meow:

Fixed in https://github.com/H...7ab2005c97d3714