JAva extension: removeUser() and ExtensionHelper.instance()

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
proschigom
Posts: 32
Joined: 09 Feb 2006, 12:12

JAva extension: removeUser() and ExtensionHelper.instance()

Post by proschigom »

Does anyone know what the deal is with these two functions?


IS there every a reason for which removeUser would throw a nullPointer exception? ExtensionHelper.instance() also throws an exception, no matter what I Do.

What could be causing this problem?
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: JAva extension: removeUser() and ExtensionHelper.instanc

Post by Lapo »

proschigom wrote: IS there every a reason for which removeUser would throw a nullPointer exception? ExtensionHelper.instance() also throws an exception, no matter what I Do.

What could be causing this problem?
1) removeUser? From which class? I am not aware of a removeUser method in our server side framework

2) ExtensionHelper.instance() ... what exception does it throw?

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
proschigom
Posts: 32
Joined: 09 Feb 2006, 12:12

Post by proschigom »

Room.removeUser():

removeUser

public boolean removeUser(User u,
boolean updateUserRoomList,
boolean destroyVars)


It throws a NullPointerException. The ExtensionHelper function does the same. Why would that happen??
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

can you please copy and paste here or in a private message the stack trace?

A side note: removing manually a user from a room isn't the best thing to do... There's a specific command called leaveRoom() which is much better.
Can you explain what are you trying to do?
Lapo
--
gotoAndPlay()
...addicted to flash games
proschigom
Posts: 32
Joined: 09 Feb 2006, 12:12

hey

Post by proschigom »

I changed something aout that so I don't get it again.

But another very strange problem, which is reallllly very frustrating right now.

I'm working with a java extension at the moment, and inside the logs folder, a flie is usually generated that contains all the logs. Why is it that all of a sudden, instead of all events being logged nicely, and appended to previous log entries, all I get now are the following three lines:

2006/05/13 10:10:59.437 - [ INFO ] [id: 10] (ExtensionHandler.createExtension): Zone Extension [ poker ] created, for zone:pokers
2006/05/13 10:10:59.500 - [ INFO ] [id: 10] (SmartFoxServer.run): [SystemHandler] ... started
2006/05/13 10:10:59.500 - [ INFO ] [id: 10] (SmartFoxServer.run): [ExtensionHandler]. started
2006/05/13 10:10:59.500 - [ INFO ] [id: 10] (SmartFoxServer.run): SmartFoxServer running
2006/05/13 10:13:26.593 - [ INFO ] [id: 11] (ExtensionManager.reloadExtension): Extension [ poker ] reloaded.


What's very annoying is that this no longer displays all the information it used to display before. After no system changes to my machine. It would usually be very verbose with the logging. I've tried setting logging level to FINEST, but still doesnt work. This is on WINDOWS.

Worst of all, this log refreshes whenever I restart the server!!!

And I've tried changing the permissions on the folder. I reallly liked the old log file because it was very helpful in debugging!

Please help!
proschigom
Posts: 32
Joined: 09 Feb 2006, 12:12

Post by proschigom »

here's the exception I'm getting with the extensionHelper:

java.lang.NullPointerException
at it.gotoandplay.smartfoxserver.extensions.ExtensionHelper.<init>(ExtensionHelper.java:59)
at it.gotoandplay.smartfoxserver.extensions.ExtensionHelper.instance(ExtensionHelper.java:71)
at extension.PokerEx.init(PokerEx.java:46)
at engine.PokerGame.main(PokerGame.java:155)

on line 155 all I have it a call to the init() method of PokerEx, which extends AbstractExtension.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

What's very annoying is that this no longer displays all the information it used to display before. After no system changes to my machine. It would usually be very verbose with the logging. I've tried setting logging level to FINEST, but still doesnt work. This is on WINDOWS.
Are your running the server as a system service? If so the console output is redirected to the logs/wrapper.log file
on line 155 all I have it a call to the init() method of PokerEx, which extends AbstractExtension.
You call the init() method of your extension? It's not necessary and it can cause problems. The init() method is called by SmartFoxServer itself after it has successfully instantiated the extension
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply