Mysql connection

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

allexiel
Posts: 46
Joined: 10 Jan 2006, 12:34

Post by allexiel »

*sorry for talking french*

Elgueu dit moi :)
Tu travaille en local je vois. Peux tu m'expliquer 2-3 choses?
192.168.0.15 => ordinateur dans ton lan qui contient la base de données? ou..?
Quelle "package" emploi tu pour le création de database en local?

Voili voilou :)
mangoon
Posts: 22
Joined: 18 Jul 2005, 02:36
Location: Vienna Austria
Contact:

Post by mangoon »

Hi,
had a similiar problem an one machine .. try to replace 127.0.0.1 in config.xml bei your hostname (the name in /etc/hostname)
Also add an mysql user entry with that name instead of localhost or %

This did help on my ubuntu/debian install. Its worth a try.

hil
Elgueu
Posts: 35
Joined: 23 May 2006, 22:45

Post by Elgueu »

allexiel > Euh nop désolé justement je travaille pas en local ^^ Je dois me débrouiller avec un serveur dédié Linux distant que je ne maitrise pas du tout, et c'est un peu pour ca que je galère. Je n'ai donc pas vraiment de réponse à tes questions :?

mangoon > I don't have any /etc/hostname file. But i already tried with every IP or name i have for the server, and still get the same error.. Thx anyway ^^
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

Is there any other way to store easily array on the server ? PHP ?
You can write/read files on the server with _server.writeFile() and _server.readFile();

Or, with the newely introduced LoadVars class on server side. But this one adds a little too much of overhead for something that should be achieved easly.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
Elgueu
Posts: 35
Joined: 23 May 2006, 22:45

Post by Elgueu »

And it's not really easy to rebuild an array object from a textfile, is it ?
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

I've just posted an example on this thread here -> http://forums.smartfoxserver.com/viewto ... =2565#2565
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
Elgueu
Posts: 35
Joined: 23 May 2006, 22:45

Post by Elgueu »

Hm... Yes i could do like this, and converting the datas in array with Number(). The problem is that my arrays are multi-dimensionnal (about 2 or 3 levels), so i don't think the split() command will be sufficient >.>
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Post by Virusescu »

I've discussed this with JarochoCity. Read through this thread as well - http://forums.smartfoxserver.com/viewtopic.php?t=554

Thing is that SFS does this when sending data. You can send complex objects as xml strings through the xmlSocket. It's how SFS works.
Maybe Lapo didn't had a chance to read the other thread, but he might be able to expose the serialization/deserialization methods from inside the server.

So, you can build your own serialization algorithm for your data structure or you could use the builtIn methods of SFS (if these are available to be called from the server AS framework).
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
Elgueu
Posts: 35
Joined: 23 May 2006, 22:45

Post by Elgueu »

Alright, i've found a classic serialize class for flash, and will do everything in text files... This way, my app won't be affected if a sql freez occurs :p
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

The AS 1 version of the client side serializer/deserializer could be used in an extension, but we don't provide direct access to the java serializer because it's more complex than the client version

There are some open source solutions like the wddx class for Flash >> http://sephiroth.it/tutorials/flashPHP/wddx/index.php which could be used for this task.

Elgueu, which classes do you use?
Lapo
--
gotoAndPlay()
...addicted to flash games
Elgueu
Posts: 35
Joined: 23 May 2006, 22:45

Post by Elgueu »

Yeap, this one http://sephiroth.it/test/unserializer/index.php

I had a few problem of compatibility between this class and server code, and had to remove some "AS2 stuff" to make it work, but it's now ok.

BTW, is it possible to use a server based code without joining a room and all the user process, etc... ? I mean, i store my "map arrays" in text files as i've just explained, but i also have a mapeditor and would like it to use the _server.Write and Read functions, but i don't need any "user login", "rooms" or anything else. So what is the minimum code to connect and be able to use server extension with this kind of app ?
Post Reply