problem with #include directive

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Post Reply
melojoy
Posts: 35
Joined: 02 Oct 2006, 21:27
Location: Italy

problem with #include directive

Post by melojoy »

There are difference from 1.6.6 version to past version in the use of #include directive? Or from Win release to Mac realease?

I have to modify .as room extensions that are correct in use in a server with installed 1.6.2 version.

Now in my Mac I have a smartfox 1.6.6 for local test but it doesn't works #include directive; this is the error:

Code: Select all

09:53:06.327 - [ WARNING ] > Failed loading the specified extension script: myExtension.as -> it.gotoandplay.smartfoxserver.exceptions.MalformedIncludeException: Malformed #include directive
09:53:06.508 - [ WARNING ] > Error in extension [ myExtension.as ]: org.mozilla.javascript.UniqueTag (Line number not available)
java.lang.ClassCastException: org.mozilla.javascript.UniqueTag
	at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.loadScript(JavascriptExtension.java:432)
	at it.gotoandplay.smartfoxserver.extensions.JavascriptExtension.setScriptFile(JavascriptExtension.java:137)
	at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.loadExtension(ExtensionHandler.java:133)
	at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.createExtension(ExtensionHandler.java:207)
	at it.gotoandplay.smartfoxserver.controllers.ExtensionHandler.createExtension(ExtensionHandler.java:189)
	at it.gotoandplay.smartfoxserver.controllers.SystemHandler.handleCreateRoom(SystemHandler.java:2386)
	at it.gotoandplay.smartfoxserver.controllers.SystemHandler.processEvent(SystemHandler.java:281)
	at it.gotoandplay.smartfoxserver.controllers.SystemHandler.run(SystemHandler.java:146)
	at java.lang.Thread.run(Thread.java:613)
If I past in "myExtension.as" the code of the .as files included it's work... but I can't do it for all room extensions.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Maybe characters problems.
Make sure you save your files in UTF-8 with no BOM (ByteOrderMark)
Most editors support that (e.g. Notepad++ on Windows, TextMate and TextWrangler on Mac)
Lapo
--
gotoAndPlay()
...addicted to flash games
melojoy
Posts: 35
Joined: 02 Oct 2006, 21:27
Location: Italy

Post by melojoy »

Hi Lapo,
in version 1.6.2 I don't have this problem: include works.

Saving files (with TextWrangler) UTF-8 with no BOM Classic Mac CR and UTF-8 with no BOM Windows CRLF, include directive doesn't works in SFS 1.6.6.
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

Can you send us a bare-bone example that we can test?
Lapo
--
gotoAndPlay()
...addicted to flash games
melojoy
Posts: 35
Joined: 02 Oct 2006, 21:27
Location: Italy

Post by melojoy »

Sorry Lapo,
I didn't apply "UTF-8 with no BOM" in all file included but only in the main file.

Now it's work in 1.6.6 also.
melojoy
Posts: 35
Joined: 02 Oct 2006, 21:27
Location: Italy

Post by melojoy »

Hi Lapo,
After using different file configurations, this is the result for Zone and Room Extensions:

OK >> Unicode (UTF-8, no BOM) - Windows (CRLF)
OK >> Unicode (UTF-8, no BOM) - Unix (LF)
FAIL >> Unicode (UTF-8, no BOM) - Classic Mac (CR)
FAIL >> Unicode (UTF-8, no BOM) - Unicode
Post Reply