Aller au contenu

Photo

So, I made a thing... (a manifest completion badge)


  • Veuillez vous connecter pour répondre
529 réponses à ce sujet

#501
GodLovesATrier

GodLovesATrier
  • Members
  • 444 messages

GuyBlade wrote...

Forgive me for a moment while I wax about the technical challenges of this little toy.
....

 


I've been doing a little bit of n7hq page scraping myself recently, at one point I was thinking of contacting you to ask for some pointers as I struggled a bit with DOM tools (I tried using html agility pack via C#). In the end I just used some simple regular expressions my purpose was to pull in the number of UR ranks and the silver challenges that have not been completed including progress made on these challenges.

I was going to make a small automated tool and see if anyone else on the boards was interested but I came across the same problem you mention the "age-gate", do you hit this because the tool trying to download the page doesn't have the necessary cookie? Anyway as I was just playing around for my own amusement I just manually downloaded the html I was interested in and then ran a couple of scripts to extract the data.

Back to your actual problem: does it take 60 seconds to download the six html pages that make up the n7hq? That's just the html text and none of the other files? How long to you cache the data for, or rather after what amount of time do you re-request data from n7hq. I'm sure it wouldn't matter too much to make it even as long as 24hrs as this seems to be thing causing the logjam.

Are you using an insane amount of bandwidth to provide this service? Do you think that n7hq has throttled you becuase of high usage and hence the long times you have retrieving the pages?

That's a lot of questions and just me thinking off the top of my head. The first thing that struck me when I read your initial message was that you could just add names to a queue when you receive a request for a badge and return whatever you have cached straight away (even if it's well out of date) then a separate process can work on the queue saving the data and badges for the next time they are accessed. To be honest it's easy to talk about systems like this in a "hand-wavy" way when I don't know all the technical challenges you've faced and the way the project has changed over time.

Anyway well done on getting this running again!

#502
GuyBlade

GuyBlade
  • Members
  • 235 messages

Reviving wrote...

GuyBlade wrote...

Forgive me for a moment while I wax about the technical challenges of this little toy.
....

 


I've been doing a little bit of n7hq page scraping myself recently, at one point I was thinking of contacting you to ask for some pointers as I struggled a bit with DOM tools (I tried using html agility pack via C#). In the end I just used some simple regular expressions my purpose was to pull in the number of UR ranks and the silver challenges that have not been completed including progress made on these challenges.

I was going to make a small automated tool and see if anyone else on the boards was interested but I came across the same problem you mention the "age-gate", do you hit this because the tool trying to download the page doesn't have the necessary cookie? Anyway as I was just playing around for my own amusement I just manually downloaded the html I was interested in and then ran a couple of scripts to extract the data.

Back to your actual problem: does it take 60 seconds to download the six html pages that make up the n7hq? That's just the html text and none of the other files? How long to you cache the data for, or rather after what amount of time do you re-request data from n7hq. I'm sure it wouldn't matter too much to make it even as long as 24hrs as this seems to be thing causing the logjam.

Are you using an insane amount of bandwidth to provide this service? Do you think that n7hq has throttled you becuase of high usage and hence the long times you have retrieving the pages?

That's a lot of questions and just me thinking off the top of my head. The first thing that struck me when I read your initial message was that you could just add names to a queue when you receive a request for a badge and return whatever you have cached straight away (even if it's well out of date) then a separate process can work on the queue saving the data and badges for the next time they are accessed. To be honest it's easy to talk about systems like this in a "hand-wavy" way when I don't know all the technical challenges you've faced and the way the project has changed over time.

Anyway well done on getting this running again!


Both the age gate and language selection show up if you don't have appropriate cookies. My solution to both of these was to use a tool that could understand and maintain cookies across requests and to emulate going through them as a user. That is, I pretend to select English and then pretend to select my age before I do any of the actual polling. I also discard cookies after each user is scraped. That is partially out of laziness (the polling script is stand alone) and partially out of not wanting to manage the cookie renewal and the like.

I cache data for 30 minutes, currently. My thinking was that was long enough to go play a game and come back if you wanted to see it updated. 

The amount of bandwidth is usually pretty small. The images being output are on the order of a kilobyte or so, which makes serving them pretty easy. The main user of bandwidth is fetching pages. Each one is in the dozens or hundres of kilobytes. That doesn't sound like much, but when you're getting a lot of them and they are all blocking long enough to time out and need to be redone, it starts to clog things up. When I got home from work yesterday, I had over a hundred processes in some form of waiting on data state. With that many contending for the limited bandwidth of my internet connection, none of them were making progress, so the problem just kept getting worse as more requests rolled in.

I don't think that I've been throttled. I have two internet connections at my home. One is where the servers are and there is a separate one that I use for day-to-day things. My non-server internet connection has to wait quite a while to get data from N7HQ and it is never used for polling, so I think the servers are just slow. My guess is that Bioware has dialed back the number of machines serving out the data as the number of players has decreased over time.

Ultimately, the "queue and serve what's available" method is what I did to resolve the most recent batch of problems. I had previously used other bandaids, but they were all relatively vulnerable to race conditions or sudden large request bursts. The current solution uses an (internal-only) RPC server to manage update requests. The webserver will block for up to two minutes on a request while waiting for the RPC server to update data, then sever whatever it has. I didn't want to go this way initially because it means another piece of code that I'll have to daemonize and ensure is running everytime the machine boots. I prefer to do everything on the web-server side, when possible, as it tends to be a bit more resilient.

