Smart Fox Client API Entities.Initialize() Question

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

Moderators: Lapo, Bax

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

Smart Fox Client API Entities.Initialize() Question

Post by dlong »

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

Post by ThomasLund »

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

Post by dlong »

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