|
本帖最后由 python 于 2023-8-1 19:45 编辑
function VersionStrToArray(v)
{
var _loc2 = v.split(",");
var _loc3 = _loc2.length;
var _loc1;
if (_loc3 != 4)
{
return;
} // end if
for (var _loc1 = 0; _loc1 < _loc3; ++_loc1)
{
_loc2[_loc1] = Number(_loc2[_loc1]);
} // end of for
return (_loc2);
} // End of the function
function ClientVersion()
{
var _loc1 = System.capabilities.version;
_loc1 = _loc1.substring(_loc1.indexOf(" ") + 1, _loc1.length);
return (VersionStrToArray(_loc1));
} // End of the function
function ServerVersion(rootNode)
{
var _loc1 = rootNode.firstChild;
for (var _loc1 = _loc1.firstChild; _loc1; _loc1 = _loc1.nextSibling)
{
if (_loc1.nodeName == "update")
{
return (VersionStrToArray(_loc1.attributes.version));
} // end if
} // end of for
return;
} // End of the function
function handleOnLoad(okay)
{
if (okay)
{
var _loc2 = ClientVersion();
var _loc3 = ServerVersion(this);
var _loc4 = _loc2.length;
if (_loc4 != 4 || _loc4 != _loc3.length)
{
ASnative(2202, 999)();
return;
} // end if
var _loc5 = false;
for (i = 0; i < _loc4; i++)
{
if (_loc3 > _loc2)
{
_loc5 = true;
break;
continue;
} // end if
if (_loc3 < _loc2)
{
break;
} // end if
} // end of for
ASnative(2202, 0)(_loc5, this.toString());
}
else
{
ASnative(2202, 998)();
} // end else if
} // End of the function
this.data = new Object();
this.GetSO = function (domain)
{
var _loc2 = "settings";
if (domain != null)
{
_loc2 = domain + "/" + _loc2;
} // end if
if (this.data[_loc2] == null)
{
this.data[_loc2] = SharedObject.getLocal(_loc2, "/support/flashplayer/sys");
} // end if
return (this.data[_loc2]);
};
this.LogDomain = function (domain)
{
if (domain != null)
{
var _loc1 = GetSO(null);
if (_loc1.data.domains == null)
{
_loc1.data.domains = new Object();
} // end if
if (_loc1.data.domains[domain] == null)
{
_loc1.data.domains[domain] = true;
_loc1.flush();
} // end if
} // end if
};
this.GetSetting = function (domain, name)
{
var _loc1 = GetSO(domain);
return (_loc1.data[name]);
};
this.SetSetting = function (domain, name, value, override)
{
var _loc1 = GetSO(domain);
if (override || _loc1.data[name] == null)
{
_loc1.data[name] = value;
_loc1.flush();
} // end if
LogDomain(domain);
};
this.Commit = function (domain)
{
var _loc1 = GetSO(null);
_loc1.flush();
var _loc2 = GetSO(domain);
_loc2.flush();
};
this.GetServerVersion = function (theUrl)
{
var _loc1 = new XML();
_loc1.ignoreWhite = true;
_loc1.onLoad = handleOnLoad;
_loc1.load(theUrl);
};
|
|