Javascript blah. maybe a problem with the cvs snapshoot i got.

Want to discuss changes to the UOX3 source code? Got a code-snippet you'd like to post? Anything related to coding/programming goes here!
Post Reply
GhostTyper
UOX3 Neophyte
Posts: 26
Joined: Sun Sep 18, 2005 2:00 pm
Has thanked: 0
Been thanked: 0
Contact:

Javascript blah. maybe a problem with the cvs snapshoot i got.

Post by GhostTyper »

hi,

every command js file has a "CommandRegistration();" function. this function shuldt be somehow executed on startup. but this isn't the case. if i open go.js for example (js/commands/go.js) i have to add CommandRegistration(); to the end of the js file. else uox3 doesn't recognize the command. the precompiled windows version doesn't need this. therefore i think this is a mistake in the (linux-)code for example.

now my question: where shuldt CommandRegistration(); get normally called? other script's using "OnUse" aren't also working.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

CommandRegistration() is called by UOX3 on startup around the same time we initialize our built-in commands. We run a loop through every script defined in COMMAND_SCRIPTS section of jse_fileassociations.scp looking for the CommandRegistration() funciton. Where it exists in the file is irrelevant, as long as it exists in the same file that command is defined in.
Scott
GhostTyper
UOX3 Neophyte
Posts: 26
Joined: Sun Sep 18, 2005 2:00 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by GhostTyper »

this is _not_ the case in my uox3 snapshot. :-/

but i go through every command and therefore let each file register it's commands directly.
Post Reply