Add telemetry dashboard and automatic server names; record Workshop 0.0.137
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -309,7 +309,7 @@ class ERR_Telemetry
|
||||
json.WriteValue("schemaVersion", 1);
|
||||
string eventId = UUID.GenV4();
|
||||
json.WriteValue("eventId", eventId); json.WriteValue("missionId", m_MissionId);
|
||||
json.WriteValue("serverId", m_State.serverId); json.WriteValue("serverName", m_Config.ServerName);
|
||||
json.WriteValue("serverId", m_State.serverId); json.WriteValue("serverName", ERR_TelemetryServerName.Resolve(m_Config.ServerName));
|
||||
json.WriteValue("type", type); json.WriteValue("occurredAt", System.GetUnixTime());
|
||||
json.WriteValue("partial", m_Partial);
|
||||
int elapsedSeconds = Math.Max(0, (System.GetTickCount() - m_Started) / 1000);
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Resolve on the reporting server for every new event: lobby metadata can be
|
||||
// unavailable during initial startup. Never infer identity from the scenario.
|
||||
class ERR_TelemetryServerName
|
||||
{
|
||||
static string Resolve(string configured)
|
||||
{
|
||||
string name = configured;
|
||||
name.TrimInPlace();
|
||||
if (name.IsEmpty())
|
||||
{
|
||||
ServerConfig config = ServerLobbyApi.GetServerConfig();
|
||||
if (config) name = config.GetName();
|
||||
name.TrimInPlace();
|
||||
}
|
||||
if (name.IsEmpty())
|
||||
{
|
||||
ServerInfo info = GetGame().GetServerInfo();
|
||||
if (info) name = info.GetName();
|
||||
name.TrimInPlace();
|
||||
}
|
||||
if (name.Length() > 120) name = name.Substring(0, 120);
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user