Page 1 of 1
JAva extension: removeUser() and ExtensionHelper.instance()
Posted: 11 May 2006, 21:49
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?
Re: JAva extension: removeUser() and ExtensionHelper.instanc
Posted: 12 May 2006, 05:56
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
Posted: 12 May 2006, 07:14
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??
Posted: 12 May 2006, 08:52
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?
hey
Posted: 13 May 2006, 17:06
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!
Posted: 14 May 2006, 07:05
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.
Posted: 15 May 2006, 06:18
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