Page 1 of 1

Extension Error!!

Posted: 16 Nov 2018, 14:27
by wadapav
Hello,

Im extremely sorry to be annoying you today with my pathetic code but I just cannot see where I have gone wrong.

My extension is supposed to be called and then send a amount of coins back to the client at the moment the amount of coins is set to 10 as I have not yet added DB Functions, My code follows.

Code: Select all

Code: Select all

function init()
{
        trace("Coin System Loaded");
}

function destroy()
{
        // Here we release resources before the extension is destroyed
}

function handleRequest(cmd, params, user, fromRoom)
{
if (cmd == "get")
        {
         var response = {};
                response._cmd = "coinGet"
            response.coins = "10"
               
                _server.sendResponse(response, -1, null, [user], "xml");
        }
}

function handleInternalEvent(evtObj)
{
        trace("Event: " + evtObj.name);

}


And the error I am seeing in the console:

Code: Select all

12:34:06.955 - [ WARNING ] > Error in extension [ coin.as ]: TypeError: Cannot c
all method "keySet" of null (coin.as#1192) Internal: -383 -- Line number: (Main
Lib line: 1192)

Re: Extension Error!!

Posted: 16 Nov 2018, 16:21
by Lapo
Hi,
I don't think the error you have reported is triggered by the code you showed here.
The line of the error points to an internal lib, but it seems something calling the library is triggering it.

What exactly is triggering the error? Is it possible it's due to a client request?

Thanks