Java extention of SFS
1. Install ipvs and Java SDK
2. strictly follow the SFS pro documentation file: // D:/program % 20 files/smartfoxserverpro_1.6.6/docs/index.htm
6.9 Java extensions
Create the first JavaProgram.Code:
Public void handlerequest (string cmd, actionscriptobject AO, user U, int fromroom)
{
// Your code here, handles XML-based requests
If (cmd = "XXX ")
{
Sendresponse (Ao,-1, U, null );
}
}
3. Upload the generated file
D:/eclipseworkspace/xxxextention/bin/packxxx/xxxext. Class
Copy
D:/program files/smartfoxserverpro_1.6.6/Server/javaextensions
4. When an error is reported on the startup server, "jsonobject cannot be resolved" cannot be found.
5. Open D:/program files/smartfoxserverpro_1.6.6/Server/start. bat edit
Add the library "lib/JSON. jar; LIB/json-lib-2.1-jdk15.jar; LIB/jysfs. jar "
added is also a whitelist, error as usual
6, find the web page http://hi.baidu.com/haorui1130/blog/item/ff1aa33d2f50240dbba1671c.html
found that Java project less with a json-lib-2.1-jdk15.jar library
7, then save the compilation, overwrite, server started