home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Puzzle / Clusterz / Clusterz.swf / scripts / it / gotoandplay / smartfoxserver / handlers / ExtHandler.as next >
Encoding:
Text File  |  2008-09-12  |  2.0 KB  |  62 lines

  1. package it.gotoandplay.smartfoxserver.handlers
  2. {
  3.    import it.gotoandplay.smartfoxserver.SFSEvent;
  4.    import it.gotoandplay.smartfoxserver.SmartFoxClient;
  5.    import it.gotoandplay.smartfoxserver.util.ObjectSerializer;
  6.    
  7.    public class ExtHandler implements IMessageHandler
  8.    {
  9.        
  10.       
  11.       private var sfs:SmartFoxClient;
  12.       
  13.       public function ExtHandler(param1:SmartFoxClient)
  14.       {
  15.          super();
  16.          this.sfs = param1;
  17.       }
  18.       
  19.       public function handleMessage(param1:Object, param2:String) : void
  20.       {
  21.          var _loc3_:Object = null;
  22.          var _loc4_:SFSEvent = null;
  23.          var _loc5_:XML = null;
  24.          var _loc6_:String = null;
  25.          var _loc7_:int = 0;
  26.          var _loc8_:String = null;
  27.          var _loc9_:Object = null;
  28.          if(param2 == SmartFoxClient.XTMSG_TYPE_XML)
  29.          {
  30.             _loc6_ = (_loc5_ = param1 as XML).body.@action;
  31.             _loc7_ = int(_loc5_.body.@id);
  32.             if(_loc6_ == "xtRes")
  33.             {
  34.                _loc8_ = _loc5_.body.toString();
  35.                _loc9_ = ObjectSerializer.getInstance().deserialize(_loc8_);
  36.                _loc3_ = {};
  37.                _loc3_.dataObj = _loc9_;
  38.                _loc3_.type = param2;
  39.                _loc4_ = new SFSEvent(SFSEvent.onExtensionResponse,_loc3_);
  40.                sfs.dispatchEvent(_loc4_);
  41.             }
  42.          }
  43.          else if(param2 == SmartFoxClient.XTMSG_TYPE_JSON)
  44.          {
  45.             _loc3_ = {};
  46.             _loc3_.dataObj = param1.o;
  47.             _loc3_.type = param2;
  48.             _loc4_ = new SFSEvent(SFSEvent.onExtensionResponse,_loc3_);
  49.             sfs.dispatchEvent(_loc4_);
  50.          }
  51.          else if(param2 == SmartFoxClient.XTMSG_TYPE_STR)
  52.          {
  53.             _loc3_ = {};
  54.             _loc3_.dataObj = param1;
  55.             _loc3_.type = param2;
  56.             _loc4_ = new SFSEvent(SFSEvent.onExtensionResponse,_loc3_);
  57.             sfs.dispatchEvent(_loc4_);
  58.          }
  59.       }
  60.    }
  61. }
  62.