Add SCUM Source RCON transport
This commit is contained in:
@@ -106,6 +106,22 @@ type RemoteAdapterResponse struct {
|
||||
CompletedAt time.Time `json:"completedAt,omitempty"`
|
||||
}
|
||||
|
||||
type SourceRCONCommandRequestBody struct {
|
||||
Kind domain.SourceRCONCommandKind `json:"kind"`
|
||||
ChatType int `json:"chatType,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
TargetSteamID string `json:"targetSteamId,omitempty"`
|
||||
Command string `json:"command,omitempty"`
|
||||
IdempotencyKey string `json:"idempotencyKey"`
|
||||
}
|
||||
|
||||
type SourceRCONCommandResponse struct {
|
||||
JobID string `json:"jobId"`
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
func (request MetricBatchIngestRequest) ToDomain() domain.MetricBatchIngest {
|
||||
samples := make([]domain.MetricSample, len(request.Samples))
|
||||
for i, sample := range request.Samples {
|
||||
@@ -158,6 +174,14 @@ func RemoteAdapterFromDomain(result domain.RemoteAdapterResult) RemoteAdapterRes
|
||||
return RemoteAdapterResponse{RequestID: result.RequestID, ServerInstanceID: result.ServerInstanceID, DeclarationKey: result.DeclarationKey, TargetKey: result.TargetKey, Kind: result.Kind, Status: result.Status, Retryable: result.Retryable, Message: result.Message, ResultRef: result.ResultRef, AuditEventID: result.AuditEventID, CompletedAt: result.CompletedAt}
|
||||
}
|
||||
|
||||
func (request SourceRCONCommandRequestBody) ToDomain(serverInstanceID string) domain.SourceRCONCommandRequest {
|
||||
return domain.SourceRCONCommandRequest{ServerInstanceID: serverInstanceID, Kind: request.Kind, ChatType: request.ChatType, Message: request.Message, TargetSteamID: request.TargetSteamID, Command: request.Command, IdempotencyKey: request.IdempotencyKey}
|
||||
}
|
||||
|
||||
func SourceRCONCommandFromDomain(dispatch domain.SourceRCONCommandDispatch) SourceRCONCommandResponse {
|
||||
return SourceRCONCommandResponse{JobID: dispatch.JobID, ServerInstanceID: dispatch.ServerInstanceID, Status: dispatch.Status, Message: dispatch.Message}
|
||||
}
|
||||
|
||||
func metricSampleToDomain(sample MetricSampleBody) domain.MetricSample {
|
||||
return domain.MetricSample{ID: sample.ID, ServerInstanceID: sample.ServerInstanceID, Online: sample.Online, PlayerCount: sample.PlayerCount, MaxPlayers: sample.MaxPlayers, TPS: sample.TPS, LatencyMS: sample.LatencyMS, CPUPercent: sample.CPUPercent, MemoryPercent: sample.MemoryPercent, DiskPercent: sample.DiskPercent, Source: sample.Source, CollectedAt: sample.CollectedAt}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user