Search found 191 matches

by tchen
15 Feb 2011, 15:06
Forum: SFS2X Questions
Topic: Singleton + Reflection + ?????
Replies: 3
Views: 2075

Re: Singleton + Reflection + ?????

Is this a horribly bad idea using my extension as a singleton? Yes ;) You'll actually end up with multiple independent singletons if you have Room extensions since they each have their own class loaders. You'll need to traverse the getZone getParentExtension methods and casts to get your way to the...
by tchen
15 Feb 2011, 03:56
Forum: SFS2X C# API
Topic: Simple Connection Issue
Replies: 1
Views: 1545

That's a SFS1 example.
by tchen
15 Feb 2011, 00:33
Forum: SFS2X Questions
Topic: Out of memory on new VPS
Replies: 11
Views: 5344

Look for the section in sfs2x-service case "$1" in start) echo "Starting sfs2x-service" $INSTALL4J_JAVA_PREFIX nohup "$app_java_home/bin/java" -server -Xms400m -Xmx400m -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" "...
by tchen
15 Feb 2011, 00:24
Forum: SFS2X Questions
Topic: Debian daemon problem
Replies: 7
Views: 3480

Just for completeness, make another link in /etc/init.d/ so you have easy access. And then do either a restart or status on it like you would any other daemon. What error do you get then? eg: cd / ln -s /home/john/SFS2X/SFS2X/sfs2x-service /etc/init.d/sfs2x /etc/init.d/sfs2x restart Also check the l...
by tchen
14 Feb 2011, 12:50
Forum: SFS2X Questions
Topic: Out of memory on new VPS
Replies: 11
Views: 5344

Try adding the java option -Xmx400m to your start script. If 1and1 is using OpenVZ under the hood, it might not like the burst (dynamic) memory too much.

Why its even spawning 40+ processes seems a bit fishy though.
by tchen
14 Feb 2011, 12:45
Forum: SFS2X Questions
Topic: Hopefully my last issue... RequestHandler
Replies: 8
Views: 3718

ISFSObject sfsObj = SFSObject.newInstance(); sfsObj = warehouse[0].toSFSObject(); trace("ABOUT TO RETURN THE SFSOBJECT FOR SENDING"); return sfsObj; You're overwriting sfsObj. So have you validated that the toSFSObject() on your warehouse object is actually returni...
by tchen
14 Feb 2011, 00:10
Forum: SFS2X Questions
Topic: Hopefully my last issue... RequestHandler
Replies: 8
Views: 3718

You're not giving us enough information. List your handler code for getModel
by tchen
13 Feb 2011, 23:57
Forum: SFS2X C# API
Topic: Event handlers swallowing exceptions
Replies: 3
Views: 2116

Yes, its' tedious. No one said exception handling wasn't. But be more fine grained than that. If you're doing IO operations, wrap that specific block in an try { ... } catch (IOException) { } finally { }. The reason being, you can take corrective action better then. As for the log message in the mas...
by tchen
13 Feb 2011, 19:54
Forum: SFS2X Questions
Topic: serialization of Map<Object, Object>
Replies: 10
Views: 4663

And what is yours suggestion of sending Map<Integer, Object>? First, I never send the hashmap through. I have a processing step in between anyways to transform data, and to filter out redundant information or stuff that I know was already sent. The result is a SFSArray containing all the remaining ...
by tchen
13 Feb 2011, 17:18
Forum: SFS2X Questions
Topic: Hopefully my last issue... RequestHandler
Replies: 8
Views: 3718

If you're getting a nullexception in that snippet, then chances are good your variable sfs is not pointing at anything. Make sure its referencing the SmartFoxServer object you used to connect with.
by tchen
13 Feb 2011, 17:13
Forum: SFS2X Questions
Topic: Memory Management
Replies: 1
Views: 1362

When nothing can see it, it'll be removed - maybe. The GC has a couple generations. When something goes out of scope and it can readily determine nothing has a reference, it'll collect it almost instantly. If it can't easily determine it, it starts to get moved into a older generation. As it gets ol...
by tchen
13 Feb 2011, 17:05
Forum: SFS2X Questions
Topic: serialization of Map<Object, Object>
Replies: 10
Views: 4663

For what it's worth, lower ASCII values in UTF8 are single byte.

Honestly though, when you get to the point of worrying about key encoding on a hashmap sent over a network, you're sending too much over the wire.
by tchen
12 Feb 2011, 18:34
Forum: SFS2X Questions
Topic: Could use some help on this extension
Replies: 3
Views: 2044

Upcast the object from getParentExtension to whatever your class happens to be.

Code: Select all

testSFS ext = (testSFS)getParentExtension()
by tchen
11 Feb 2011, 18:00
Forum: SFS2X Questions
Topic: Created New Extension
Replies: 4
Views: 2233

Is there a way of telling a zone what extensions it has access to? I did not see something like that in admin tool. I am guessing that every zone has access to every zone, and I have no idea what the 'set extension' view has to do with anything. Zones can have an optional extension associated with ...
by tchen
11 Feb 2011, 04:37
Forum: SFS2X C# API
Topic: FixedUpdate and ProcessEvents
Replies: 1
Views: 1803

Anywhere you like :D

Go to advanced search