How can I send and receive ExtensionRequests in this way

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

fatax
Posts: 3
Joined: 17 Jan 2018, 12:29

How can I send and receive ExtensionRequests in this way

Postby fatax » 27 Oct 2018, 01:11

Hi,
The code below using at send a ExtensionRequest within AS3 client to the server:

Code: Select all

public function requestData(param1:String, param2:Object, param3:Function, param4:Room = null) : void
      {
         if(dataList[param1] == null)
         {
            dataList[param1] = [];
         }
         if(param3)
         {
            dataList[param1].push(param3);
         }
         var _loc5_:ServiceParameters = new ServiceParameters();
         _loc5_.sn = param1;
         _loc5_.data = JSON.stringify(param2 == null?{}:param2);
         _sfs.send(new ExtensionRequest(param1,_loc5_.getSFSObject(),param4));
      }


And this one is the response listener function:

Code: Select all

var _loc3_:* = null;
         var _loc5_:* = null;
         var _loc6_:int = 0;
         var _loc7_:String = param1.params.cmd;
         var _loc4_:ISFSObject = param1.params.params;
         var _loc2_:String = checkResponse(_loc7_,_loc4_);
         if(_loc2_ == null)
         {
            return;
         }


Well, how can I send / receive requests like this using C# API?
Thx in advance!
User avatar
Lapo
Site Admin
Posts: 23007
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How can I send and receive ExtensionRequests in this way

Postby Lapo » 27 Oct 2018, 14:54

Hi,
C# and AS3 work the same. So you send an ExtensionRequest() object with the necessary parameters wrapped in an SFSObject.

If you need more details on each method you can check the specific C# client documentation:
http://docs2x.smartfoxserver.com/api-do ... 8ad8de.htm

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 62 guests