[CS:GO] How to add API in gameserver
- copyerfiled
- Junior Member
- Posts: 16
- Joined: Wed Jan 23, 2019 9:40 am
[CS:GO] How to add API in gameserver
Can I make an api to the game server? To transmit data and request data in server console or plugin. Are there any ways? Ideally http json post get.
Re: [CS:GO] How to add API in gameserver
You can, for example, make your server run sockets and requests as to your wish. (Use the unendless world of python packages)
Only downside is, that your server has to be running for this. In case its down, and you kind of want to restart it via an API, it wont work.
Only downside is, that your server has to be running for this. In case its down, and you kind of want to restart it via an API, it wont work.
- copyerfiled
- Junior Member
- Posts: 16
- Joined: Wed Jan 23, 2019 9:40 am
Re: [CS:GO] How to add API in gameserver
decompile wrote:You can, for example, make your server run sockets and requests as to your wish. (Use the unendless world of python packages)
Only downside is, that your server has to be running for this. In case its down, and you kind of want to restart it via an API, it wont work.
Please tell me how I can run a process in background?
I am trying to use aiohttp, but get this error:
Code: Select all
sp plugin load api
[SP] Loading plugin 'api'...
======== Running on http://0.0.0.0:8888 ========
(Press CTRL+C to quit)
**** WARNING: Watchdog timer exceeded, aborting!
Aborted
Re: [CS:GO] How to add API in gameserver
You need to run it in a new thread. Otherwise you block the main thread and the server cannot run its actual logic (the game).
- copyerfiled
- Junior Member
- Posts: 16
- Joined: Wed Jan 23, 2019 9:40 am
Re: [CS:GO] How to add API in gameserver
Ayuto wrote:You need to run it in a new thread. Otherwise you block the main thread and the server cannot run its actual logic (the game).
I tried running in a separate thread. But it looks like I'm doing something wrong. Even when I tried to run an infinite loop without time.sleep, only the 1st iteration of the cycle has passed. Can you show me how to do it?
Re: [CS:GO] How to add API in gameserver
I think that's because the server starts hibernating. Does this also happen if you are playing on your server?
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 71 guests