PDA

View Full Version : NPCServer: shows callstack on error


Admins
06-28-2012, 04:37 PM
The npcserver has been updated on all machines (need to be manually restarted):
- shows a small callstack (max 5 entries) when an endless loop has been detected or the callstack has been overrun (endless recursion)
- new script function getCallStackInfo() which returns a string which contains basically the same information: the call stack and script line numbers; this is basically a simpler version of the getCallStack() things; you can use this to easily show who has called your script functions:

echo("I am " @ getCallStackInfo());

Matt
06-28-2012, 11:07 PM
thumbs up

ffcmike
07-03-2012, 12:55 AM
There still seems to be the issue of joining a class to a scripted player object then being unable to be un-joined, which makes me hesitant to use the functionality as much as I'd like to as it results in more memory usage.

For example:


temp.pl = new TServerPlayer(@ temp.account);
temp.pl.join("nameofclass");
temp.pl.someFunction();
temp.pl.leave("nameofclass");
temp.pl.destroy();


This will result in the class count still being included within the /stats RC message.

I did notice there was some new information within /stats too.
For example:


Script engine: 1 event objects, 94 destroyed objects, 258 static objects, 503 global variables, 6 script machines

I wonder what it means exactly.

Admins
07-03-2012, 02:02 AM
6 script machines - maximum number of objects calling another object in a chain
258 static objects - TStaticVars
503 global variables - needs no explanation
94 destroyed objects - objects which were destroyed but other objects are still linking to it
1 event object - objects with a name which were destroyed (having event catchers which will be reapplied when the object is recreated)

These variables were previously only available to me but they can show when there is a problem (too many global variables or so).

ffcmike
07-03-2012, 02:11 AM
6 script machines - maximum number of objects calling another object in a chain
258 static objects - TStaticVars
503 global variables - needs no explanation
94 destroyed objects - objects which were destroyed but other objects are still linking to it
1 event object - objects with a name which were destroyed (having event catchers which will be reapplied when the object is recreated)

These variables were previously only available to me but they can show when there is a problem (too many global variables or so).

The amount of static objects and especially global variables seems much higher than it should be for us, unless a number of them are waiting on the garbage collector or something.

cbk1994
07-03-2012, 02:33 AM
The amount of static objects and especially global variables seems much higher than it should be for us, unless a number of them are waiting on the garbage collector or something.

For comparison, here's Era with about 115 players online:

Script engine: 0 event objects, 448 destroyed objects, 217 static objects, 5786 global variables, 7 script machines

Would be neat if there was some way to see more information about the global variables, I can't think of anything on Era that would be creating so many.

ffcmike
07-03-2012, 02:36 AM
I can't think of anything on Era that would be creating so many.

Same, I hardly ever use global variables serverside except for system references.

salesman
07-03-2012, 02:54 AM
Would be neat if there was some way to see more information about the global variables, I can't think of anything on Era that would be creating so many.

Aren't npcs created via putnpc assigned to some global variable (items, trash, etc)?