[TC] Gaming Forums

Full Version: [TC] Gaming API : General Discussion
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
[Image: tc-gaming-api.png]

General Discussion



Use this thread for any discussions related to our API.

For specific questions, please open a new thread.
Link needs to be added Smile
Chuck will add that in the morning. Thanks.

Also, I merged your pull request and also spotted another error but the GitBook servers are having trouble so the build is taking a while. Those changes should be live soon.
Dunno if it's my end, but I can't seem to see the updated version of the stats API page? Still showing the old href :/
The API might be slightly behind due to the very recent updates. That'll be solved very soon.
(2017-08-29 07:23)Jack Wrote: [ -> ]Dunno if it's my end, but I can't seem to see the updated version of the stats API page? Still showing the old href :/
(2017-08-28 23:09)Pete Wrote: [ -> ]Also, I merged your pull request and also spotted another error but the GitBook servers are having trouble so the build is taking a while. Those changes should be live soon.

The updates are there now.
The new roleplay stats have been added to the citydriving/profile/get API.
API updated after recent InSim update (v4.3).

API Now also includes endpoint for the current Gumball table, see: https://apidocs.tc-gaming.co.uk/apis/cit...pi#gumball
API updated after recent InSim update (v4.31).

/citydriving/profile/get

Removed:

Code:
hasRadarWarner
hasLocator
hasWinch

Added:

Code:
&properties=0|1
&upgrades=0|1

/citydriving/carinfo

Added:

Code:
&upgrades=0|1

/citydriving/market

Added:

Code:
&upgrades=0|1
Since TC World reports if the user is banned and days remaining, is it possible to get this implemented to the API?
Here's a proof of concept for an application that works both with InSim and the [TC] API. It shows how much money one has earned/lost during the session.

[Image: 5lStmt4.png]

Since the API only allows 720 request per hour, it pulls the data every 10 seconds.
Nice one. Got any ideas for other InSim apps in mind?
(2018-12-29 22:47)Pete Wrote: [ -> ]Nice one. Got any ideas for other InSim apps in mind?

Since you're interested in a Node / ReactJS Project, you can build an InSim Application and make it look attractive with Electron.

Post session stats would be awesome, for example, money gains / loss, where did the money go? which cars you drove most during the session? has your average speed gotten better in comparison with previous sessions? Market integration, real time view of online players, 0-60 times, a server login queue, a chat and many more. there is potential.

That would make for a nice application for TC'ers to use, and a good practice for ES6.

There are some npm packages you could look into to serialize data into byte arrays so that they could be transmitted to LFS, examples: https://www.npmjs.com/package/c-struct



@kxait - I read somewhere that you're looking for a way to lookup number of players connected to a host, you could get that information from here: https://www.lfsworld.net/hoststatus/?h=[TC]%20CityDriving%20One&onlycontent
Here's another, bit more simple. [TC] serverlist
[Image: oRzJndZ.png]

@Adorable - I used the [TC] API cause I'm too lazy for parsing HTML lol
Well, as I'm programming a bit, maybe I'll try to learn Node / ReactJS language, and create something, if I'm good at it Wink. (currently, I'm learning ncurses language, which is apart from InSim / [TC] API)
(2018-12-30 18:40)kxait Wrote: [ -> ]@Adorable - I used the [TC] API cause I'm too lazy for parsing HTML lol

You can do it in 1 line actually, here's my approach so that you could spare more API requests, also I think this is the fastest source.

https://www.lfsworld.net/hoststatus/?h=hostname
Code:
int players = Convert.ToInt32(Regex.Split(Regex.Split(response, "Conns</div><div class=\"Field2\">")[1], " / 40")[0]);

Your interfaces are awesome, I like how you're keeping things similar to what Chuck/Elmo are building!



In the meanwhile, I've been fiddling with Node, here's what I've been up to, it's a start:

Cool!

Instead of posting screenshots, you could post GitHub Gists instead. The support multiple files these days: https://gist.github.com

I'd like to try writing an InSim app with Node, but I'm not sure I'd even bother writing an Electron interface. I'd probably just do some CLI.

Creating your socket connection half way down your code made me shudder though!

Also, why did you decide to use cppmsg-dynamic over c-struct?
I've found that the cppmsg-dynamic module could match everything that c-struct is capable of, and do more, like support out of the box for nested structures (example the CompCar struct inside IS_MCI, a struct inside a struct).

It also supports more data types (double, float, arrays...).

Good luck with your project!

€: if only LFS used something like Google's protobuf Rolleyes
(2018-12-30 23:46)Pete Wrote: [ -> ]snip
Quoted for attention
I've a problem with the API. I was very frustrated to find that the API only returns total money for given user, not cash and balance separately. Either change it back, or change the API docs which led me on: https://apidocs.tc-gaming.co.uk/apis/cit...er-profile
(2020-01-06 19:38)kxait Wrote: [ -> ]
(2018-12-30 23:46)Pete Wrote: [ -> ]snip
Quoted for attention
I've a problem with the API. I was very frustrated to find that the API only returns total money for given user, not cash and balance separately. Either change it back, or change the API docs which led me on: https://apidocs.tc-gaming.co.uk/apis/cit...er-profile

This is purposely done after !steal was implemented to avoid people creating programs that automatically notifies about AFK players with larger amounts of cash on them.
Pages: 1 2
Reference URL's