#503
Shinobu

Shinobu
  • Members
  • 4 359 messages
OMG, it's back! Thank you, Guyblade!

#504
GuyBlade

GuyBlade
  • Members
  • 235 messages

Shinobu wrote...

OMG, it's back! Thank you, Guyblade!


I do what I can. ;)
  • Shinobu aime ceci

#505
Lacika2000

Lacika2000
  • Members
  • 58 messages
GuyBlade, this is really great!
Just wondering, would it be possible to get the weapon level tiles without the name? (see my signature...)

#506
GuyBlade

GuyBlade
  • Members
  • 235 messages
I include the name so that people don't use other people's badges. Other people have asked and I've been disinclined to change thus far.

#507
Lacika2000

Lacika2000
  • Members
  • 58 messages

GuyBlade wrote...
I include the name so that people don't use other people's badges. Other people have asked and I've been disinclined to change thus far.


Just funny how that has never crossed my mind... :innocent:

#508
LePetitRobot

LePetitRobot
  • Members
  • 717 messages
Not that I'm on BSN much these days, but I thought it would be cool to see my maxed manifest…
The blade.io page gives me "User not found" though.

#509
dcal31

dcal31
  • Members
  • 574 messages
It's been a while since I posted. Imagine my surprise when I leave a comment and my badges are magically back in my sig. Thank you for taking all the time and effort to get them back running again. Now, I have renewed vigor in getting that solid silver and gold bar. Wish me luck. And again, thank you.

#510
N7 Tigger

N7 Tigger
  • Members
  • 1 581 messages
I'm gonna put it right here... Right on the refrigerator.

#511
GuyBlade

GuyBlade
  • Members
  • 235 messages

LePetitRobo wrote...

Not that I'm on BSN much these days, but I thought it would be cool to see my maxed manifest…
The blade.io page gives me "User not found" though.


Looks like my poller might have gotten hung? I've restarted it with some additional logging code. Hopefully that will help me track down the issue.

#512
GuyBlade

GuyBlade
  • Members
  • 235 messages

LePetitRobo wrote...

Not that I'm on BSN much these days, but I thought it would be cool to see my maxed manifest…
The blade.io page gives me "User not found" though.


So, I'm guessing that your profile is set to private as I can't see anything when I go here:

http://social.biowar...r&platform=xbox

You need a public profile in order for me to find your data.

#513
dcal31

dcal31
  • Members
  • 574 messages

It looks like all requests are pulling up "User not found." Just wanted to drop by and give you a heads up, if you're still checking this thread.



#514
GuyBlade

GuyBlade
  • Members
  • 235 messages

Well, it's only 7 months later, but I noticed badges were broken, so I fixed them again. Turns out an update to the library I use for scraping broke my tool, but it was a two character change to fix it. I don't know how useful they will be, given the age of the game, but who knows?


  • frank_is_crank aime ceci

#515
GuyBlade

GuyBlade
  • Members
  • 235 messages

Incidentally, you may have to refresh a couple of times to get it to update. Loading a badge triggers an update, but it immediately returns the old data (for reasons). New data may take a minute or two to show up.



#516
Mgamerz

Mgamerz
  • Members
  • 6 129 messages
Broken for me. Loads fit about the mind then goes to username not found.

#517
GuyBlade

GuyBlade
  • Members
  • 235 messages

@Mgamerz Your profile is apparently set to private. I can't very will see your data if your profile is private, now can I?

http://social.biowar...erz&platform=pc
 



#518
Terminator Force

Terminator Force
  • Members
  • 6 064 messages

^ I want to see Mgamerz profile too. What is Mgamerz hiding, anyway?



#519
Mgamerz

Mgamerz
  • Members
  • 6 129 messages
I have no idea how to unhide it. I never hid it. I almost never use it unless I need to mine some assets off the servers.

#520
niniendowarrior

niniendowarrior
  • Members
  • 1 468 messages

So, I guess my Wii U manifest is out of luck, aye?



#521
GuyBlade

GuyBlade
  • Members
  • 235 messages

Looks like you have to go here:

http://social.biowar...m/n7hq/account/

After logging into n7hq and set your ME3 profile to be public.



#522
GuyBlade

GuyBlade
  • Members
  • 235 messages

@niniendowarrior : I just added Wii U support just for you: http://www.blade.io/...or&system=Wii U

It was only a 3 line change, so don't feel too special...


  • niniendowarrior aime ceci

#523
niniendowarrior

niniendowarrior
  • Members
  • 1 468 messages

@niniendowarrior : I just added Wii U support just for you: http://www.blade.io/...or&system=Wii U

It was only a 3 line change, so don't feel too special...

I don't.  But I suspect the statistics are off because we have to unlock less in our manifest.

 

EDIT:

After looking at it, yeah, the info is off.  The N7 level is also not correct as it seems to be pulling my PC N7 level instead.  I'm not asking you to fix it though, just wondered about how many packs I would need to get completion.



#524
GuyBlade

GuyBlade
  • Members
  • 235 messages

Hmm, I'll take another look. 


  • niniendowarrior aime ceci

#525
GuyBlade

GuyBlade
  • Members
  • 235 messages

I also needed to update the database cache to add another enum value. Now, it works:

http://www.blade.io/...or&system=Wii U

As for the challenges data at the bottom, that would take a bit more work, so I'll fix those "someday" which probably means never.