There are multiple server messages that can be set from the Server -> Messages page. This guide will talk through each message, where it is shown to drivers and how to fully configure it using templates.
Server name templates make use of golang's templating language. You can use this to make your server name change based on current server/event settings.
A simple example is the default template:
{{ .ServerName }} - {{ .EventName }}
So if your server name is "My Great Server" and you start a Custom Race called "GT3 Practice at Silverstone" then your server will appear in the lobby as "My Great Server - GT3 Practice at Silverstone".
You can use any of the elements inside the CurrentRaceConfig struct and the GlobalServerConfig struct (click the links for details) in a template.
For example:
{{ .Track }} {{ with .TrackLayout }}({{ . }}){{ end }} - an event hosted by {{ .ServerName }}
Would show the following for an event at Laguna Seca:
ks_laguna_seca - an event hosted by My Great Server
Another example is:
{{ .ServerName }} - {{ .EventName }} {{ if eq .RaceExtraLap 1 }}This server will force you to drive another lap at the end of the race!{{ end }}
The Message Of The Day is shown by the game in a full screen popup window to everyone who joins the server. It does not currently support templates, and only accepts normal text input (no special formatting).
The Server Join Message is shown in chat to everyone who joins the server. It does not currently support templates, and only accepts normal text input (no special formatting).
Discord Notification Messages make use of golang's templating language.
Discord Notifications can be sent directly to the Discord server/channel of your choice automatically when certain events happen in the Manager (for example, an event is starting). For more information about Discord Notifications and how to enable them, have a look at the Discord Notifications Guide.
Discord Notification Templates have access to any elements inside the CurrentRaceConfig struct and the GlobalServerConfig struct (click the links for details). They also have access to the following custom variables:
Most of these variables are used in the default templates so you can see how they work! You can configure both the title:
{{ with .EventName }}{{ . }}{{ else }}Event{{ end }} {{ .NotificationContext }}{{ if .Reminder }} - {{ .ReminderTime }} {{ end }}
And the message body:
Server Name: {{ .ServerName }}
{{ if .Scheduled }}
Scheduled Date: {{ .ScheduledDate }}
{{ end }}
{{ with .Password }}
Password: '{{ . }}' (no quotes)
{{ else }}
No password
{{ end }}
Track: {{ .TrackInfo }}
Car(s): {{ .CarList }}
{{ if .Results }}
{{ with .BaseURL }}[{{ $.SessionResults.Type.String }} Results]({{ . }}results/{{ $.SessionResults.SessionFile }})
{{ else }}{{ range $i, $result := .SessionResults.Result }}{{ add 1 $i }}{{ ordinal (add 1 $i) }}: {{ $result.DriverName }}{{ end }}
{{ end }}
{{ end }}
In v2.1.4 and onwards you can access elements inside SessionResults if the Results boolean is true.
If you have modified the Discord Notification Message prior to updating to v2.1.4 then the default results section of the template will not be shown, so you can also find it here:
{{ if .Results }}
{{ with .BaseURL }}[{{ $.SessionResults.Type.String }} Results]({{ . }}results/{{ $.SessionResults.SessionFile }})
{{ else }}{{ range $i, $result := .SessionResults.Result }}{{ add 1 $i }}{{ ordinal (add 1 $i) }}: {{ $result.DriverName }}{{ end }}
{{ end }}
{{ end }}
The Content Manager Welcome Message makes use of golang's templating language.
Content Manager Welcome Messages are shown in the Content Manager server browser when you select a server. Content Manager Wrapper integration must be enabled on the Server Options page for this input to appear.
As you can see from this example Content manager Welcome Messages also support images and custom styling via bbcode
. You don't need to do anything special to achieve this, just add images/links/etc. to your CM Welcome Message using the provided WYSIWYG editor and ACSM will handle converting it to bbcode
for you.
In the template you can use any of the elements inside the CurrentRaceConfig struct and the GlobalServerConfig struct (click the links for details).
On top of this you can use following custom template variables, which are also shown in the example below:
As an example, here is the default template for the CM Welcome Message:
{{ .Track }} {{ with .TrackLayout }}({{ . }}){{ end }} - an event hosted by {{ .ServerName }}
{{ .EventDescription }}
{{ .ChampionshipPoints }}
{{ .CarDownloads }}
{{ .TrackDownload }}
The
EventDescription
is automatically generated in some cases (Quick Races, Custom Races, Race Weekends) but for Championship events the event description will inherit the "Important Information" input that you configured when creating the Championship (you can also edit the Championship at any time to modify this).