+ Reply to Thread
Results 1 to 4 of 4

Thread: Disconnecting During Execution

  1. #1
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default Disconnecting During Execution

    I'm running some a bunch of Inspect.Item.Detail and Command.Auction.Analyze.

    If I overdo it and try to do too much, the game simply disconnects my client. Thus far, it's been a trial and error game. "11 iterations will run, but 12 will not". I've looked at Inspect.Queue.Status() but that table's properties don't see to change during execution.

    So two questions from this:

    1 - Is there a way to query my status with the server to see if I'm about to get disconnected?
    2 - Is there a way to capture a disconnect/crash report so I can see what went wrong or why I was disconnected?

    Thanks in advance!

    Hugh

  2. #2
    Shield of Telara Adelea's Avatar
    Join Date
    Mar 2011
    Posts
    734

    Default

    I recently had a need to perform appx 8000 Inspect.Item.Details() calls - I wanted to find out the raririty of a bunch of artifacts.

    The way I did it, was as follows - maybe something similar would work for your situation?

    Code:
    local fcnt = 0
    local arti_check = {}
    local arti_fail = {}
    
    function IC.Event_System_Update_Begin(h)
    	fcnt = fcnt+1
    	local id = next(arti_check)
    	if id then
    		local st, dtl = pcall(Inspect.Item.Detail, id)
    		if st then
    			if dtl then
    				local r = dtl.rarity or "common"
    				icomp_global.rarity[id] = r
    			end
    		else
    			print(string.format("pcall() failed on %d : %s", fcnt, id))
    			arti_fail[id] = true
    		end
    		arti_check[id] = nil
    	else
    		print("Ran out of arti's to check!")
    		Command.Event.Detach(Event.System.Update.Begin, nil, nil, nil, addon.identifier)
    	end
    end
    
    function IC.Event_Unit_Availability_Full(h,t)
    	for k,v in pairs(t) do
    		if v == "player" then
    			local rn = false
    			for k,v in pairs(INDY_ArtifactCollections) do
    				for ak, av in pairs(v) do
    					if icomp_global.rarity[ak] == nil then
    						icomp_global.rarity[ak] = 0
    					end
    					if icomp_global.rarity[ak] == 0 and arti_check[ak] == nil then
    						arti_check[ak] = true
    						rn = true
    					end
    				end
    			end
    			if rn then
    				Command.Event.Attach(Event.System.Update.Begin, IC.Event_System_Update_Begin, "Event.System.Update.Begin")
    			end
    			Command.Event.Detach(Event.Unit.Availability.Full, nil, nil, nil, addon.identifier)
    		end
    	end
    end
    
    Command.Event.Attach(Event.Unit.Availability.Full, IC.Event_Unit_Availability_Full, "Event.Unit.Availability.Full")
    http://forums.riftgame.com/image.php?type=sigpic&userid=125779&dateline=13553  38065

  3. #3
    Champion
    Join Date
    Jun 2011
    Posts
    561

    Default

    I use a very similar approach in most of my addons.

    You might want to build on Adelea's suggestion and also include Inspect.System.Watchdog() to do more than one check per system.update call. That would slightly speed up things depending on the number of calls you need to make while still maintaining the stability for your addon as well as all others which try to get some CPU time.

    Cheers
    N.

  4. #4
    Soulwalker
    Join Date
    Jan 2015
    Posts
    15

    Default

    I've found through trial and error that it's only throttled api calls that actually disconnect me from the game. What I did was do was save Inspect.Time.Real() + 0.01 to capture the latest execution that my coroutine will allow, pulled from the original examples that were given. It works pretty good.

    I'm now going to try to use Inspect.Queue.Status() to see if I can figure out how to use the "auctionanalyze" queue properly.

    Thanks for the suggestions - I'm now able to scan through all the live auctions in < 10 seconds, whereas before, it was taking me minutes.

    Slow and steady...

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts