x


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 ....

  1. Installed java (latest version) ..... and installed SmallFox server Lite.
  2. Tried the sample ( i pasted the sample code at the end of the query for readability) ( I added the reference to the SmallFoxServerClient as well )
  3. 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);
        }
    }

}
more ▼

asked Jul 20 '10 at 09:28 AM

Maddy gravatar image

Maddy
117 2 3 12

Are the correct ports open on your router? In this case 9339?

Jul 20 '10 at 01:15 PM Julian Glenn
(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

Have you looked at this forum posting:

SmartFox/Unity Demo Issues

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.

more ▼

answered Jul 20 '10 at 01:28 PM

jashan gravatar image

jashan
10.1k 25 40 116

Hmmm .... i'll check that, thanks

Jul 20 '10 at 01:35 PM Maddy

Yeah, installing the smartFox basic version solved the issue for me too .... thanks a lot

Jul 20 '10 at 02:18 PM Maddy

Ah, thanks, I've edited the answer to also include "Basic".

Jul 20 '10 at 03:41 PM jashan
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x708
x56
x22

asked: Jul 20 '10 at 09:28 AM

Seen: 1431 times

Last Updated: Jul 20 '10 at 10:41 AM