- Home /
Need lot of help regarding starting with smartFox server or just any server ....
Hi,
I am experienced somewhat in making Games in general, but have no clue regaridng the network part. So, im a complete noob wrt to network stuff, and am aching to learn it
Can you guide me or point me in the right direction towards getting detailed/step-by-step instructions of setting up a simple .... client server app. say, client will send a number .... and server just will return a double of it.
I tried the following for now ....
case 1 : when i havent started the smallfoxserver, and launched the script, i get the message saying .... Connection failed : I/O Error : connection refused
case 2 : i started the small fox server ......... and then try to run the below script .... then i dont get any log message at all . not even connection successfull message!
So, i dont know how to proceed further.
Please can someone guide me through this?
Sample Code i've tried ...:
using UnityEngine; using System; using System.Collections; using SmartFoxClientAPI; using SmartFoxClientAPI.Data; using SmartFoxClientAPI.Util;
public class network : MonoBehaviour { private static SmartFoxClient smartFoxClient;
// Use this for initialization
void Start ()
{
SFSEvent.onConnection += handleConnection;
smartFoxClient = new SmartFoxClient(true);
if (smartFoxClient==null)
{
Debug.Log("can't find connection");
return;
}
smartFoxClient.Connect("127.0.0.1", 9339);
}
private void handleConnection(bool success, string error)
{
if (success)
{
Debug.Log("Connection successful" );
}
else
{
Debug.Log("Connection failed : " + error);
}
}
}
Are the correct ports open on your router? In this case 9339?
Answer by jashan · Jul 20, 2010 at 01:28 PM
Have you looked at this forum posting:
Another resource that may help you: MMO tutorial on the Unifycommunity Wiki ... I'm a bit hesitant posting that link but while you shouldn't expect to be able to create an MMO "out of a simply quick tutorial" this should nevertheless give you some helpful insights.
I guess the main problem with your setup is that you're using SmartFoxServer Lite. You need SmartFoxServer Pro or Basic.
Or, you could look into Photon: Photon - they now have a free license for up to 50 concurrent users which should be fine to get started. They also have a simple MMO-style example that works with Unity on their Website.
Yeah, installing the smartFox basic version solved the issue for me too .... thanks a lot
Ah, thanks, I've edited the answer to also include "Basic".
Your answer
Follow this Question
Related Questions
Undertanding client/server stuff 2 Answers
i need SFS help 1 Answer
Smart Fox error 2 Answers
MMO Player Hosting 0 Answers
How can I connect unity to my smart fox server plugin 1 Answer