Search Unity

SmartFox Server OnExtensionResponse Question

Discussion in 'Multiplayer' started by dorgold, Feb 23, 2010.

  1. dorgold

    dorgold

    Joined:
    Jun 10, 2008
    Posts:
    3
    Hi,

    I am using the SmartFox API with Unity3D and it's working very well so far. One question is, however, still open for me and I have found no clues in the documentation or on the Internet:

    Given the case that I have more than one Server Extension, is there a way to find out the name of the triggering extension right within "OnExtensionResponse", or do I have to provide some variable with the extension's name similar to the "_cmd" variable for the method's name?

    thanks cheers,
    doron
     
  2. hound0999

    hound0999

    Joined:
    Jun 30, 2009
    Posts:
    124
    If your trying to debug something, which I'm guessing is the case then all you need to do is just send the extension name with your data just like a command. Just use something like respond._Ext = "This Extension".

    And for code reference:

    http://www.smartfoxserver.com/docs/docPages/serverSideApi/index.htm

    http://www.smartfoxserver.com/docs/docPages/as1/index.htm - This won't be totally accurate for the Unity API but its close. Usually a case difference or added word. Like in the helper classes at the bottom for user instead getName() its GetName().
     
  3. dorgold

    dorgold

    Joined:
    Jun 10, 2008
    Posts:
    3
    thanks for the reply, thats exactly what i ended up doing :)