I'm trying to write a custom login script using example PixelGame.java as a reference (along with some forum posts and documentation help), and I've gone pretty far only to hit a snag trying to call sendResponse() that sends an ActionscriptObject.
The internal event handler looks like this:
Code: Select all
public void handleInternalEvent(InternalEventObject e){
String eventName = e.getEventName();
ActionscriptObject res = new ActionscriptObject();
if(eventName.equals("loginRequest")){
boolean okay = false;
String username = e.getParam("nick");
String password = e.getParam("pass");
SocketChannel chan = (SocketChannel) e.getObject("chan");
System.out.println("Attempting to login combo:"+username+" "+password);
try{
User newUser = helper.canLogin(username,password,chan,currZone.getName());
res.put("_cmd","logOK");
res.put("id", String.valueOf(newUser.getUserId()));
res.put("name", newUser.getName());
okay = true;
}catch(LoginException exception){
System.out.println("something bad happened");
}
LinkedList ll = new LinkedList();
ll.add(chan);
sendResponse(res,-1,null,ll);
if(okay)
helper.sendRoomList(chan);
}
}
the error goes:
Code: Select all
MyExtension.java:64: cannot access net.sf.json.JSONObject
class file for net.sf.json.JSONObject not found
sendResponse(res,-1,null,ll);
^
I'm writing my class in Notepad and compiling using commandline. My compile statement is as follows:
Code: Select all
javac -classpath "../../lib/jysfs.jar;../../lib/json.jar;../../json-lib-2.1-jdk15.jar" MyExtension.java
I'm using SFS 1.6.1, so I did include all the required JARs specified by the docs... I'm also somewhat perplexed at why the compiler's looking for JSONObject when I'm passing sendResponse() an ActionscriptObject...
Anyone able to push me in the right direction? Thanks for any insights into this problem!
-Jay