perceptron8 / pinky.ext

Web Extension making The Settlers Online collectibles easy to find!
25 stars 19 forks source link

Pinky questions... #19

Closed korishan closed 7 years ago

korishan commented 7 years ago

Hello,

I hope I'm doing this correct, but I couldn't find any other way to contact you....

I'm interested in how you do the Pinky redirects. I notice there are a lot of, what appears to be, random naming conventions for the pictures of TSO. How did you find out what the image names were, and what servers they were on?

I'm wanting to write an extension that could help me with other stuff within TSO at a glance, such as buildings that are unbuffed, or possibly to help resend some of the explorers, or to be able to see 'hidden' camps in advens and such (wolves, etc.).

Thanks for any help, Korishan (tso.net, Ares server)

perceptron8 commented 7 years ago

Hello,

Thanks for contacting me! :)

  1. How does Pinky redirect? See https://developer.chrome.com/extensions/webRequest
  2. How did I find out what to redirect? First, by looking into network panel and tracing requests (for urls). Then, by inspecting swf (to get original file names*, just for fun: you don't need to use original names anywhere).

I had some cross-domain problems when I was redirecting to external sites like dummyimage.com, so now I use static.cdn.ubi.com exclusively. I encourage you to do the same. Moreover, you can't redirect to web_accessible_resources or data uris because flash doesn't handle them.

Feel free to let me know about progress of your work!

*) They are equal to sha1 of file content, so you you can't get name... without knowing it already.

korishan commented 7 years ago

Hey, Thanks for the info. That did help. I have a list of buildings now and their urls.

I was wondering, do you know if there is a way to determine where on the grid map those were loaded into?

I'm working on creating a Control Panel for TSO. Right now, it'll include your Pinky plugin (with credits due), and to start with, I'm thinking of trying to maybe keep track of counters and such. Eventually, now that I know you can intercept the images, I was thinking of possibly even making a "theme" where ya could replace some of the buildings with a different set of buildings. (Not sure how BB would like that one, tho :p ) But then maybe even get to the point where I can interact with geo's, explorers and resend them out. I know there is a certain level of autonomy that isn't supposed to be allowed, or at least, used to be. I've seen some posts from yrs ago, but nothing recent (unless I missed something).

Thanks for the quick reply :)

Korishan Ares Server

On Tue, Jan 10, 2017 at 3:36 AM, Michał Sobkiewicz <notifications@github.com

wrote:

Hello,

Thanks for contacting me! :)

  1. How does Pinky redirect? See https://developer.chrome.com/ extensions/webRequest
  2. How did I find out what to redirect? First, by looking into network panel https://developers.google.com/web/tools/chrome-devtools/network-performance/resource-loading and tracing requests (for urls). Then, by inspecting https://github.com/jindrapetrik/jpexs-decompiler swf (to get original file names*, just for fun: you don't need to use original names anywhere).

I had some cross-domain problems when I was redirecting to external sites like dummyimage.com, so now I use static.cdn.ubi.com exclusively. I encourage you to do the same. Moreover, you can't redirect to web_accessible_resources https://developer.chrome.com/extensions/manifest/web_accessible_resources or data uris https://en.wikipedia.org/wiki/Data_URI_scheme because flash doesn't handle them.

Feel free to let me know about progress of your work!

*) They are equal to sha1 of file content, so you you can't get name... without knowing it already.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/perceptron8/pinky.ext/issues/19#issuecomment-271516389, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3K-NAKoqkgLvlp_ooONu4QJFHTD7Apks5rQ0MkgaJpZM4Le8CM .

perceptron8 commented 7 years ago

Hey,

I'm thinking of trying to maybe keep track of counters and such.

This gives you nothing as

  1. urls might be requested only once (they are cached by game engine),
  2. images are loaded lazily (as soon as object becomes visible).

I was thinking of possibly even making a "theme" where ya could replace some of the buildings with a different set of buildings.

