Recently I am switching some projects over to Unity. For now, I'm just using the Editor to try to connect to SFS, but when I play the scene the connect script doesn't fire anything in Unity. However, for some reason the server logs tell a different story.
For some odd reason the logs are saying to what I'm understanding that the connection is going straight to BlueBox. I'm going to give you guys a snippet of the code I used for the connection withe the ip removed and replaced with asterisk's.
Also, I guess it's worth mentioning the Server Log messages AND the C# API I am using... C# API: Latest (1.7.4).
Here are the server logs pertaining to the BlueBox Issue:
Code: Select all
25 Aug 2017 | 17:52:59,536 | INFO | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 19, Type: BLUEBOX, Logged: No, IP: 73.64.149.32 }
25 Aug 2017 | 17:53:29,546 | INFO | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 20, Type: BLUEBOX, Logged: No, IP: 73.64.149.32 }
25 Aug 2017 | 17:53:32,336 | WARN | qtp527804008-31 | bluebox.v3.BlueBox | | Invalid request, session expired. Message: { ssid: 55e3e8ad9fffce19861dac3194b8f05e, cmd: poll, data: NoData }
25 Aug 2017 | 17:53:56,646 | WARN | qtp527804008-39 | jetty.http.HttpParser | | bad HTTP parsed: 400 for HttpChannelOverHttp@23c154f2{r=0,c=false,a=IDLE,uri=null}
25 Aug 2017 | 17:53:56,799 | INFO | qtp527804008-37 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 21, Type: BLUEBOX, Logged: No, IP: null } on Server port: 0 <---> 0
25 Aug 2017 | 17:54:29,562 | INFO | Scheduler1-thread-1 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 21, Type: BLUEBOX, Logged: No, IP: 73.64.149.32 }
25 Aug 2017 | 17:54:38,718 | WARN | qtp527804008-32 | bluebox.v3.BlueBox | | Invalid request, session expired. Message: { ssid: 7d1ea92a5f09bb6c881d7abd635846c7, cmd: poll, data: NoData }
C# Code:
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sfs2X;
using Sfs2X.Core;
public class Connect : MonoBehaviour {
// Use this for initialization
void Start () {
SmartFox sfs = new SmartFox ();
sfs.Connect ("***.***.**.***", 8080);
sfs.AddEventListener (SFSEvent.CONNECTION, onConnect);
sfs.AddEventListener (SFSEvent.CONNECTION_LOST, onConnectFail);
}
// Update is called once per frame
void Update () {
}
void onConnect (BaseEvent evt) {
Debug.Log ("It works");
}
void onConnectFail(BaseEvent evt) {
Debug.Log ("It didn't work. ;(");
}
}