home *** CD-ROM | disk | FTP | other *** search
Text File | 2005-09-29 | 50.8 KB | 1,854 lines |
- function getNetDebugVersion()
- {
- return 1;
- }
- function NetDebugConfig()
- {
- }
- function attachNetDebugConfigFunctions(ndc)
- {
- var _loc1_ = ndc;
- _loc1_.setDebug = function(setval)
- {
- this.m_debug = setval;
- };
- _loc1_.getDebug = function()
- {
- return this.m_debug;
- };
- for(var _loc2_ in _loc1_)
- {
- if(typeof _loc1_[_loc2_] == "object")
- {
- attachNetDebugConfigFunctions(_loc1_[_loc2_]);
- }
- }
- }
- function getDefaultNetDebugConfig(iscontroller)
- {
- var _loc1_ = _global;
- if(_loc1_.netDebugConfigSO == undefined)
- {
- var _loc2_ = "TestMovie_Config_Info";
- if(iscontroller)
- {
- _loc2_ = "Controller_Config_Info";
- }
- _loc1_.netDebugConfigSO = SharedObject.getLocal(_loc2_);
- }
- if(_loc1_.netDebugConfigSO.data.config == undefined)
- {
- _loc1_.netDebugConfigSO.data.config = getRealDefaultNetDebugConfig();
- }
- _loc1_.netDebugConfigSO.flush();
- return _loc1_.netDebugConfigSO.data.config;
- }
- function getRealDefaultNetDebugConfig()
- {
- var _loc1_ = new NetDebugConfig();
- _loc1_.m_debug = true;
- _loc1_.client = new NetDebugConfig();
- _loc1_.client.m_debug = true;
- _loc1_.client.trace = true;
- _loc1_.client.recordset = true;
- _loc1_.client.http = true;
- _loc1_.client.rtmp = true;
- _loc1_.realtime_server = new NetDebugConfig();
- _loc1_.realtime_server.m_debug = true;
- _loc1_.realtime_server.trace = true;
- _loc1_.app_server = new NetDebugConfig();
- _loc1_.app_server.m_debug = true;
- _loc1_.app_server.trace = true;
- _loc1_.app_server.error = true;
- _loc1_.app_server.recordset = true;
- _loc1_.app_server.httpheaders = false;
- _loc1_.app_server.amf = false;
- _loc1_.app_server.amfheaders = false;
- _loc1_.app_server.coldfusion = true;
- return _loc1_;
- }
- function NetDebugEvent()
- {
- }
- function NetDebugErrorEvent(dataobj)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "NetDebugError";
- _loc1_.Error = dataobj;
- }
- function NetDebugTraceEvent(traceobj)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "Trace";
- _loc1_.Trace = traceobj;
- }
- function NetDebugTraceNetServicesEvent(w, s, n, m)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "NetServicesTrace";
- _loc1_.Trace = m;
- _loc1_.Who = w;
- _loc1_.Severity = s;
- _loc1_.Number = n;
- }
- function NetDebugNCEvent()
- {
- }
- function NetDebugResultEvent(resultobj)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "Result";
- _loc1_.Result = resultobj;
- }
- function NetDebugStatusEvent(statusobj)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "Status";
- _loc1_.Status = statusobj;
- }
- function NetDebugConnectEvent(args)
- {
- var _loc1_ = this;
- var _loc2_ = args;
- _loc1_.init();
- _loc1_.EventType = "Connect";
- _loc1_.ConnectString = _loc2_[0];
- if(_loc2_[1] != null)
- {
- _loc1_.UserName = _loc2_[1];
- }
- if(_loc2_[2] != null)
- {
- _loc1_.Password = _loc2_[2];
- }
- }
- function NetDebugCallEvent(args)
- {
- var _loc2_ = this;
- var _loc3_ = args;
- _loc2_.init();
- _loc2_.EventType = "Call";
- _loc2_.MethodName = _loc3_[0];
- _loc2_.Parameters = new Array();
- var alen = _loc3_.length;
- var _loc1_ = 2;
- while(_loc1_ < alen)
- {
- _loc2_.Parameters[_loc1_ - 2] = _loc3_[_loc1_];
- _loc1_ = _loc1_ + 1;
- }
- }
- function NetDebugCloseEvent()
- {
- this.init();
- this.EventType = "Close";
- }
- function NetDebugAddHeaderEvent(args)
- {
- var _loc1_ = this;
- var _loc2_ = args;
- _loc1_.init();
- _loc1_.EventType = "AddHeader";
- _loc1_.HeaderName = _loc2_[0];
- _loc1_.MustUnderstand = _loc2_[1];
- if(_loc2_[2] != null)
- {
- _loc1_.HeaderObject = _loc2_[2];
- }
- }
- function NetDebugRtmpLogEvent(infoobj)
- {
- var _loc1_ = this;
- _loc1_.initDate();
- _loc1_.EventType = "Trace";
- _loc1_.Source = "Flash Communication Server";
- _loc1_.Info = infoobj;
- _loc1_.Trace = infoobj.description;
- }
- function NetDebugDuplicateNCDErrorEvent()
- {
- var _loc1_ = this;
- _loc1_.initDate();
- _loc1_.EventType = "Error";
- _loc1_.Source = "NCD";
- _loc1_.Message = "NCD_ALREADY_RUNNING";
- }
- function NetDebugFailedSendErrorEvent(ev)
- {
- var _loc1_ = this;
- _loc1_.initDate();
- _loc1_.EventType = "Error";
- _loc1_.Source = "NCD";
- _loc1_.OriginalEvent = ev;
- _loc1_.Message = "NCD_FAILED_TO_SEND_EVENT";
- }
- function NetDebugInfoErrorEvent(infoobj, mes)
- {
- var _loc1_ = this;
- _loc1_.initDate();
- _loc1_.EventType = "Error";
- _loc1_.Source = "NCD";
- _loc1_.Info = infoobj;
- if(mes != null)
- {
- _loc1_.Message = mes;
- }
- }
- function NetDebugReceiveCallEvent(mName, args)
- {
- var _loc1_ = this;
- _loc1_.init();
- _loc1_.EventType = "ReceivedCall";
- _loc1_.MethodName = mName;
- _loc1_.Parameters = args;
- }
- function netDebugProxyConnect()
- {
- var _loc1_ = this;
- var _loc2_ = arguments;
- _loc1_.attachDebug();
- var _loc3_ = _loc2_[0].substr(0,4);
- if(_loc3_ == "http" || _loc3_.substr(0,4) == "rtmp")
- {
- if(_loc2_[0].charAt(4) == ":")
- {
- _loc1_.m_Protocol = _loc3_;
- }
- else
- {
- _loc1_.m_Protocol = _loc2_[0].substr(0,5);
- }
- }
- else
- {
- _loc1_.m_Protocol = "http";
- }
- _loc1_.sendClientEvent(new NetDebugConnectEvent(_loc2_));
- if(_loc1_.isRealTime())
- {
- _loc1_.m_ConnectString = _loc2_[0];
- getNetDebug().sendCommand(new StartRTMPTraceCommand(_loc2_[0]));
- var ret = _loc1_.realconnect.apply(_loc1_,_loc2_);
- _loc1_.realcall("@getClientID",new RTMPClientIDResponse(_loc2_[0],_loc1_));
- return ret;
- }
- return _loc1_.realconnect.apply(_loc1_,_loc2_);
- }
- function netDebugProxyCall()
- {
- var _loc1_ = this;
- var _loc2_ = arguments;
- _loc1_.attachDebug();
- _loc1_.sendClientEvent(new NetDebugCallEvent(_loc2_));
- _loc1_.addNetDebugHeader();
- if(_loc1_.m_Config.app_server)
- {
- _loc2_[1] = new NetDebugResponseProxy(_loc1_,_loc2_[1]);
- return _loc1_.realcall.apply(_loc1_,_loc2_);
- }
- return _loc1_.realcall.apply(_loc1_,_loc2_);
- }
- function netDebugProxyClose()
- {
- var _loc1_ = this;
- _loc1_.attachDebug();
- _loc1_.sendClientEvent(new NetDebugCloseEvent());
- if(_loc1_.isRealTime())
- {
- getNetDebug().sendCommand(new StopRTMPTraceCommand(_loc1_.m_ConnectString,_loc1_.m_ClientId));
- }
- var _loc2_ = _loc1_.realclose();
- getNetDebug().removeNetConnection(_loc1_);
- return _loc2_;
- }
- function netDebugProxyAddHeader()
- {
- var _loc1_ = this;
- _loc1_.attachDebug();
- _loc1_.sendClientEvent(new NetDebugAddHeaderEvent(arguments));
- return _loc1_.realaddHeader.apply(_loc1_,arguments);
- }
- function RTMPClientIDResponse(cs, nc)
- {
- this.m_ConnectString = cs;
- this.m_NC = nc;
- }
- function NetDebugResponseProxy(source, original)
- {
- this.m_SourceNC = source;
- this.m_OriginalNR = original;
- }
- function GlobalLocalConnection(iscontroller, receiver, domainname)
- {
- var _loc2_ = this;
- var _loc3_ = _global;
- _loc2_.maxConnections = 10;
- var sToMovie = "_NetDebugLocalToDebugMovie";
- var sToController = "_NetDebugLocalToController";
- var connectname = null;
- if(iscontroller)
- {
- connectname = sToController;
- _loc2_.sendnames = new Array();
- _loc2_.sendnames.push(sToMovie);
- var _loc1_ = 0;
- while(_loc1_ < _loc2_.maxConnections)
- {
- _loc2_.sendnames.push(sToMovie + _loc1_);
- _loc1_ = _loc1_ + 1;
- }
- _loc2_.maxConnections = 0;
- }
- else
- {
- connectname = sToMovie;
- _loc2_.sendnames = new Array();
- _loc2_.sendnames.push(sToController);
- }
- _loc2_.setDomainName(domainname);
- if(_loc3_.g_NetDebugLocalConnection == undefined)
- {
- _loc3_.g_NetDebugLocalConnection = new LocalConnection();
- _loc3_.g_NetDebugLocalConnection.allowDomain = function()
- {
- return true;
- };
- }
- if(receiver != null)
- {
- _loc3_.g_NetDebugLocalConnection.m_Receiver = receiver;
- _loc3_.g_NetDebugLocalConnection.onData = function(dataobj)
- {
- _global.g_NetDebugLocalConnection.m_Receiver.onReceive(dataobj);
- };
- _loc3_.g_NetDebugLocalConnection.onCommand = function(commandobj)
- {
- _global.g_NetDebugLocalConnection.m_Receiver.onReceiveCommand(commandobj);
- };
- if(!_loc3_.g_NetDebugLocalConnection.connect(connectname))
- {
- var connected = false;
- _loc1_ = 0;
- while(_loc1_ < _loc2_.maxConnections)
- {
- if(_loc3_.g_NetDebugLocalConnection.connect(connectname + _loc1_))
- {
- connected = true;
- break;
- }
- _loc1_ = _loc1_ + 1;
- }
- if(!connected)
- {
- if(iscontroller)
- {
- receiver.onReceiveError(new NetDebugDuplicateNCDErrorEvent());
- }
- }
- }
- }
- }
- function LocalCommand()
- {
- }
- function UpdateNetDebugConfigCommand(dataobj)
- {
- this.init("updateConfig",dataobj);
- }
- function GetConfigCommand()
- {
- this.init("getConfig",null);
- }
- function StartRTMPTraceCommand(cs)
- {
- var _loc1_ = new Object();
- _loc1_.connectstring = cs;
- _loc1_.url = _root._url;
- this.init("startRealTimeTrace",_loc1_);
- }
- function AddRTMPClientCommand(cs, cid)
- {
- var _loc1_ = new Object();
- _loc1_.connectstring = cs;
- _loc1_.url = _root._url;
- _loc1_.clientid = cid;
- this.init("addRealTimeClient",_loc1_);
- }
- function StopRTMPTraceCommand(cs, cid)
- {
- var _loc1_ = new Object();
- _loc1_.connectstring = cs;
- _loc1_.url = _root._url;
- _loc1_.clientid = cid;
- this.init("stopRealTimeTrace",_loc1_);
- }
- function NetDebug()
- {
- var _loc1_ = this;
- _loc1_.m_ncs = new Array();
- _loc1_.m_Config = getDefaultNetDebugConfig();
- _loc1_.m_glc = new GlobalLocalConnection(false,_loc1_);
- _loc1_.m_glc.sendCommand(new GetConfigCommand());
- _loc1_.m_NextNewId = 0;
- }
- function getNetDebug()
- {
- return _global.netDebugInstance;
- }
- function inserths_Result(result)
- {
- _root.inserthsresult = result;
- }
- _global.RsDataProviderClass = function()
- {
- this.init();
- };
- RsDataProviderClass.prototype.init = function()
- {
- var _loc1_ = this;
- _loc1_.items = new Array();
- _loc1_.uniqueID = 0;
- _loc1_.views = new Array();
- mx.events.EventDispatcher.initialize(_loc1_);
- };
- RsDataProviderClass.prototype.addView = function(viewRef)
- {
- this.views.push(viewRef);
- var _loc1_ = {eventName:"updateAll"};
- viewRef.modelChanged(_loc1_);
- };
- RsDataProviderClass.prototype.addItemAt = function(index, value)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- if(_loc2_.checkLocal())
- {
- if(_loc1_ >= 0)
- {
- if(_loc1_ < _loc2_.length)
- {
- _loc2_.items.splice(_loc1_,0,"tmp");
- }
- _loc2_.items[_loc1_] = new Object();
- if(typeof value == "object")
- {
- _loc2_.items[_loc1_] = value;
- }
- _loc2_.items[_loc1_].__ID__ = _loc2_.uniqueID++;
- var _loc3_ = {eventName:"addItems",firstItem:_loc1_,lastItem:_loc1_};
- _loc2_.updateViews(_loc3_);
- }
- }
- };
- RsDataProviderClass.prototype.addItem = function(value)
- {
- var _loc1_ = this;
- if(_loc1_.checkLocal())
- {
- _loc1_.addItemAt(_loc1_.length,value);
- }
- };
- RsDataProviderClass.prototype.removeItemAt = function(index)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- if(_loc2_.checkLocal())
- {
- if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
- {
- var tmpItm = _loc2_.items[_loc1_];
- _loc2_.items.splice(_loc1_,1);
- var _loc3_ = {eventName:"deleteItems",firstItem:_loc1_,lastItem:_loc1_};
- _loc2_.updateViews(_loc3_);
- return tmpItm;
- }
- }
- };
- RsDataProviderClass.prototype.removeAll = function()
- {
- var _loc1_ = this;
- if(_loc1_.checkLocal())
- {
- _loc1_.items = new Array();
- _loc1_.updateViews({eventName:"removeItems",firstItem:0,lastItem:_loc1_.length - 1});
- }
- };
- RsDataProviderClass.prototype.replaceItemAt = function(index, itemObj)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- if(_loc2_.checkLocal())
- {
- if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
- {
- var _loc3_ = _loc2_.getItemID(_loc1_);
- _loc2_.items[_loc1_] = itemObj;
- _loc2_.items[_loc1_].__ID__ = _loc3_;
- _loc2_.updateViews({eventName:"updateItems",firstItem:_loc1_,lastItem:_loc1_});
- }
- }
- };
- RsDataProviderClass.prototype.getLength = function()
- {
- return this.items.length;
- };
- RsDataProviderClass.prototype.addProperty("length",RsDataProviderClass.prototype.getLength,null);
- RsDataProviderClass.prototype.getItemAt = function(index)
- {
- return this.items[index];
- };
- RsDataProviderClass.prototype.getItemID = function(index)
- {
- return this.items[index].__ID__;
- };
- RsDataProviderClass.prototype.sortItems = function(compareFunc, order)
- {
- var _loc1_ = this;
- if(_loc1_.checkLocal())
- {
- _loc1_.items.sort(compareFunc);
- if(order == "DESC")
- {
- _loc1_.items.reverse();
- }
- _loc1_.updateViews({eventName:"sort"});
- }
- };
- RsDataProviderClass.prototype.sortItemsBy = function(fieldName, order)
- {
- var _loc1_ = this;
- if(_loc1_.checkLocal())
- {
- _loc1_.items.sortOn(fieldName);
- if(order == "DESC")
- {
- _loc1_.items.reverse();
- }
- _loc1_.updateViews({eventName:"sort",fieldName:fieldName,order:order});
- }
- };
- RsDataProviderClass.prototype.updateViews = function(eventObj)
- {
- var _loc2_ = eventObj;
- _loc2_.type = "modelChanged";
- this.dispatchEvent(_loc2_);
- var _loc3_ = this.views.length;
- if(_loc3_ > 0)
- {
- switch(_loc2_.eventName)
- {
- case "addItems":
- _loc2_.event = "addRows";
- break;
- case "updateItems":
- _loc2_.event = "updateRows";
- break;
- case "removeItems":
- _loc2_.event = "deleteRows";
- }
- _loc2_.firstRow = _loc2_.firstItem;
- _loc2_.lastRow = _loc2_.lastItem;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- this.views[_loc1_].modelChanged(_loc2_);
- _loc1_ = _loc1_ + 1;
- }
- }
- };
- _global.RecordSet = function(columnNames)
- {
- var _loc1_ = this;
- if(_loc1_.mTitles != null)
- {
- _loc1_.views = new Array();
- }
- else
- {
- _loc1_.init();
- if(_loc1_.serverinfo == null)
- {
- if(_loc1_.serverInfo != null)
- {
- _loc1_.serverinfo = _loc1_.serverInfo;
- }
- }
- if(_loc1_.serverinfo == null)
- {
- _loc1_.mTitles = columnNames;
- }
- else if(_loc1_.serverinfo.version != 1)
- {
- NetServices.trace("RecordSet","warning",100,"Received incompatible RecordSet version from server");
- }
- else
- {
- _loc1_.mTitles = _loc1_.serverinfo.columnNames;
- _loc1_.mRecordsAvailable = 0;
- _loc1_.setData(_loc1_.serverinfo.cursor != null ? _loc1_.serverinfo.cursor - 1 : 0,_loc1_.serverinfo.initialData);
- if(_loc1_.serverinfo.initialData.length != _loc1_.serverinfo.totalCount)
- {
- _loc1_.mRecordSetID = _loc1_.serverinfo.id;
- if(_loc1_.mRecordSetID != null)
- {
- _loc1_.serviceName = _loc1_.serverinfo.serviceName != null ? _loc1_.serverinfo.serviceName : "RecordSet";
- _loc1_.mTotalCount = _loc1_.serverinfo.totalCount;
- _loc1_.mDeliveryMode = "ondemand";
- _loc1_.mAllNotified = false;
- _loc1_.mOutstandingRecordCount = 0;
- }
- else
- {
- NetServices.trace("RecordSet","warning",102,"Missing some records, but there\'s no RecordSet id");
- }
- }
- _loc1_.serverinfo = null;
- }
- }
- };
- RecordSet.prototype = new RsDataProviderClass();
- Object.registerClass("RecordSet",RecordSet);
- RecordSet.prototype._setParentService = function(service)
- {
- this.gateway_conn = service.nc;
- };
- RecordSet.prototype.getRecordSetService = function()
- {
- var _loc1_ = this;
- if(_loc1_.mRecordSetService == null)
- {
- if(_loc1_.gateway_conn == null)
- {
- _loc1_.gateway_conn = NetServices.createGatewayConnection();
- }
- else if(_global.netDebugInstance != undefined)
- {
- _loc1_.gateway_conn = _loc1_.gateway_conn.clone();
- }
- if(_global.netDebugInstance != undefined)
- {
- _loc1_.gateway_conn.setupRecordset();
- _loc1_.gateway_conn.setDebugId("RecordSet " + _loc1_.mRecordSetID);
- }
- _loc1_.mRecordSetService = _loc1_.gateway_conn.getService(_loc1_.serviceName,_loc1_);
- if(_loc1_.mRecordSetService == null)
- {
- NetServices.trace("RecordSet","warning",101,"Failed to create RecordSet service");
- _loc1_.mRecordSetService = 0;
- }
- }
- return _loc1_.mRecordSetService;
- };
- RecordSet.prototype.getColumnNames = function()
- {
- return this.mTitles;
- };
- RecordSet.prototype.getLength = function()
- {
- var _loc1_ = this;
- if(_loc1_.mRecordSetID != null)
- {
- return _loc1_.mTotalCount;
- }
- return _loc1_.items.length;
- };
- RecordSet.prototype.addProperty("length",RecordSet.prototype.getLength,null);
- RecordSet.prototype.getItemAt = function(index)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- if(_loc1_ < 0 || _loc1_ >= _loc2_.length)
- {
- return null;
- }
- if(_loc2_.mRecordSetID == null)
- {
- return _loc2_.items[_loc1_];
- }
- _loc2_.requestRecord(_loc1_);
- var _loc3_ = _loc2_.items[_loc1_];
- if(_loc3_ == 1)
- {
- return "in progress";
- }
- return _loc3_;
- };
- RecordSet.prototype.setField = function(index, fieldName, value)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- if(_loc2_.checkLocal())
- {
- if(!(_loc1_ < 0 || _loc1_ >= _loc2_.length))
- {
- _loc2_.items[_loc1_][fieldName] = value;
- _loc2_.updateViews({eventName:"updateItems",firstItem:_loc1_,lastItem:_loc1_});
- }
- }
- };
- RecordSet.prototype.filter = function(filterFunction, context)
- {
- if(!this.checkLocal())
- {
- }
- var _loc3_ = new RecordSet(this.mTitles);
- var rcount = this.length;
- var _loc2_ = 0;
- while(_loc2_ < rcount)
- {
- var _loc1_ = this.getItemAt(_loc2_);
- if(_loc1_ != null && _loc1_ != 1 && filterFunction(_loc1_,context))
- {
- _loc3_.addItem(_loc1_);
- }
- _loc2_ = _loc2_ + 1;
- }
- return _loc3_;
- };
- RecordSet.prototype.sort = function(compareFunc)
- {
- var _loc1_ = this;
- if(_loc1_.checkLocal())
- {
- _loc1_.items.sort(compareFunc);
- _loc1_.updateViews({eventName:"sort"});
- }
- };
- RecordSet.prototype.isLocal = function()
- {
- return this.mRecordSetID == null;
- };
- RecordSet.prototype.isFullyPopulated = function()
- {
- return this.isLocal();
- };
- RecordSet.prototype.getNumberAvailable = function()
- {
- var _loc1_ = this;
- if(_loc1_.isLocal())
- {
- return _loc1_.length;
- }
- return _loc1_.mRecordsAvailable;
- };
- RecordSet.prototype.setDeliveryMode = function(mode, pagesize, numPrefetchPages)
- {
- var _loc1_ = this;
- var _loc2_ = pagesize;
- var _loc3_ = mode;
- _loc1_.mDeliveryMode = _loc3_;
- _loc1_.stopFetchAll();
- if(_loc3_ != "ondemand")
- {
- if(_loc2_ == null)
- {
- _loc2_ = _loc1_.views[0].getRowCount();
- if(_loc2_ == null)
- {
- _loc2_ = 25;
- }
- }
- if(_loc3_ == "page")
- {
- if(numPrefetchPages == null)
- {
- numPrefetchPages = 0;
- }
- _loc1_.mPageSize = _loc2_;
- _loc1_.mNumPrefetchPages = numPrefetchPages;
- }
- else if(_loc3_ == "fetchall")
- {
- _loc1_.stopFetchAll();
- _loc1_.startFetchAll(_loc2_);
- }
- else
- {
- NetServices.trace("RecordSet","warning",107,"SetDeliveryMode: unknown mode string");
- }
- }
- };
- RecordSet.prototype.getRecords_Result = function(info)
- {
- var _loc1_ = this;
- var _loc2_ = info;
- _loc1_.setData(_loc2_.Cursor - 1,_loc2_.Page);
- _loc1_.mOutstandingRecordCount -= _loc2_.Page.length;
- _loc1_.updateViews({eventName:"updateItems",firstItem:_loc2_.Cursor - 1,lastItem:_loc2_.Cursor - 1 + _loc2_.Page.length - 1});
- if(_loc1_.mRecordsAvailable == _loc1_.mTotalCount && !_loc1_.mAllNotified)
- {
- _loc1_.updateViews({eventName:"allRows"});
- _loc1_.mRecordSetService.release();
- _loc1_.mAllNotified = true;
- _loc1_.mRecordSetID = null;
- _loc1_.mRecordSetService = null;
- }
- };
- RecordSet.prototype.release_Result = function()
- {
- };
- RecordSet.prototype.arrayToObject = function(anArray)
- {
- if(this.mTitles == null)
- {
- NetServices.trace("RecordSet","warning",105,"getItem: titles are not available");
- return null;
- }
- var _loc3_ = new Object();
- var alen = anArray.length;
- var _loc1_ = 0;
- while(_loc1_ < alen)
- {
- var _loc2_ = this.mTitles[_loc1_];
- if(_loc2_ == null)
- {
- _loc2_ = "column" + _loc1_ + 1;
- }
- _loc3_[_loc2_] = anArray[_loc1_];
- _loc1_ = _loc1_ + 1;
- }
- return _loc3_;
- };
- RecordSet.prototype.setData = function(start, dataArray)
- {
- var _loc1_ = this;
- var datalen = dataArray.length;
- var _loc2_ = 0;
- while(_loc2_ < datalen)
- {
- var _loc3_ = _loc2_ + start;
- var rec = _loc1_.items[_loc3_];
- if(rec != null && rec != 1)
- {
- NetServices.trace("RecordSet","warning",106,"Already got record # " + recordIndex);
- }
- else
- {
- _loc1_.mRecordsAvailable += 1;
- }
- _loc1_.items[_loc3_] = _loc1_.arrayToObject(dataArray[_loc2_]);
- _loc1_.items[_loc3_].__ID__ = _loc1_.uniqueID++;
- _loc2_ = _loc2_ + 1;
- }
- };
- RecordSet.prototype.requestOneRecord = function(index)
- {
- var _loc1_ = this;
- var _loc2_ = index;
- if(_loc1_.items[_loc2_] == null)
- {
- _loc1_.getRecordSetService().getRecords(_loc1_.mRecordSetID,_loc2_ + 1,1);
- _loc1_.mOutstandingRecordCount = _loc1_.mOutstandingRecordCount + 1;
- _loc1_.items[_loc2_] = 1;
- _loc1_.updateViews({eventName:"fetchRows",firstItem:_loc2_,lastItem:_loc2_});
- }
- };
- RecordSet.prototype.requestRecord = function(index)
- {
- var _loc1_ = this;
- if(_loc1_.mDeliveryMode != "page")
- {
- _loc1_.requestOneRecord(index);
- }
- else
- {
- var _loc2_ = int(index / _loc1_.mPageSize) * _loc1_.mPageSize;
- var _loc3_ = _loc2_ + _loc1_.mPageSize * (_loc1_.mNumPrefetchPages + 1) - 1;
- _loc1_.requestRecordRange(_loc2_,_loc3_);
- }
- };
- RecordSet.prototype.requestRecordRange = function(index, lastIndex)
- {
- var _loc1_ = index;
- var _loc2_ = this;
- var highestRequested = -1;
- if(_loc1_ < 0)
- {
- _loc1_ = 0;
- }
- if(lastIndex >= _loc2_.length)
- {
- lastIndex = _loc2_.length - 1;
- }
- while(_loc1_ <= lastIndex)
- {
- while(_loc1_ <= lastIndex && _loc2_.items[_loc1_] != null)
- {
- _loc1_ = _loc1_ + 1;
- }
- var _loc3_ = _loc1_;
- while(_loc1_ <= lastIndex && _loc2_.items[_loc1_] == null)
- {
- _loc2_.mOutstandingRecordCount = _loc2_.mOutstandingRecordCount + 1;
- _loc2_.items[_loc1_] = 1;
- _loc1_ = _loc1_ + 1;
- }
- var last = _loc1_ - 1;
- if(_loc3_ <= last)
- {
- _loc2_.getRecordSetService().getRecords(_loc2_.mRecordSetID,_loc3_ + 1,last - _loc3_ + 1);
- highestRequested = last;
- _loc2_.updateViews({eventName:"fetchRows",firstItem:_loc3_,lastItem:last});
- }
- }
- return highestRequested;
- };
- RecordSet.prototype.startFetchAll = function(pagesize)
- {
- var _loc1_ = this;
- _loc1_.mDataFetcher.disable();
- _loc1_.mDataFetcher = new RsDataFetcher(_loc1_,pagesize);
- };
- RecordSet.prototype.stopFetchAll = function()
- {
- this.mDataFetcher.disable();
- this.mDataFetcher = null;
- };
- RecordSet.prototype.checkLocal = function()
- {
- if(this.isLocal())
- {
- return true;
- }
- NetServices.trace("RecordSet","warning",108,"Operation not allowed on partial recordset");
- return false;
- };
- _global.RsDataFetcher = function(recordSet, increment)
- {
- var _loc1_ = this;
- _loc1_.mRecordSet = recordSet;
- _loc1_.mRecordSet.addView(_loc1_);
- _loc1_.mIncrement = increment;
- _loc1_.mNextRecord = 0;
- _loc1_.mEnabled = true;
- _loc1_.doNext();
- };
- RsDataFetcher.prototype.disable = function()
- {
- var _loc1_ = this;
- _loc1_.mEnabled = false;
- _loc1_.mRecordSet.removeView(_loc1_);
- };
- RsDataFetcher.prototype.doNext = function()
- {
- var _loc1_ = this;
- if(_loc1_.mEnabled)
- {
- while(true)
- {
- if(_loc1_.mNextRecord >= _loc1_.mRecordSet.length)
- {
- break;
- }
- _loc1_.mHighestRequested = _loc1_.mRecordSet.requestRecordRange(_loc1_.mNextRecord,_loc1_.mNextRecord + _loc1_.mIncrement - 1);
- _loc1_.mNextRecord += _loc1_.mIncrement;
- if(_loc1_.mHighestRequested > 0)
- {
- break;
- }
- }
- }
- };
- RsDataFetcher.prototype.modelChanged = function(eventObj)
- {
- var _loc1_ = this;
- var _loc2_ = eventObj;
- if(_loc2_.eventName == "updateItems" && _loc2_.firstItem <= _loc1_.mHighestRequested && _loc2_.lastItem >= _loc1_.mHighestRequested)
- {
- _loc1_.doNext();
- }
- if(_loc2_.eventName == "allRows")
- {
- _loc1_.disable();
- }
- };
- _global.NetServiceProxyResponder = function(service, methodName)
- {
- this.service = service;
- this.methodName = methodName;
- };
- NetServiceProxyResponder.prototype.onResult = function(result)
- {
- var _loc3_ = result;
- var _loc1_ = this.service.client;
- _loc3_._setParentService(this.service);
- var _loc2_ = this.methodName + "_Result";
- if(typeof _loc1_[_loc2_] == "function")
- {
- _loc1_[_loc2_](_loc3_);
- }
- else if(typeof _loc1_.onResult == "function")
- {
- _loc1_.onResult(_loc3_);
- }
- else
- {
- NetServices.trace("NetServices","info",1,_loc2_ + " was received from server: " + _loc3_);
- }
- };
- NetServiceProxyResponder.prototype.onStatus = function(result)
- {
- var _loc1_ = result;
- var _loc2_ = this.service.client;
- var _loc3_ = this.methodName + "_Status";
- if(typeof _loc2_[_loc3_] == "function")
- {
- _loc2_[_loc3_](_loc1_);
- }
- else if(typeof _loc2_.onStatus == "function")
- {
- _loc2_.onStatus(_loc1_);
- }
- else if(typeof _root.onStatus == "function")
- {
- _root.onStatus(_loc1_);
- }
- else if(typeof _global.System.onStatus == "function")
- {
- _global.System.onStatus(_loc1_);
- }
- else
- {
- NetServices.trace("NetServices","info",2,_loc3_ + " was received from server: <" + _loc1_.level + "> " + _loc1_.description);
- }
- };
- _global.NetServiceProxy = function(nc, serviceName, client)
- {
- var _loc1_ = this;
- if(nc != null)
- {
- _loc1_.nc = nc;
- _loc1_.serviceName = serviceName;
- _loc1_.client = client;
- }
- };
- NetServiceProxy.prototype._setParentService = function(service)
- {
- this.nc = service.nc;
- this.client = service.client;
- };
- NetServiceProxy.prototype.__resolve = function(methodName)
- {
- var _loc1_ = this;
- var _loc2_ = arguments;
- var _loc3_ = function()
- {
- var _loc1_ = this;
- var _loc2_ = arguments;
- if(_loc1_.client != null)
- {
- _loc2_.unshift(new NetServiceProxyResponder(_loc1_,methodName));
- }
- else if(typeof _loc2_[0].onResult != "function")
- {
- NetServices.trace("NetServices","warning",3,"There is no defaultResponder, but no responder was given in call to " + methodName);
- _loc2_.unshift(new NetServiceProxyResponder(_loc1_,methodName));
- }
- _loc2_.unshift(_loc1_.serviceName + "." + methodName);
- return _loc1_.nc.call.apply(_loc1_.nc,_loc2_);
- };
- return _loc3_;
- };
- Object.registerClass("NetServiceProxy",NetServiceProxy);
- NetConnection.prototype.getService = function(serviceName, client)
- {
- var _loc1_ = new NetServiceProxy(this,serviceName,client);
- return _loc1_;
- };
- NetConnection.prototype.setCredentials = function(userid, password)
- {
- this.addHeader("Credentials",false,{userid:userid,password:password});
- };
- NetConnection.prototype.RequestPersistentHeader = function(info)
- {
- var _loc1_ = info;
- this.addHeader(_loc1_.name,_loc1_.mustUnderstand,_loc1_.data);
- };
- NetConnection.prototype.AppendToGatewayUrl = function(urlSuffix)
- {
- var _loc1_ = this;
- _loc1_.__urlSuffix = urlSuffix;
- if(_loc1_.__originalUrl == null)
- {
- _loc1_.__originalUrl = _loc1_.uri;
- }
- var _loc2_ = _loc1_.__originalUrl + urlSuffix;
- _loc1_.connect(_loc2_);
- };
- NetConnection.prototype.ReplaceGatewayUrl = function(newUrl)
- {
- this.connect(newUrl);
- };
- NetConnection.prototype.clone = function()
- {
- var _loc1_ = new NetConnection();
- _loc1_.connect(this.uri);
- return _loc1_;
- };
- if(_global.NetServices == null)
- {
- _global.NetServices = new Object();
- NetServices.gatewayUrl = gatewayUrl;
- }
- NetServices.setDefaultGatewayUrl = function(url)
- {
- NetServices.defaultGatewayUrl = url;
- };
- NetServices.setGatewayUrl = function(url)
- {
- NetServices.gatewayUrl = url;
- };
- NetServices.createGatewayConnection = function(url)
- {
- var _loc1_ = url;
- if(_loc1_ == undefined)
- {
- _loc1_ = NetServices.gatewayUrl;
- if(_loc1_ == undefined)
- {
- _loc1_ = NetServices.defaultGatewayUrl;
- }
- }
- if(_loc1_ == undefined)
- {
- NetServices.trace("NetServices","warning",4,"createGatewayConnection - gateway url is undefined");
- return null;
- }
- var _loc2_ = new NetConnection();
- _loc2_.connect(_loc1_);
- return _loc2_;
- };
- NetServices.getHostUrl = function()
- {
- var _loc2_ = _root;
- if(!NetServices.isHttpUrl(_loc2_._url))
- {
- return null;
- }
- var _loc1_ = _loc2_._url.indexOf("/",8);
- if(_loc1_ < 0)
- {
- return null;
- }
- return _loc2_._url.substring(0,_loc1_);
- };
- NetServices.isHttpUrl = function(url)
- {
- return url.indexOf("http://") == 0 || url.indexOf("https://") == 0;
- };
- NetServices.trace = function(who, severity, number, message)
- {
- var _loc1_ = who + " " + severity + " " + number + ": " + message;
- trace(_loc1_);
- NetDebug.traceNetServices(who,severity,number,message);
- };
- NetServices.getVersion = function()
- {
- return 1;
- };
- _global.copyProperties = function(to, from)
- {
- var _loc1_ = from;
- var _loc2_ = to;
- for(var _loc3_ in _loc1_)
- {
- if(!(_loc3_ == "__proto__" || _loc3_ == "function"))
- {
- if(typeof _loc1_[_loc3_] == "object")
- {
- if(_loc2_[_loc3_] == undefined)
- {
- _loc2_[_loc3_] = new _loc1_[_loc3_].__proto__.constructor();
- }
- copyProperties(_loc2_[_loc3_],_loc1_[_loc3_]);
- }
- else
- {
- _loc2_[_loc3_] = _loc1_[_loc3_];
- }
- }
- }
- };
- _global.copyObject = function(obj)
- {
- var _loc2_ = obj;
- if(typeof _loc2_ == "object")
- {
- var _loc1_ = new _loc2_.__proto__.constructor();
- copyProperties(_loc1_,_loc2_);
- return _loc1_;
- }
- return _loc2_;
- };
- _global.objectToStringTree = function(obj, openstr, typesepstr, valuesepstr, closestr)
- {
- var _loc1_ = new StringLineAdder(obj,new TreeLineRenderer(openstr != null ? openstr : "{",typesepstr != null ? typesepstr : ":",valuesepstr != null ? valuesepstr : ", ",closestr != null ? closestr : "}"));
- return _loc1_.getString();
- };
- _global.objectToListboxTree = function(listbox, obj, openstr, typesepstr, valuesepstr, closestr)
- {
- new ListLineAdder(listbox,obj,new TreeLineRenderer(openstr != null ? openstr : "{",typesepstr != null ? typesepstr : ":",valuesepstr != null ? valuesepstr : ", ",closestr != null ? closestr : "}"));
- };
- _global.StringLineAdder = function(obj, renderer)
- {
- var _loc1_ = this;
- _loc1_.linerenderer = renderer;
- _loc1_.output = "";
- nestedObjectDump(0,null,obj,_loc1_);
- };
- StringLineAdder.prototype.getString = function()
- {
- return this.output;
- };
- StringLineAdder.prototype.addLine = function(level, objname, objtype, objvalue, objnum)
- {
- var _loc1_ = this.linerenderer.getLine(level,objname,objtype,objvalue,objnum);
- if(_loc1_ != null)
- {
- this.output += _loc1_ + "\n";
- }
- return true;
- };
- _global.ListLineAdder = function(listbox, obj, renderer)
- {
- var _loc1_ = this;
- _loc1_.linerenderer = renderer;
- _loc1_.output_lb = listbox;
- nestedObjectDump(0,null,obj,_loc1_);
- };
- ListLineAdder.prototype.addLine = function(level, objname, objtype, objvalue, objnum)
- {
- var _loc1_ = this.linerenderer.getLine(level,objname,objtype,objvalue,objnum);
- if(_loc1_ != null)
- {
- this.output_lb.addItem(_loc1_);
- }
- return true;
- };
- _global.TreeLineRenderer = function(pre, typedelim, valuedelim, post)
- {
- this.init(pre,typedelim,valuedelim,post);
- };
- TreeLineRenderer.prototype.init = function(pre, typedelim, valuedelim, post)
- {
- var _loc1_ = this;
- _loc1_.prechar = pre;
- _loc1_.typechar = typedelim;
- _loc1_.valuechar = valuedelim;
- _loc1_.postchar = post;
- };
- TreeLineRenderer.prototype.getLine = function(level, objname, objtype, objvalue, objnum)
- {
- var _loc3_ = this;
- var _loc2_ = "";
- var _loc1_ = 0;
- while(_loc1_ < level)
- {
- _loc2_ += "\t";
- _loc1_ = _loc1_ + 1;
- }
- var valuedelim = _loc3_.valuechar;
- if(objname != null && objtype != "object")
- {
- _loc2_ += _loc3_.prechar + objtype + _loc3_.typechar + objname;
- }
- else if(objtype == "object")
- {
- if(typeof objvalue == "number")
- {
- _loc2_ += _loc3_.prechar + objtype + _loc3_.typechar + objname;
- _loc2_ += valuedelim + "object#" + objvalue;
- objvalue = null;
- }
- else
- {
- _loc2_ += _loc3_.prechar + objtype + "#" + objnum + _loc3_.typechar + objname;
- }
- }
- else
- {
- _loc2_ += _loc3_.prechar + objtype;
- valuedelim = _loc3_.typechar;
- }
- if(objvalue != null)
- {
- _loc2_ += valuedelim + objvalue;
- }
- _loc2_ += _loc3_.postchar;
- return _loc2_;
- };
- _global.nestedObjectDump = function(level, objname, obj, lineadder)
- {
- var _loc1_ = obj;
- if(level == 0)
- {
- nestedObjectDump.callcount = nestedObjectDump.callcount + 1;
- nestedObjectDump.objcount = -1;
- }
- if(_loc1_ == null)
- {
- return lineadder.addLine(level,objname,"undefined");
- }
- if(typeof _loc1_ == "function")
- {
- return lineadder.addLine(level,objname,"function");
- }
- if(typeof _loc1_ == "object")
- {
- if(_loc1_.__nestedObjectDump_id != undefined && _loc1_.__nestedObjectDump_ref == nestedObjectDump.callcount)
- {
- return lineadder.addLine(level,objname,"object",_loc1_.__nestedObjectDump_id);
- }
- nestedObjectDump.objcount = nestedObjectDump.objcount + 1;
- if(lineadder.addLine(level,objname,"object",null,nestedObjectDump.objcount) == nestedObjectDump.skip)
- {
- return nestedObjectDump.proceed;
- }
- _loc1_.__nestedObjectDump_id = nestedObjectDump.objcount;
- _loc1_.__nestedObjectDump_ref = nestedObjectDump.callcount;
- var props = new Array();
- var _loc3_ = new Array();
- for(var prop in _loc1_)
- {
- if(!(prop == "__proto__" || prop == "__nestedObjectDump_id" || prop == "__nestedObjectDump_ref"))
- {
- if(typeof _loc1_[prop] == "object")
- {
- _loc3_.push(prop);
- }
- else
- {
- props.push(prop);
- }
- }
- }
- if(_loc3_.length == 0 && props.length == 0)
- {
- if(typeof _loc1_.toString == "function" && _loc1_.toString() != "")
- {
- return lineadder.addLine(level + 1,null,"string",_loc1_.toString());
- }
- if(lineadder.noProps != undefined)
- {
- lineadder.noProps(level + 1);
- return nestedObjectDump.proceed;
- }
- }
- props.sort();
- _loc3_.sort();
- var bret = true;
- var plen = props.length;
- var _loc2_ = 0;
- while(_loc2_ < plen)
- {
- if(nestedObjectDump(level + 1,props[_loc2_],_loc1_[props[_loc2_]],lineadder) == nestedObjectDump.stop)
- {
- bret = false;
- break;
- }
- _loc2_ = _loc2_ + 1;
- }
- if(bret)
- {
- var olen = _loc3_.length;
- _loc2_ = 0;
- while(_loc2_ < olen)
- {
- if(!nestedObjectDump(level + 1,_loc3_[_loc2_],_loc1_[_loc3_[_loc2_]],lineadder))
- {
- bret = false;
- }
- _loc2_ = _loc2_ + 1;
- }
- }
- return nestedObjectDump.proceed;
- }
- return lineadder.addLine(level,objname,typeof _loc1_,_loc1_);
- };
- nestedObjectDump.proceed = 1;
- nestedObjectDump.skip = 2;
- nestedObjectDump.stop = 3;
- nestedObjectDump.callcount = 0;
- nestedObjectDump.objcount = 0;
- Object.registerClass("NetDebugConfig",NetDebugConfig);
- NetDebugEvent.prototype.init = function()
- {
- var _loc1_ = this;
- _loc1_.EventType = "DebugEvent";
- _loc1_.Source = "Client";
- _loc1_.MovieUrl = unescape(_root._url);
- _loc1_.initDate();
- };
- NetDebugEvent.prototype.initDate = function()
- {
- var _loc1_ = new Date();
- this.Date = _loc1_;
- this.Time = _loc1_.getTime();
- };
- NetDebugErrorEvent.prototype = new NetDebugEvent();
- NetDebugTraceEvent.prototype = new NetDebugEvent();
- NetDebugTraceNetServicesEvent.prototype = new NetDebugEvent();
- NetDebugNCEvent.prototype = new NetDebugEvent();
- NetDebugResultEvent.prototype = new NetDebugNCEvent();
- NetDebugStatusEvent.prototype = new NetDebugNCEvent();
- NetDebugConnectEvent.prototype = new NetDebugNCEvent();
- NetDebugCallEvent.prototype = new NetDebugNCEvent();
- NetDebugCloseEvent.prototype = new NetDebugNCEvent();
- NetDebugAddHeaderEvent.prototype = new NetDebugNCEvent();
- NetDebugRtmpLogEvent.prototype = new NetDebugNCEvent();
- NetDebugDuplicateNCDErrorEvent.prototype = new NetDebugNCEvent();
- NetDebugFailedSendErrorEvent.prototype = new NetDebugNCEvent();
- NetDebugInfoErrorEvent.prototype = new NetDebugNCEvent();
- NetDebugResultEvent.prototype = new NetDebugNCEvent();
- _global.StripNCDEventToMinmal = function(ev)
- {
- var _loc1_ = ev;
- var _loc2_ = new Object();
- if(_loc1_.EventType != null)
- {
- _loc2_.EventType = _loc1_.EventType;
- }
- if(_loc1_.Source != null)
- {
- _loc2_.Source = _loc1_.Source;
- }
- if(_loc1_.MovieUrl != null)
- {
- _loc2_.MovieUrl = _loc1_.MovieUrl;
- }
- if(_loc1_.Date != null)
- {
- _loc2_.Date = _loc1_.Date;
- }
- if(_loc1_.Time != null)
- {
- _loc2_.Time = _loc1_.Time;
- }
- if(_loc1_.Protocol != null)
- {
- _loc2_.Protocol = _loc1_.Protocol;
- }
- if(_loc1_.DebugId != null)
- {
- _loc2_.DebugId = _loc1_.DebugId;
- }
- return _loc2_;
- };
- NetConnection.prototype.attachDebug = function()
- {
- var _loc1_ = this;
- if(!_loc1_.m_Attached)
- {
- _loc1_.m_Attached = true;
- _loc1_.m_HeaderAdded = false;
- _loc1_.m_Config = new NetDebugConfig();
- copyProperties(_loc1_.m_Config,getNetDebug().m_Config);
- _loc1_.m_Protocol = "none";
- _loc1_.m_Id = getNetDebug().addNetConnection(_loc1_);
- }
- };
- NetConnection.prototype.sendDebugEvent = function(eventobj)
- {
- var _loc1_ = eventobj;
- _loc1_.Protocol = this.m_Protocol;
- _loc1_.DebugId = this.m_Id;
- return getNetDebug().onEvent(_loc1_);
- };
- NetConnection.prototype.sendServerEvent = function(eventobj)
- {
- eventobj.MovieUrl = unescape(_root._url);
- if(this.sendDebugEvent(eventobj))
- {
- }
- };
- NetConnection.prototype.sendClientEvent = function(eventobj)
- {
- var _loc1_ = this;
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug)
- {
- if(_loc1_.m_Config.client.http && _loc1_.m_Protocol == "http" || _loc1_.m_Config.client.rtmp && _loc1_.m_Protocol.substr(0,4) == "rtmp")
- {
- if(_loc1_.sendDebugEvent(eventobj))
- {
- }
- }
- }
- };
- NetConnection.prototype.addNetDebugHeader = function()
- {
- var _loc1_ = this;
- if(!_loc1_.m_HeaderAdded)
- {
- _loc1_.m_HeaderAdded = true;
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.app_server.m_debug && _loc1_.m_Protocol == "http")
- {
- _loc1_.realaddHeader("amf_server_debug",true,_loc1_.m_Config.app_server);
- }
- else
- {
- _loc1_.realaddHeader("amf_server_debug",true,undefined);
- }
- }
- };
- NetConnection.prototype.updateConfig = function(config)
- {
- var _loc1_ = this;
- _loc1_.attachDebug();
- copyProperties(_loc1_.m_Config,config);
- _loc1_.m_HeaderAdded = false;
- };
- NetConnection.prototype.isRealTime = function()
- {
- return this.m_Protocol.substr(0,4) == "rtmp";
- };
- NetConnection.prototype.setupRecordset = function()
- {
- var _loc1_ = this;
- _loc1_.attachDebug();
- _loc1_.m_Config.client.http = _loc1_.m_Config.client.recordset;
- };
- NetConnection.prototype.setDebugId = function(id)
- {
- this.attachDebug();
- this.m_Id = id;
- };
- NetConnection.prototype.getDebugId = function()
- {
- this.attachDebug();
- return this.m_Id;
- };
- NetConnection.prototype.trace = function(traceobj)
- {
- var _loc1_ = this;
- _loc1_.attachDebug();
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
- {
- _loc1_.sendDebugEvent(new NetDebugTraceEvent(traceobj));
- }
- };
- NetConnection.prototype.getDebugConfig = function()
- {
- this.attachDebug();
- return this.m_Config;
- };
- if(!NetConnection.prototype.netDebugProxyFunctions)
- {
- NetConnection.prototype.netDebugProxyFunctions = true;
- NetConnection.prototype.realconnect = NetConnection.prototype.connect;
- NetConnection.prototype.realcall = NetConnection.prototype.call;
- NetConnection.prototype.realclose = NetConnection.prototype.close;
- NetConnection.prototype.realaddHeader = NetConnection.prototype.addHeader;
- NetConnection.prototype.connect = netDebugProxyConnect;
- NetConnection.prototype.call = netDebugProxyCall;
- NetConnection.prototype.close = netDebugProxyClose;
- NetConnection.prototype.addHeader = netDebugProxyAddHeader;
- }
- RTMPClientIDResponse.prototype.onResult = function(cid)
- {
- this.m_NC.m_ClientId = cid;
- getNetDebug().sendCommand(new AddRTMPClientCommand(this.m_ConnectString,cid));
- };
- NetDebugResponseProxy.prototype.onDebugEvents = function(debugevents)
- {
- var _loc3_ = debugevents;
- var _loc2_ = _loc3_.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc2_)
- {
- this.m_SourceNC.sendServerEvent(_loc3_[_loc1_]);
- _loc1_ = _loc1_ + 1;
- }
- };
- NetDebugResponseProxy.prototype.onResult = function(resultobj)
- {
- this.m_SourceNC.sendClientEvent(new NetDebugResultEvent(resultobj));
- this.m_OriginalNR.onResult(resultobj);
- };
- NetDebugResponseProxy.prototype.onStatus = function(statusobj)
- {
- var _loc1_ = this;
- var _loc2_ = statusobj;
- _loc1_.m_SourceNC.sendClientEvent(new NetDebugStatusEvent(_loc2_));
- if(_loc1_.m_OriginalNR.onStatus != undefined)
- {
- _loc1_.m_OriginalNR.onStatus(_loc2_);
- }
- else
- {
- _global.System.onStatus(_loc2_);
- }
- };
- NetDebugResponseProxy.prototype.__resolve = function(name)
- {
- this.m_SourceNC.sendClientEvent(new NetDebugReceiveCallEvent(name,arguments));
- this.m_OriginalNR[name].apply(arguments);
- };
- GlobalLocalConnection.prototype.setDomainName = function(domainname)
- {
- var _loc1_ = domainname;
- if(_loc1_ != null && _loc1_ != "")
- {
- this.sendPrefix = _loc1_ + ":";
- }
- else
- {
- this.sendPrefix = "";
- }
- };
- GlobalLocalConnection.prototype.send = function(dataobj)
- {
- return this.sendRaw("onData",dataobj);
- };
- GlobalLocalConnection.prototype.sendCommand = function(commandobj)
- {
- return this.sendRaw("onCommand",commandobj);
- };
- GlobalLocalConnection.prototype.sendRaw = function(functionname, obj)
- {
- var _loc2_ = this;
- var _loc3_ = true;
- var snlen = _loc2_.sendnames.length;
- var _loc1_ = 0;
- while(_loc1_ < snlen)
- {
- _loc3_ &= _global.g_NetDebugLocalConnection.send(_loc2_.sendPrefix + _loc2_.sendnames[_loc1_],functionname,obj);
- _loc1_ = _loc1_ + 1;
- }
- return _loc3_;
- };
- LocalCommand.prototype.init = function(commandname, dataobj)
- {
- this.command = commandname;
- this.data = dataobj;
- };
- UpdateNetDebugConfigCommand.prototype = new LocalCommand();
- GetConfigCommand.prototype = new LocalCommand();
- StartRTMPTraceCommand.prototype = new LocalCommand();
- AddRTMPClientCommand.prototype = new LocalCommand();
- StopRTMPTraceCommand.prototype = new LocalCommand();
- NetDebug.prototype.addNetConnection = function(nc)
- {
- this.m_ncs.push(nc);
- return this.m_NextNewId++;
- };
- NetDebug.prototype.removeNetConnection = function(nc)
- {
- var _loc2_ = this;
- var _loc3_ = _loc2_.m_ncs.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- if(nc == _loc2_.m_ncs[_loc1_])
- {
- _loc2_.m_ncs.splice(_loc1_,1);
- break;
- }
- _loc1_ = _loc1_ + 1;
- }
- };
- NetDebug.prototype.sendDebugEvent = function(eventobj)
- {
- if(!this.m_glc.send(eventobj))
- {
- this.m_glc.send(new NetDebugFailedSendErrorEvent(StripNCDEventToMinmal(eventobj)));
- return false;
- }
- return true;
- };
- NetDebug.prototype.sendCommand = function(commandobj)
- {
- return this.m_glc.sendCommand(commandobj);
- };
- NetDebug.prototype.requestNewConfig = function()
- {
- return this.sendCommand(new GetConfigCommand());
- };
- NetDebug.prototype.updateConfig = function(config)
- {
- var _loc2_ = this;
- copyProperties(_loc2_.m_Config,config);
- var _loc3_ = _loc2_.m_ncs.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- if(_loc2_.m_ncs[_loc1_] != null)
- {
- _loc2_.m_ncs[_loc1_].updateConfig(config);
- }
- _loc1_ = _loc1_ + 1;
- }
- };
- NetDebug.prototype.sendStatus = function(statusobj)
- {
- var _loc1_ = this;
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug)
- {
- return _loc1_.m_glc.send(new NetDebugStatusEvent(statusobj));
- }
- };
- NetDebug.prototype.onEvent = function(eventobj)
- {
- return this.sendDebugEvent(eventobj);
- };
- NetDebug.prototype.onEventError = function(errorobj)
- {
- return this.sendDebugEvent(new NetDebugErrorEvent(errorobj));
- };
- NetDebug.prototype.onReceiveCommand = function(commandobj)
- {
- this[commandobj.command](commandobj.data);
- };
- NetDebug.prototype.onReceiveError = function(errorobj)
- {
- this.sendDebugEvent(new NetDebugErrorEvent(errorobj));
- };
- NetDebug.prototype.traceNetServices = function(who, severity, number, message)
- {
- var _loc1_ = this;
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
- {
- if(_loc1_.sendDebugEvent(new NetDebugTraceNetServicesEvent(who,severity,number,message)))
- {
- }
- }
- };
- NetDebug.prototype.trace = function(traceobj)
- {
- var _loc1_ = this;
- if(_loc1_.m_Config.m_debug && _loc1_.m_Config.client.m_debug && _loc1_.m_Config.client.trace)
- {
- if(_loc1_.sendDebugEvent(new NetDebugTraceEvent(traceobj)))
- {
- }
- }
- };
- if(_global.netDebugInstance == undefined)
- {
- _global.netDebugInstance = new NetDebug();
- }
- NetDebug.trace = function(obj)
- {
- getNetDebug().trace(obj);
- };
- NetDebug.traceNetServices = function(who, severity, number, message)
- {
- getNetDebug().traceNetServices(who,severity,number,message);
- };
- NetDebug.getVersion = function()
- {
- return getNetDebugVersion();
- };
- NetDebug.globalOnStatus = function(statusobj)
- {
- getNetDebug().sendStatus(statusobj);
- };
- if(_global.System.onStatus == undefined)
- {
- _global.System.onStatus = NetDebug.globalOnStatus;
- }
- _global.DataGlue = function(dataProvider)
- {
- this.dataProvider = dataProvider;
- };
- _global.DataGlue.bindFormatStrings = function(dataConsumer, dataProvider, labelString, dataString)
- {
- var _loc1_ = new DataGlue(dataProvider);
- _loc1_.labelString = labelString;
- _loc1_.dataString = dataString;
- _loc1_.getItemAt = _global.DataGlue.getItemAt_FormatString;
- dataConsumer.setDataProvider(_loc1_);
- };
- _global.DataGlue.bindFormatFunction = function(dataConsumer, dataProvider, formatFunction)
- {
- var _loc1_ = new DataGlue(dataProvider);
- _loc1_.formatFunction = formatFunction;
- _loc1_.getItemAt = _global.DataGlue.getItemAt_FormatFunction;
- dataConsumer.setDataProvider(_loc1_);
- };
- _global.DataGlue.prototype.addView = function(viewRef)
- {
- return this.dataProvider.addView(viewRef);
- };
- _global.DataGlue.prototype.getLength = function()
- {
- return this.dataProvider.length;
- };
- _global.DataGlue.prototype.format = function(formatString, record)
- {
- var _loc2_ = formatString.split("#");
- var _loc3_ = "";
- var tlen = _loc2_.length;
- var _loc1_ = 0;
- while(_loc1_ < tlen)
- {
- _loc3_ += _loc2_[_loc1_];
- _loc3_ += _loc2_[_loc1_ + 1] != "" ? record[_loc2_[_loc1_ + 1]] : "#";
- _loc1_ += 2;
- }
- return _loc3_;
- };
- _global.DataGlue.getItemAt_FormatString = function(index)
- {
- var _loc2_ = this;
- var _loc1_ = _loc2_.dataProvider.getItemAt(index);
- if(_loc1_ == "in progress" || _loc1_ == undefined)
- {
- return _loc1_;
- }
- return {label:_loc2_.format(_loc2_.labelString,_loc1_),data:(_loc2_.dataString != null ? _loc2_.format(_loc2_.dataString,_loc1_) : _loc1_)};
- };
- _global.DataGlue.getItemAt_FormatFunction = function(index)
- {
- var _loc1_ = this.dataProvider.getItemAt(index);
- if(_loc1_ == "in progress" || _loc1_ == undefined)
- {
- return _loc1_;
- }
- return this.formatFunction(_loc1_);
- };
- _global.DataGlue.prototype.getItemID = function(index)
- {
- return this.dataProvider.getItemID(index);
- };
- _global.DataGlue.prototype.addItemAt = function(index, value)
- {
- return this.dataProvider.addItemAt(index,value);
- };
- _global.DataGlue.prototype.addItem = function(value)
- {
- return this.dataProvider.addItem(value);
- };
- _global.DataGlue.prototype.removeItemAt = function(index)
- {
- return this.dataProvider.removeItemAt(index);
- };
- _global.DataGlue.prototype.removeAll = function()
- {
- return this.dataProvider.removeAll();
- };
- _global.DataGlue.prototype.replaceItemAt = function(index, itemObj)
- {
- return this.dataProvider.replaceItemAt(index,itemObj);
- };
- _global.DataGlue.prototype.sortItemsBy = function(fieldName, order)
- {
- return this.dataProvider.sortItemsBy(fieldName,order);
- };
- _global.DataGlue.prototype.sortItems = function(compareFunc, order)
- {
- return this.dataProvider.sortItems(compareFunc,order);
- };
- isGatewayOpen = null;
- if(isGatewayOpen == null)
- {
- isGatewayOpen = true;
- NetServices.setDefaultGatewayUrl("http://www.egamingzone.com/flashservices/gateway");
- gatewayConnection = NetServices.createGatewayConnection();
- inserthscfc = gatewayConnection.getService("cfc.inserths",this);
- }
-