-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIRustServerQuery.cs
More file actions
34 lines (30 loc) · 2.23 KB
/
Copy pathIRustServerQuery.cs
File metadata and controls
34 lines (30 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace RustPlusBot.Features.Connections.Listening;
/// <summary>Reads live data from a connected server's socket (implemented by the connection supervisor).</summary>
public interface IRustServerQuery
{
/// <summary>Gets server info, or null when (guildId, serverId) has no live socket.</summary>
/// <param name="guildId">The owning guild snowflake.</param>
/// <param name="serverId">The target server id.</param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns>A server-info snapshot, or null when there is no live socket.</returns>
Task<ServerInfoSnapshot?> GetServerInfoAsync(ulong guildId, Guid serverId, CancellationToken cancellationToken);
/// <summary>Gets in-game time, or null when there is no live socket.</summary>
/// <param name="guildId">The owning guild snowflake.</param>
/// <param name="serverId">The target server id.</param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns>An in-game time snapshot, or null when there is no live socket.</returns>
Task<ServerTimeSnapshot?> GetTimeAsync(ulong guildId, Guid serverId, CancellationToken cancellationToken);
/// <summary>Gets a team snapshot, or null when there is no live socket.</summary>
/// <param name="guildId">The owning guild snowflake.</param>
/// <param name="serverId">The target server id.</param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns>A team snapshot, or null when there is no live socket.</returns>
Task<TeamInfoSnapshot?> GetTeamInfoAsync(ulong guildId, Guid serverId, CancellationToken cancellationToken);
/// <summary>Promotes a team member to team leader; returns false when there is no live socket or the API fails.</summary>
/// <param name="guildId">The owning guild snowflake.</param>
/// <param name="serverId">The target server id.</param>
/// <param name="steamId">Steam64 id of the member to promote.</param>
/// <param name="cancellationToken">A cancellation token.</param>
/// <returns>True if promoted; false when no live socket or the API fails.</returns>
Task<bool> PromoteToLeaderAsync(ulong guildId, Guid serverId, ulong steamId, CancellationToken cancellationToken);
}