What is the new SmartFoxConnection class?

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

vesche
Posts: 2
Joined: 18 Nov 2017, 04:15

What is the new SmartFoxConnection class?

Postby vesche » 18 Nov 2017, 04:25

I'm borrowing some code from this example - http://docs2x.smartfoxserver.com/ExamplesUnity/tris

I want to connect in a login scene and then keep using that same connection in a game scene. This is done in the example by connecting using LoginController.cs and then handing off sfs to LobbyController.cs by doing:

Code: Select all

private SmartFox sfs;

void Awake() {
    if (SmartFoxConnection.IsInitialized) {
        sfs = SmartFoxConnection.Connection;
    } else {
        // stuff
    }
    // more stuff
}


The issue I'm having is that SmartFoxConnection is no longer a thing it seems like in the most recent DLL? I'd like to avoid using more than one DLL or an outdated one. I looked through the API but couldn't find what I was looking for. Can anyone help? Thanks in advance.
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: What is the new SmartFoxConnection class?

Postby Lapo » 18 Nov 2017, 09:08

Hi,
the object you're referring to, SmartFoxConnection, is not an object from our API.
It is a class inside the example project you're using. If you want to reuse it you will have to copy it from the example project into your own.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
vesche
Posts: 2
Joined: 18 Nov 2017, 04:15

Re: What is the new SmartFoxConnection class?

Postby vesche » 19 Nov 2017, 04:04

Oh, derp! I copied over that file and am now able to transfer my connection between scenes. Thank you!

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 19 guests