diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a26a007..ceb2f837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.20.1 +* Add event metadata field #223 +* Hide /admin on chat command #233 + ## 1.20.0 * Changes for DLC 1.19 #238 * Update golang dep versions @@ -10,7 +14,7 @@ * Fix float point handling for rain and cloud. #211 * Introducing the advance windows features as Firewall management, custom core affinity and cpu priority. #213 * Add accserver auto update before start instance. - + ## 1.18.0 * Add sorting by number of players. * Add session remaining time in the servers list. diff --git a/docs/docs.go b/docs/docs.go index ba8d4394..465ca740 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1026,6 +1026,9 @@ const docTemplate = `{ "isFixedConditionQualification": { "type": "integer" }, + "metaData": { + "type": "string" + }, "postQualySeconds": { "type": "integer" }, diff --git a/docs/swagger.json b/docs/swagger.json index a71554b3..4d4694e6 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1019,6 +1019,9 @@ "isFixedConditionQualification": { "type": "integer" }, + "metaData": { + "type": "string" + }, "postQualySeconds": { "type": "integer" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ce747fe9..a99eed65 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -299,6 +299,8 @@ definitions: type: integer isFixedConditionQualification: type: integer + metaData: + type: string postQualySeconds: type: integer postRaceSeconds: diff --git a/internal/pkg/instance/config.go b/internal/pkg/instance/config.go index cad160fd..17a95757 100644 --- a/internal/pkg/instance/config.go +++ b/internal/pkg/instance/config.go @@ -110,6 +110,7 @@ type EventJson struct { Rain float64 `json:"rain"` WeatherRandomness int `json:"weatherRandomness"` Sessions []SessionSettings `json:"sessions"` + MetaData string `json:"metaData"` PostQualySeconds int `json:"postQualySeconds"` PostRaceSeconds int `json:"postRaceSeconds"` SimracerWeatherConditions int `json:"simracerWeatherConditions"` diff --git a/internal/pkg/instance/livestate.go b/internal/pkg/instance/livestate.go index 3b502379..861dba1a 100644 --- a/internal/pkg/instance/livestate.go +++ b/internal/pkg/instance/livestate.go @@ -2,6 +2,7 @@ package instance import ( "sort" + "strings" "time" ) @@ -318,6 +319,11 @@ func (l *LiveState) recalculatePositions() { } func (l *LiveState) addChat(name, message string) { + // skip /admin message + if len(message) > 6 && strings.ToLower(message[0:6]) == "/admin" { + return + } + l.Chats = append(l.Chats, ServerChat{ Timestamp: time.Now().UTC(), Name: name, diff --git a/public/src/components/server_config/event.vue b/public/src/components/server_config/event.vue index cff7aa78..3c1a3d23 100644 --- a/public/src/components/server_config/event.vue +++ b/public/src/components/server_config/event.vue @@ -18,6 +18,7 @@ +