Smart Fox Client API Entities.Initialize() Question

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

Moderators: Lapo, Bax

dlong
Posts: 26
Joined: 05 May 2009, 02:46
Location: Los Angeles, CA

Smart Fox Client API Entities.Initialize() Question

Postby dlong » 23 Jun 2009, 17:25

This is probably best answered by Thomas.

In this method, there is a hashtable that gets initialized. The problem is that I'm trying to create more than one to connection to my server and this section chokes because it's trying to add duplicate keys to the ascTab hashtable.

Actual code:

Code: Select all

internal static void Initialize() {
//--- XML Entities Conversion table ----------------------
ascTab.Add(">", ">");


Another way:

Code: Select all

internal static void Initialize() {
//--- XML Entities Conversion table ----------------------
ascTab[">"] = ">";


I'm just curious if this is the intended design? If so, what are the ramifications of modifying this code as above to support multiple connections? If not, will there be any updates that fix this behavior.

Let me know what you think Thomas.

Best,

DL
ThomasLund
Posts: 1297
Joined: 14 Mar 2008, 07:52
Location: Sweden

Postby ThomasLund » 24 Jun 2009, 16:59

Ahhh - right - not a scenario that I've got a testcase for.

You can solve that by adding a ascTab.Clear(); as the first statement. Saves you from reworking more than one line.

I'll write that on the todo list for next release.

:-)

/Thomas
dlong
Posts: 26
Joined: 05 May 2009, 02:46
Location: Los Angeles, CA

Postby dlong » 24 Jun 2009, 19:29

Thanks Thomas!!! You're the best!!! :)

Return to “.Net / Unity3D API”

Who is online

Users browsing this forum: No registered users and 18 guests