Hello,
today we release version 1.1 of the Unity API!
The new release fixes most of the issues submitted to Thomas in the past months in this board plus it adds new great examples.
There are now 4 from-zero-to-hero tutorials, including source code and detailed comments:
1- Simple Connect
very basic introduction to the usage of the API
2- Simple Lobby
guides you through the creation of a simple Lobby with chat etc...
3- SmartFoxTris
Unity3D version of the tic-tac-toe game, including server side logic
4- SFS Island Demo
realtime interaction in the beautiful Unity demo island!
This one is provided as a separate download due to its size (130Mb)
All the details and download links are found here.
Cheers
[NEW] .Net/Unity API 1.1 available
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
I just wanted to chime in with a little more details here also.
The change list for this release is
The new queue mode needs a few words. The aim is to get Unity (or other non-thread safe environemtns) to decide when they want delegates to be called as well as doing it from the game thread.
As it is in non-queue mode (which the API defaults to for backwards compatibility) it is the thread with the TCP connection that when it receives data also calls the delegate - at the time when it gets the data.
If Unity e.g. was currently iterating over a ArrayList of chat messages, and the API suddenly updated the same ArrayList then you would get an error.
This is what the new queue mode handles - it queues up all network events internally - and when you form your game call the ProcessEventQueue() method, then it empties that queue.
It is thus very easy to use and very transparent for the developer. Simply do this in Unity (or other clients) and your delegates will be called as usual. No other changes to the client code compared to previous examples/tutorials:
The API will right there totally empty all queued up messages from the server.
Sending messages is still instant - the queue mode is only on the receiving/processing side.
If you check the tic-tac-toe tutorial as well as the island demo, both of these use this new queue mode.
And I would actually say that it is _the_ preferred mode for usage in Unity.
It is naturally up to you when you want the processing to happen. FixedUpdate is a good place, but it could also happen for each frame (Update) or whenever you want.
Shoot away with questions if you have any!
/Thomas
The change list for this release is
Code: Select all
* New queue mode for delayed processing of network events. Especially useful in non-thread safe environments
* Bugfix: workaround for a mono bug in the version shipped with Unity. The delimiter of numbers is different for some locales, and that cause problems serializing/deserializing them. Workaround is to enforce en-US number format when reading/writing numbers in the serializer.
* More robust deserializing of XML. Could e.g. throw an unhandled exception when meeting unexpected empty strings
* Fixed bug in GetRoomByName iterating over hashtable
* Updated bugs in documentation when iterating over hashtables
The new queue mode needs a few words. The aim is to get Unity (or other non-thread safe environemtns) to decide when they want delegates to be called as well as doing it from the game thread.
As it is in non-queue mode (which the API defaults to for backwards compatibility) it is the thread with the TCP connection that when it receives data also calls the delegate - at the time when it gets the data.
If Unity e.g. was currently iterating over a ArrayList of chat messages, and the API suddenly updated the same ArrayList then you would get an error.
This is what the new queue mode handles - it queues up all network events internally - and when you form your game call the ProcessEventQueue() method, then it empties that queue.
It is thus very easy to use and very transparent for the developer. Simply do this in Unity (or other clients) and your delegates will be called as usual. No other changes to the client code compared to previous examples/tutorials:
Code: Select all
smartFox = new SmartFoxClient();
smartFox.runInQueueMode = true;
void FixedUpdate() {
smartFox.ProcessEventQueue();
}
The API will right there totally empty all queued up messages from the server.
Sending messages is still instant - the queue mode is only on the receiving/processing side.
If you check the tic-tac-toe tutorial as well as the island demo, both of these use this new queue mode.
And I would actually say that it is _the_ preferred mode for usage in Unity.
It is naturally up to you when you want the processing to happen. FixedUpdate is a good place, but it could also happen for each frame (Update) or whenever you want.
Shoot away with questions if you have any!
/Thomas
Hi,
thanks and welcome
Just wanted to mention that the latest version of the API is 1.2.3 and it's found here.
thanks and welcome
Just wanted to mention that the latest version of the API is 1.2.3 and it's found here.
Return to “.Net / Unity3D API”
Who is online
Users browsing this forum: No registered users and 13 guests