-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
114 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# GET /Api/CS2Interface/{botNames}/Status | ||
|
||
## Description | ||
|
||
Gets the CS2 interface status for the given `botNames` | ||
|
||
## Path Parameters | ||
|
||
Name | Required | Description | ||
--- | --- | --- | ||
`botNames` | Yes | One or more ASF [bot names](https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Commands#bots-argument) | ||
|
||
## Query Parameters | ||
|
||
None | ||
|
||
## Response Result | ||
|
||
Property | Type | Description | ||
--- | --- | --- | ||
`botName.Connected` | `bool` | True if the interface is connected for `botName` | ||
`botName.Connecting` | `bool` | True if the interface is attempting to connect for `botName` | ||
`botName.Ready` | `bool` | True if the interface is currently able to handle a new request for `botName` | ||
`botName.Message` | `string` | A description of the status for `botName` | ||
|
||
## Example Response | ||
|
||
``` | ||
http://127.0.0.1:1242/Api/CS2Interface/Bot1/Status | ||
``` | ||
|
||
```json | ||
{ | ||
"Message": "OK", | ||
"Success": true, | ||
"Result": { | ||
"Bot1": { | ||
"Connected": true, | ||
"Connecting": false, | ||
"Ready": true, | ||
"Message": "Ready" | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace CS2Interface.IPC { | ||
public sealed class ClientStatus { | ||
[JsonInclude] | ||
[JsonPropertyName("Connected")] | ||
public bool Connected; | ||
|
||
[JsonInclude] | ||
[JsonPropertyName("Connecting")] | ||
public bool Connecting; | ||
|
||
[JsonInclude] | ||
[JsonPropertyName("Ready")] | ||
public bool Ready; | ||
|
||
[JsonInclude] | ||
[JsonPropertyName("Message")] | ||
public string Message; | ||
|
||
public ClientStatus((EClientStatus status, string message) @params) : this(@params.status, @params.message) {} | ||
|
||
public ClientStatus(EClientStatus status, string message) { | ||
Connected = (status & EClientStatus.Connected) == EClientStatus.Connected; | ||
Ready = (status & EClientStatus.Ready) == EClientStatus.Ready; | ||
bool botOffline = (status & EClientStatus.BotOffline) == EClientStatus.BotOffline; | ||
Connecting = !Connected && !Ready && !botOffline; | ||
Message = message; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters