init
This commit is contained in:
193
api/ServerStatistics.api
Normal file
193
api/ServerStatistics.api
Normal file
@@ -0,0 +1,193 @@
|
||||
syntax = "v1"
|
||||
|
||||
info (
|
||||
title: "Server Statistics API"
|
||||
desc: "Server Statistics API"
|
||||
author: "cialloo"
|
||||
date: "2025-10-04"
|
||||
version: "v1"
|
||||
)
|
||||
|
||||
type (
|
||||
PingReq {}
|
||||
PingResp {
|
||||
ok bool `json:"ok"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalPlayerJoinReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
TotalPlayerJoinResp {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalPlayerCountReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
TotalPlayerCountResp {
|
||||
Count int64 `json:"count"`
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalPlayTimeReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
TotalPlayTimeResp {
|
||||
TotalPlayTime int64 `json:"totalPlayTime"` // Total playtime in seconds
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalKillCountReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
HeadshotOnly bool `json:"headshotOnly"` // If true, count only headshot kills
|
||||
WeaponFilter []string `json:"weaponFilter"` // List of weapon names to filter by (optional)
|
||||
PlayerFilter []string `json:"playerFilter"` // List of player SteamID64s to filter by (optional)
|
||||
}
|
||||
TotalKillCountResp {
|
||||
TotalKillCount int64 `json:"totalKillCount"` // Total kill count
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalConnectCountReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
TotalConnectCountResp {
|
||||
TotalConnectCount int64 `json:"totalConnectCount"` // Total connect count
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalDamageCountReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
WeaponFilter []string `json:"weaponFilter"` // List of weapon names to filter by (optional)
|
||||
PlayerFilter []string `json:"playerFilter"` // List of player SteamID64s to filter by (optional)
|
||||
}
|
||||
TotalDamageCountResp {
|
||||
TotalDamageCount int64 `json:"totalDamageCount"` // Total damage count
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
TotalChatMessageCountReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
PlayerFilter []string `json:"playerFilter"` // List of player SteamID64s to filter by (optional)
|
||||
}
|
||||
TotalChatMessageCountResp {
|
||||
TotalChatMessageCount int64 `json:"totalChatMessageCount"` // Total chat message count
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
RecentJoinPlayerReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
RecentJoinPlayerResp {
|
||||
Players []RecentJoinPlayerRespPlayer `json:"players"` // List of player SteamID64s who joined in the time range
|
||||
}
|
||||
RecentJoinPlayerRespPlayer {
|
||||
SteamID64 string `json:"steamID64"` // Player's SteamID64
|
||||
JoinTime int64 `json:"joinTime"` // Join time as Unix timestamp in milliseconds
|
||||
UserName string `json:"userName"` // Player's username at the time of joining
|
||||
PlayTime int64 `json:"playTime"` // Playtime in seconds since joining
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
RecentChatMessageReq {
|
||||
TimeRangeStart int64 `json:"timeRangeStart"` // Unix timestamp in milliseconds
|
||||
TimeRangeEnd int64 `json:"timeRangeEnd"` // Unix timestamp in milliseconds
|
||||
}
|
||||
RecentChatMessageResp {
|
||||
Messages []RecentChatMessageRespMessage `json:"messages"` // List of recent chat messages
|
||||
}
|
||||
RecentChatMessageRespMessage {
|
||||
SteamID64 string `json:"steamID64"` // Player's SteamID64
|
||||
UserName string `json:"userName"` // Player's username at the time of message
|
||||
Message string `json:"message"` // Chat message content
|
||||
TimeStamp int64 `json:"timeStamp"` // Message timestamp as Unix timestamp in milliseconds
|
||||
}
|
||||
)
|
||||
|
||||
@server (
|
||||
prefix: /api/server/statistics
|
||||
)
|
||||
service ServerStatistics {
|
||||
@doc (
|
||||
summary: "Ping the server to check if it's alive"
|
||||
description: "Ping the server to check if it's alive"
|
||||
)
|
||||
@handler pingHandler
|
||||
get /ping (PingReq) returns (PingResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get recent player joins within a specified time range"
|
||||
description: "Get recent player joins within a specified time range"
|
||||
)
|
||||
@handler recentPlayerJoinHandler
|
||||
post /recent-player-join (TotalPlayerJoinReq) returns (TotalPlayerJoinResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total player count within a specified time range"
|
||||
description: "Get total Total count within a specified time range"
|
||||
)
|
||||
@handler totalPlayerCountHandler
|
||||
post /total-player-count (TotalPlayerCountReq) returns (TotalPlayerCountResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total kill count within a specified time range"
|
||||
description: "Get total kill count within a specified time range"
|
||||
)
|
||||
@handler totalKillCountHandler
|
||||
post /total-kill-count (TotalKillCountReq) returns (TotalKillCountResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total playtime within a specified time range"
|
||||
description: "Get total playtime within a specified time range"
|
||||
)
|
||||
@handler totalPlayTimeHandler
|
||||
post /total-play-time (TotalPlayTimeReq) returns (TotalPlayTimeResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total connect count within a specified time range"
|
||||
description: "Get total connect count within a specified time range"
|
||||
)
|
||||
@handler totalConnectCountHandler
|
||||
post /total-connect-count (TotalConnectCountReq) returns (TotalConnectCountResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total damage count within a specified time range"
|
||||
description: "Get total damage count within a specified time range"
|
||||
)
|
||||
@handler totalDamageCountHandler
|
||||
post /total-damage-count (TotalDamageCountReq) returns (TotalDamageCountResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get total chat message count within a specified time range"
|
||||
description: "Get total chat message count within a specified time range"
|
||||
)
|
||||
@handler totalChatMessageCountHandler
|
||||
post /total-chat-message-count (TotalChatMessageCountReq) returns (TotalChatMessageCountResp)
|
||||
|
||||
@doc (
|
||||
summary: "Get recent players who joined within a specified time range"
|
||||
description: "Get recent players who joined within a specified time range"
|
||||
)
|
||||
@handler recentJoinPlayerHandler
|
||||
post /recent-join-player (RecentJoinPlayerReq) returns (RecentJoinPlayerResp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user