1.29 Function call order Dofus retro

Inscrit
10 Novembre 2019
Messages
4
Reactions
0
#1
Hello,
Could someone help me figure out what's the function call order after receiving certain packets?

For example, the parseMap function in the MapsServersManager is only declared but I can't find a single call to it in the loader, even though it's used in the game. There are many other examples like this, and I can't figure out when are they called and what arguments are passed into them.

Help would be greatly appreciated!
 
Inscrit
10 Novembre 2019
Messages
4
Reactions
0
#4
What I found so far.
You end up on onMapData from a GDM packet.
JavaScript:
    function onMapData(sExtraData) {
        var _loc3_ = sExtraData.split("|");
        var _loc4_ = _loc3_[0];
        var _loc5_ = _loc3_[1];
        var _loc6_ = _loc3_[2];
        if (Number(_loc4_) == this.api.datacenter.Map.id) {
            if (!this.api.datacenter.Map.bOutdoor) {
                this.api.kernel.NightManager.noEffects();
            }
            this.api.gfx.onMapLoaded();
            return undefined;
        }
        this.api.gfx.showContainer(false);
        this.nLastMapIdReceived = _global.parseInt(_loc4_, 10);
        this.api.kernel.MapsServersManager.loadMap(_loc4_, _loc5_, _loc6_);
    }
You are then redirected to loadMap from MapsServersManager

JavaScript:
    function loadMap(sID, sDate, sKey) {
        this._lastLoadedMap = undefined;
        if (!_global.isNaN(Number(sID))) {
            if (sKey != undefined && sKey.length > 0) {
                this._aKeys[Number(sID)] = dofus.aks.Aks.prepareKey(sKey);
            } else {
                delete this._aKeys[Number(sID)];
            }
        }
        this.loadData(sID + "_" + sDate + (this._aKeys[Number(sID)] == undefined ? "" : "X") + ".swf");
    }
Which in turn redirects you to loadData from ServersManager. Then you are redirected to loadWithNextURL
JavaScript:
    function loadData(sFile) {
        if (this._sFile == sFile) {
            return undefined;
        }
        this._sFile = sFile;
        this.clearTimer();
        this._mcl.unloadClip(this._mc);
        this.api.ui.loadUIComponent("Waiting", "Waiting");
        this._aServers = _level0._loader.copyAndOrganizeDataServerList();
        this._urlIndex = -1;
        this.loadWithNextURL();
    }
    function loadWithNextURL() {
        this._urlIndex++;
        if (this._urlIndex < this._aServers.length && this._aServers.length > 0) {
            this._oCurrentServer = this._aServers[this._urlIndex];
            this._sCurrentFileURL = this._oCurrentServer.url + this._sFolder + this._sFile;
            System.security.allowDomain(this._oCurrentServer.url);
            this._mcl = new MovieClipLoader();
            this._mcl.addListener(this);
            this._timerID = _global.setInterval(this.onEventNotCall, 3000);
            this._mc = _root.createEmptyMovieClip("__ANKSWFDATA__", _root.getNextHighestDepth());
            this._mcl.loadClip(this._sCurrentFileURL, this._mc);
        } else {
            this.onAllLoadFailed(this._mc);
        }
    }
I can't find what follows after that.
One function that calls parseMap is onComplete also from MapsServersManager
JavaScript:
    function onComplete(mc) {
        var _loc3_ = mc;
        this.parseMap(_loc3_);
    }
But I can't find any MapsServersManager.onComplete function calls in the loader. I am stuck here.
 

AzureHaze

Contributeur
Inscrit
27 Septembre 2019
Messages
47
Reactions
250
#5
Inscrit
10 Novembre 2019
Messages
4
Reactions
0
#6
Oh! So the methods from ServersManager
JavaScript:
    function onLoadStart() {
        this.clearTimer();
    }
    function onLoadError(mc) {
        this.api.kernel.showMessage(undefined, "Erreur au chargement du fichier \'" + this._sCurrentFileURL + "\'", "DEBUG_LOG");
        this.clearTimer();
        this.onError(mc);
        this.loadWithNextURL();
    }
    function onLoadProgress() {
        this.clearTimer();
    }
    function onLoadComplete() {
        this.clearTimer();
    }
    function onLoadInit(mc) {
        this.clearTimer();
        this._sFile = undefined;
        this.clearUI();
        this.onComplete(mc);
Are actually being called by MovieClipLoader?

I'm trying to make a fishing bot :D
For now I'm trying to figure out what data is being received from the ws2 recv function.
 
Haut Bas