Simple Extension doesn't show up in the admin
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
Simple Extension doesn't show up in the admin
Hello there,
I am currently trying SmartFoxServer to see if it would be a suitable solution for our multiplayer games project.
I find it a bit hard to get the right documentation, though.
I'm trying to make an extension, but it can't get it to show up in the server admin.
The jar file is under "{SERVER}/extensions/test/" folder, and the jar file is named "TestExtension.jar".
There's almost no code in the java class, it's a very simple one based on the simple chat tutorial.
I'm new to JAVA (come from Ruby and ActionScript 3) so I wonder if the problem could be from an error in my java classes. I use Eclipse and JAVA 1.6.
What could be the problem ?
I am currently trying SmartFoxServer to see if it would be a suitable solution for our multiplayer games project.
I find it a bit hard to get the right documentation, though.
I'm trying to make an extension, but it can't get it to show up in the server admin.
The jar file is under "{SERVER}/extensions/test/" folder, and the jar file is named "TestExtension.jar".
There's almost no code in the java class, it's a very simple one based on the simple chat tutorial.
I'm new to JAVA (come from Ruby and ActionScript 3) so I wonder if the problem could be from an error in my java classes. I use Eclipse and JAVA 1.6.
What could be the problem ?
Hi,
this is my zone extension file :
Thats basicly all that it needs.[/code]
this is my zone extension file :
Code: Select all
package net.edje.projects.SFS2xBase;
import com.smartfoxserver.v2.core.SFSEventType;
import com.smartfoxserver.v2.extensions.SFSExtension;
public class ZoneExtension extends SFSExtension {
@Override
public void init() {
addEventHandler(SFSEventType.USER_JOIN_ZONE, JoinZoneHandler.class);
}
}
Thats basicly all that it needs.[/code]
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
Ok... I'm not sure this is my problem then, because mine is quite close :
In Eclipse, I use export, and export a jar file to the extensions folder of SFS.
Still, the file doesn't show up in the admin.
Code: Select all
package com.bigroundeyes.java.spawn;
import com.smartfoxserver.v2.extensions.SFSExtension;
public class SpawnExtension extends SFSExtension {
@Override
public void init() {
addRequestHandler("PLAY", Game.class);
}
}
In Eclipse, I use export, and export a jar file to the extensions folder of SFS.
Still, the file doesn't show up in the admin.
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
I don't really know... I'm not familiar with JAVA.
When I try to check in my project properties, and "JAVA compiler", it says JavaSE-1.6.
I don't really see any other place to set up this.
To get the jar file, I'm doing like in the SFSx2 tutorial video : I'm using the export feature. It takes no time to do it and it doesn't confirm the compilation was ok, so I don't know if it's all right, though the file is created... I just checked actually, and the jar file is only 3Ko. There should be 2 classes in the project, so 3Ko seems definitely small, even for small classes isn't it ?
When I try to check in my project properties, and "JAVA compiler", it says JavaSE-1.6.
I don't really see any other place to set up this.
To get the jar file, I'm doing like in the SFSx2 tutorial video : I'm using the export feature. It takes no time to do it and it doesn't confirm the compilation was ok, so I don't know if it's all right, though the file is created... I just checked actually, and the jar file is only 3Ko. There should be 2 classes in the project, so 3Ko seems definitely small, even for small classes isn't it ?
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
I'm no expert but yes i think you need to have the SDK, if i recall right.
Also check this topic on extensions, might have more info on it :
http://www.smartfoxserver.com/forums/viewtopic.php?t=8107
It's the JDK 6.0
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Also check this topic on extensions, might have more info on it :
http://www.smartfoxserver.com/forums/viewtopic.php?t=8107
It's the JDK 6.0
http://www.oracle.com/technetwork/java/javase/downloads/index.html
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
Thank you so much both of you.
Indeed, I finally found there was some errors thrown in the server log.
I fixed my package name and now the code is working : my Actionscript 3 client can connect and log to this zone.
Thank you again, appels and bax.
Though, the extensions still don't show up when I create or modify a zone in the 'Extension Zone' tab. The 'Start Extension file monitor' in the Server config seems to be on (the radio button is green).
It's not absolutely necessary since now the extension works, at least. But it would be nice to understand why the auto detection of the zone extension don't work for me.
Do you have any idea ?
Indeed, I finally found there was some errors thrown in the server log.
I fixed my package name and now the code is working : my Actionscript 3 client can connect and log to this zone.
Thank you again, appels and bax.
Though, the extensions still don't show up when I create or modify a zone in the 'Extension Zone' tab. The 'Start Extension file monitor' in the Server config seems to be on (the radio button is green).
It's not absolutely necessary since now the extension works, at least. But it would be nice to understand why the auto detection of the zone extension don't work for me.
Do you have any idea ?
-
- Posts: 10
- Joined: 11 Jul 2011, 20:58
Who is online
Users browsing this forum: No registered users and 43 guests