Using smartfox without Unity.

Post here all your questions related with SmartFoxServer .Net/Unity3D API

Moderators: Lapo, Bax

User avatar
death_au
Posts: 8
Joined: 23 Mar 2010, 03:17

Using smartfox without Unity.

Postby death_au » 30 Apr 2010, 05:05

I've been struggling with this for a while and it seems like I'm getting nowhere fast... Has anyone got some basic examples of using SmartFox using the ASP.net API that don't use Unity?
Basically I'm building a system that needs to be used on a wide variety of machines at low download cost, so external plug-ins like Unity and Flash are out of the question. However I would like to use smartFox, as the application involves a lot of updating and sending variables all over the place.

What I'm doing is creating a smartfox "component" for my page, which stores and references a smartfox object in the session.
So far, I've got it set up so that the c# code on my asp.net page to reload an ajax update panel every second. If smartfox is not connected, try connecting. If it is connected, try logging in and if it is connected, try joining a room (at this stage if it meets all those criteria it does nothing).
It seems to connect fine, and I think it's logging in ok, but when I try and join a room nothing is happening. Neither the onJoinRoom or onJoinRoomError handler is ever getting called, and I'm not sure why.

If anyone has any examples of using smartfox this way, or any better alternatives, please please let me know.
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 30 Apr 2010, 08:01

Hey

I've seen several ppl here on the forums, who have gotten this running. Try to search through the threads - if I recall some even had some code snippets.

One thing you will have to do - which I ran into when doing the Silverlight port - is that you need to set up a timer inside your page that polls the API for handling events. Webpages are purely response/request, so the API callbacks are not automagically run as the thread with the page is "inactive".

So set the API to run in queue mode, make a timer inside your ASP page which calls the process queued events method in the API - and then I think it should work for you.

Alternative to a server based world, you could have a "register this object under id #" call to all clients and then they all create the object on their simulations. All about cheat prevention and similar mechanisms.

/Thomas

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 21 guests