martbhell Posted January 7, 2016 Share Posted January 7, 2016 (edited) Hi! Seems some debug output or some such is included in the city api? // mart {"cityid":"20268","url":"https:\/\/politicsandwar.com\/city\/id=20268","nationid":"10065","name":"Truro","nation":"Nova Scotia","leader":"Chappie Tetravalal","continent":"North America","founded":"2015-01-27","age":345,"powered":"Yes","infrastructure":"2000.00","land":"2000.00","population":223000,"popdensity":111.5,"crime":0,"disease":0,"commerce":100,"avgincome":5.613,"pollution":0,"nuclearpollution":0,"basepop":200000,"basepopdensity":99.999950000025,"minimumwage":1.8709677419355,"poplostdisease":0,"poplostcrime":0,"coalpower":"0","oilpower":"0","nuclearpower":"1","windpower":"0","coalmine":"2","oilwell":"0","ironmine":"2","bauxitemine":"0","leadmine":"0","uraniummine":"1","farm":"0","oilrefinery":"1","steelmill":"3","aluminumrefinery":"1","munitionsfactory":"0","policestation":"1","hospital":"2","recyclingcenter":"2","subway":"1","supermarket":"0","bank":"3","shoppingmall":"3","stadium":"2","barracks":"5","factory":"5","airforcebase":"5","drydock":"0"}<!-- { "kind": "city", "data": { "citydata": { "cityid": 20268, "url": "https://politicsandwar.com/city/id=20268", "nationid": 10065, "name": "Truro", "nation": "Nova Scotia", "leader": "Chappie Tetravalal", "continent": "North America", "founded": "2015-01-27", "age": "345 days" }, "stats": { "powered": "Yes", "infrastructure": 2000.00, "land": 2000.00, "population": 223000, "popdensity": 111.5, "crime": 0, "disease": 0, "commerce": 100, "avgincome": 5.613, "pollution": 0, "nuclearpollution": 0 }, "improvements": { "power": { "coalpower": 0, "oilpower": 0, "nuclearpower": 1, "windpower": 0 }, "resources": { "coalmine": 2, "oilwell": 0, "ironmine": 2, "bauxitemine": 0, "leadmine": 0, "uraniummine": 1, "farm": 0 }, "manufacturing": { "oilrefinery": 1, "steelmill": 3, "aluminumrefinery": 1, "munitionsfactory": 0 }, "civil": { "policestation": 1, "hospital": 2, "recyclingcenter": 2, "subway": 1 }, "commerce": { "supermarket": 0, "bank": 3, "shoppingmall": 3, "stadium": 2 }, "military": { "barracks": 5, "factory": 5, "airforcebase": 5, "drydock": 0 } }, "cityfactors": { "basepop": 200000, "basepopdensity": 99.999950000025, "minimumwage": 1.8709677419355, "poplostdisease": 0, "poplostcrime": 0 } } } --> Edited January 7, 2016 by martbhell 1 Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 7, 2016 Administrators Share Posted January 7, 2016 Ah, my HTML comments failed. I'll fix that up for the next patch. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Shakyr Posted January 9, 2016 Share Posted January 9, 2016 Related to this, the city API no longer matches the other APIs. { "cityid": "23583", "url": "https:\/\/politicsandwar.com\/city\/id=23583", "nationid": "14511", "name": "Mauritius", "nation": "The Lost Isles", "leader": "Shakyr", "continent": "Australia", "founded": "2015-03-09", "age": 305, "powered": "Yes", "infrastructure": "1500.00", "land": "2000.00", "population": 165250, "popdensity": 82.63, "crime": 0, "disease": 0, "commerce": 100, "avgincome": 4.665, "pollution": 0, "nuclearpollution": 0, "basepop": 150000, "basepopdensity": 74.999962500019, "minimumwage": 1.5549597855228, "poplostdisease": 0, "poplostcrime": 0, "coalpower": "0", "oilpower": "0", "nuclearpower": "1", "windpower": "0", "coalmine": "0", "oilwell": "0", "ironmine": "0", "bauxitemine": "3", "leadmine": "0", "uraniummine": "0", "farm": "5", "oilrefinery": "0", "steelmill": "0", "aluminumrefinery": "3", "munitionsfactory": "0", "policestation": "1", "hospital": "1", "recyclingcenter": "1", "subway": "1", "supermarket": "0", "bank": "3", "shoppingmall": "3", "stadium": "2", "barracks": "2", "factory": "1", "airforcebase": "3", "drydock": "0" }Instead of before, where it had. { "kind": "city", "data": { "citydata": { ... } "stats": { ... } } }Just want to check that this is how the city API will be from now on, before I go and spend a few hours rewriting how I handle the city API (and add exceptions because it's different to the others). Quote Link to comment Share on other sites More sharing options...
Yosodog Posted January 9, 2016 Share Posted January 9, 2016 (edited) On top of Shakyr's question, is the alliance and nation format going to change too? I much prefer it the new way (luckily for me it should only take 5 mins to update everything) Edited January 9, 2016 by Yosodog Quote [22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made BK in a nutshell Link to comment Share on other sites More sharing options...
martbhell Posted January 9, 2016 Author Share Posted January 9, 2016 I'd be interested in knowing this too. Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 10, 2016 Administrators Share Posted January 10, 2016 I'll probably just move everything to the new way. I'm in the process of re-doing the APIs in a more proper way. 2 Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
martbhell Posted January 10, 2016 Author Share Posted January 10, 2016 Nice! Quote Link to comment Share on other sites More sharing options...
Kid Winchell Posted January 10, 2016 Share Posted January 10, 2016 I'll probably just move everything to the new way. I'm in the process of re-doing the APIs in a more proper way. I've been meaning to complain about how data.alliancedata/nationdata/citydata was stupid. Also your bad formatting with random indentations (or lack thereof) all over the place. Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 10, 2016 Administrators Share Posted January 10, 2016 I've been meaning to complain about how data.alliancedata/nationdata/citydata was stupid. Also your bad formatting with random indentations (or lack thereof) all over the place. The random indentations were not visible in the code itself. For whatever reason it was just getting rendered that way by the browser (honestly not sure why.) Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Shakyr Posted January 11, 2016 Share Posted January 11, 2016 The random indentations were not visible in the code itself. For whatever reason it was just getting rendered that way by the browser (honestly not sure why.)If you're using PHP, compile it all in an array and then use the following, to get it to display nicely. $json_string = json_encode($data, JSON_PRETTY_PRINT); Quote Link to comment Share on other sites More sharing options...
Administrators Alex Posted January 11, 2016 Administrators Share Posted January 11, 2016 If you're using PHP, compile it all in an array and then use the following, to get it to display nicely. $json_string = json_encode($data, JSON_PRETTY_PRINT); I know, this is what I've switched to, and how the API runs now (just without pretty print.) Previously though, I just had it all formatted with the correct levels of indentation in the file, and the browser simply rendered it with random indentations that I can't explain. Quote Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest ItForums Rules | Game Link Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.