Remember to use ordinary http:// urls (that's why I wrote that you can't use web_accessible_resources or data uris).

  1. You can use https://httpd.apache.org/, https://www.npmjs.com/package/http-server or whatever. This will make your Control Panel less portable.
  2. You can host your theme somewhere on the web. Not so cheap, but accessible to everyone (no install + config needed).

Here's small Retro skin I made that uses static.cdn.ubi.com exclusively. Results are much less spectacular than I expected, that's why it's not public. Maybe you just need to replace more stuff.

https://gist.github.com/perceptron8/f936123052354caf8ca3bed8b06848d6

I was wondering, do you know if there is a way to determine where on the grid map those were loaded into?

How about https://developer.chrome.com/extensions/desktopCapture + https://trackingjs.com/? There's one catch: you would have to zoom out, as whole map must be visible. Not very convenient, but better than nothing. Note that by creating your own theme (and using some other crazy color) you could make image recognition much easier and less fragile.

Greetz :)

korishan commented 7 years ago

ugh, been looking at the tracking.js thing for hours. reading and re-reading, and such. But, it looks like it 'has' be run from a web server. i can't get it run w/o one. that's not gonna work in an extension environment. Hrmm..... I'll see if i can find something else similar. But the tracking.js looked really promising, tho.

On Sat, Jan 14, 2017 at 3:40 AM, Michał Sobkiewicz <notifications@github.com

wrote:

Hey,

I'm thinking of trying to maybe keep track of counters and such.

This gives you nothing as

  1. urls might be requested only once (they are cached by game engine),
  2. images are loaded lazily (as soon as object becomes visible).

I was thinking of possibly even making a "theme" where ya could replace some of the buildings with a different set of buildings.

Remember to use ordinary http:// urls (that's why I wrote that you can't use web_accessible_resources or data uris).

  1. You can use https://httpd.apache.org/, https://www.npmjs.com/package/http-server https://www.npmjs.com/package/http-server or whatever. This will make your Control Panel less portable.
  2. You can host your theme somewhere on the web. Not so cheap, but accessible to everyone (no install + config needed).

Here's small Retro skin I made that uses static.cdn.ubi.com exclusively. Results are much less spectacular than I expected, that's why it's not public. Maybe you just need to replace more stuff.

https://gist.github.com/perceptron8/f936123052354caf8ca3bed8b06848d6

I was wondering, do you know if there is a way to determine where on the grid map those were loaded into?

How about https://developer.chrome.com/extensions/desktopCapture + https://trackingjs.com/? There's one catch: you would have to zoom out, as whole map must be visible. Not very convenient, but better than nothing. Note that by creating your own theme (and using some other crazy color) you could make image recognition much easier and less fragile.

Greetz :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/perceptron8/pinky.ext/issues/19#issuecomment-272610849, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3K-IG3VJB3IH-Zo8kglKazWNl7fZb8ks5rSIoagaJpZM4Le8CM .

perceptron8 commented 7 years ago

It does not have to be run from a web server, keep trying.

korishan commented 7 years ago

Ok, figured out part of it. For some odd reason, the script won't run in Chrome. I take the exact same html file and load in Edge, Firefox and IE, and it loads just fine. Odd.

At least I now know i'm not doing something wrong. Just gotta figure out why it won't run in Chrome.

Thanks for the "keep trying" statement :p It was late and I being tired when I was working on it.

On Sun, Jan 15, 2017 at 2:25 AM, Michał Sobkiewicz <notifications@github.com

wrote:

It does not have to be run from a web server, keep trying.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/perceptron8/pinky.ext/issues/19#issuecomment-272678933, or mute the thread https://github.com/notifications/unsubscribe-auth/AX3K-IQftj1NCPtFi1IdMzxGoGIp23B4ks5rScnngaJpZM4Le8CM .

perceptron8 commented 7 years ago

I guess it's because Chrome is stricter about same origin policy. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for details (you can verify this by checking https://developers.google.com/web/tools/chrome-devtools/console/). However, you should be able to do anything with the image you will create from data obtained using desktopCapture, so don't worry.