Page 1 of 1
SFS2X Api loadConfig in FlashDevelop?
Posted: 19 Aug 2011, 07:23
by Mitsu
Hi I'm trying to load a configuration file for an as3 project I have in flashdevelop. I was following this tut:
http://www.youtube.com/smartFoxServer/# ... B7Yfbain1M
For quick referrence here's the config.xml
Code: Select all
<SmartFoxConfig>
<ip>127.0.0.1</ip>
<port>5050</port>
<zone>EMZProductions</zone>
<debug>true</debug>
<httpPort>8080</httpPort>
</SmartFoxConfig>
And it is in my /src folder.
Now the video says it's supposed to try a connection attempt when it loads but it doesn't seem to be doing that? I can get my SFSEvents to work if I using the connect function but yea |: I don't think it's loading my config in the first place
Any reasons why this is?
btw,
_sfs.loadConfig('config.xml')
is what have for loading it.
Posted: 19 Aug 2011, 07:26
by rjgtav
Hi. Is the config.xml file on the same folder as the client swf file? Also, try using "" instead of ''
Posted: 19 Aug 2011, 07:36
by Mitsu
Oh wow thanks, but won't this cause issues if I want to say put this game on my website?
Edit: '' and "" won't change anything, I moved the file to my /bin with my swf
Posted: 19 Aug 2011, 07:40
by rjgtav
What kind of issues are you thinking in? Like acessing the config file? well, i'm pretty sure that you always can not use the loadConfig method and manually set the necessary params on the client, but that will also expose the connection params to any hacker, right?
Posted: 19 Aug 2011, 07:43
by Mitsu
Well I assume if I were to ftp the swf onto my site and then test it it wouldn't be able to load my config.xml because I don't have it on the site?
Posted: 19 Aug 2011, 07:55
by rjgtav
Yup. You have to also upload the config.xml to the folder where your swf is, in your website
Posted: 19 Aug 2011, 07:56
by Mitsu
Wouldn't that expose it even more to people :S
Posted: 19 Aug 2011, 08:13
by rjgtav
Thats what i said. But even if you store the ip, port etc on the client, people can also access it
Posted: 19 Aug 2011, 15:55
by Mitsu
Well I'm having a new problem now.
Code: Select all
if (e.params.success) {
queueMessage(connectStatus, 4, "Connection Successfull\n");
connectOnce = true;
connected = true;
var request:LoginRequest = LoginRequest('');
_sfs.send(request);
}
I'm trying to get a loginrequest like it showed on the server to log me in as a guest. But whenever I do that I get this error?
[Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert "" to com.smartfoxserver.v2.requests.LoginRequest.
Posted: 19 Aug 2011, 16:06
by rjgtav
Hi. You need to create a new Instance of a LoginRequest.
Like for example:
var request:LoginRequest = new LoginRequest("username", "password");
or you can simply use:
_sfs.send(new LoginRequest("username", "password");
Posted: 19 Aug 2011, 18:12
by Mitsu
Okay one last question, why are private messages censored?
[Guest8]: test
[Private]Guest8: **** ****** *******
And how can I change that.
Posted: 19 Aug 2011, 18:16
by rjgtav
Hi. You need to disable the world filter for the private messages. You can change this setting in the Zone configurator (don't forget to restart the server afterwards - not sure if you can change on the ZOne monitor).
if you have rooms that are already pre-configured in the zone, you also need to change this setting on them (if possible).
Posted: 19 Aug 2011, 18:36
by Mitsu
Oh I just realized it's not displaying the msg for me privately :S
Any good tuts on chatrooms and stuff like that with flashdevelop/builder using the as3 api?
Edit: Disregard this, I'm a moron xD