You might want to fix this: http://imgur.com/a/dwzcJ
You might want to fix this: http://imgur.com/a/dwzcJ
Works flawless with PHP here..
Darkmoore, you probably using Curl to access the data. Doesn't send an origin header like a modern browser does. I experienced the same.
I am using file_get_contents() and json_decode()
I used CURL when they did not provide the dump.
Ehm, the contest rules state that "Submission should be a solution based entirely on javascript and some CSS - You may use D3 / jQuery solutions.". So for a valid contest entry this means you have to request data in the browser (via ajax or fetch).
In order for this to work on a website hosted on any other domain than utopia-game.com, access control headers must be set on the json response from the utopia server. (As a workaround, fiddle with browser settings or install an extension that overrides this header, or fetch the json serverside and proxy it.)
(as mentioned before, since you have to write a clientside app, not a serverside app, the resulting tf will be kinda lame, as no historic data is available from the json response you have to work with)
Last edited by Yadda9To5; 20-04-2017 at 14:44.
http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).
Yes, this is true. The metrics from only a current set are mostly informative, but you can't really make an informed decision with it. Perhaps when looking for a kd to war, you'd like to avoid a full Avian KD.
But, this is only for this contest. No-one stops you from storing the data every 15 minutes in your own database and make a tool for that :)
You could do it backwards, serve json from your targetfinder with the right access-control headers so you can access it client-side ingame. (any tf that is less feature full than yours is a waste of space, so it'd be nice to have something similar to yours ingame, though while it should work it likely is still a breach of requirements, and i suppose the owners don't want to be too dependent on things hosted outside the game)
Last edited by Yadda9To5; 20-04-2017 at 17:27.
http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).
http://www.************.eu/
I have always used this, and the "random" button on the KD page. Gee if this keeps up somebody will make a bot so I can play all 25 provs by myself.
lol CENSORED <removed>
why is a contest censored?
I also like upoopu more than munk Yadda
Last edited by Palem; 21-04-2017 at 03:20.
Darkmoore. I suspect you've got an answer for your question regarding the total province count discrepancies. If not, I ran into this when building a target locator for my kingdom. It's a bug in the dump caused when a kingdom contains a province which has no owner (ie. disbanded province)
hylandor: Good stuff.. thanks for the info..
Too late for the contest, but i'm not seeing any submission yet ;) So here is a start, only working with the provided json list, no server-side stuff (which is cached on build time since the live data does not provide the right access control headers, the data is stale) https://utopia-things.gitlab.io/targetfinder/
What i want to add is:
- Ready kd data instead of prov data (based on the same input)
- Ready make kd numbers link to ingame k
- Not going to be there, i have no clue how to implement it sanely make clicking on province go to thievery (but making that useful is finicky, since you need to make a post request, setting thievery to the right kingdom)
- While i tried to build on the utopia css styles, some work is likely needed to make it fit with the default style and third party styles.
It's pretty basic, things like honor aren't listed, there simply is no room in the tables if it's supposed to fit in the in game window ;) Besides, who looks at that anyway, if that's f your consideration you probably want to compare to historic data as well, and that isn't available by design (unfortunately this also makes things quite sluggish on old hardware, processing 600kb of json to show data can be heavy, if creating a json api that can be consumed in-game is acceptable, i'll not mind doing that so more interesting data is available).
(the used parts are in https://gitlab.com/utopia-things/tar.../master/client and https://gitlab.com/utopia-things/tar...argetfinder/js contributions are welcome :) the rest is server-side processing and database cache, which is not used currently, eventually i'll add that and host it myself)
Last edited by Yadda9To5; 28-04-2017 at 13:32.
http://www.upoopu.com/: an intel repository (or: "pimp alternative") for utopia (read the guide).
There are currently 1 users browsing this thread. (0 members and 1 guests)