Maddy
1
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 ....
- Installed java (latest version) ..... and installed SmallFox server Lite.
- 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 )
-
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);
}
}
}
jashan
2
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.