Add No Chat Report's support output.
ci/woodpecker/push/build Pipeline is pending Details

This commit is contained in:
Captain ALM 2023-08-14 21:33:41 +01:00
parent f97258bbd9
commit ac912af1d9
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
3 changed files with 22 additions and 1 deletions

View File

@ -174,12 +174,20 @@
<td>{{ if .Data.AllowModListing }}<a href="{{ .ToggleQuery "mods" }}" title="Toggle Mod List.">{{ end }}{{ .Queried.ModCount }}{{ if .Data.AllowModListing }}</a>{{ end }}</td>
</tr>
{{ end }}
{{ if and .Data.AllowSecureProfileModeDisplay .Queried.SecureProfilesEnforced }}
{{ if .Data.AllowSecureProfileModeDisplay }}
{{ if .Queried.SecureProfilesEnforced }}
<tr>
<th>Secure Profiles Enforced</th>
<td>{{ .Queried.SecureProfilesEnforced }}</td>
</tr>
{{ end }}
{{ if .Queried.PreventsChatReports }}
<tr>
<th>Chat Reports Prevented</th>
<td>{{ .Queried.PreventsChatReports }}</td>
</tr>
{{ end }}
{{ end }}
{{ if and .Data.AllowPreviewChatModeDisplay .Queried.PreviewChatEnforced }}
<tr>
<th>Preview Chat Enforced</th>

View File

@ -24,6 +24,7 @@ type MC struct {
Mods []string
SecureProfilesEnforced *bool
PreviewChatEnforced *bool
PreventsChatReports *bool
}
func (m MC) GetFaviconSRC() template.HTMLAttr {

View File

@ -59,6 +59,7 @@ func (m Marshal) NewMC() (MC, error) {
Mods: CollectMods(r.ModInfo),
SecureProfilesEnforced: CollectSecureProfileEnforcement(r2),
PreviewChatEnforced: CollectPreviewChatEnforcement(r2),
PreventsChatReports: CollectPreventsChatReports(r2),
}, nil
case "legacy", "legacyjava", "javalegacy", "legacy java", "java legacy", "legacy_java", "java_legacy":
r, err := mcutil.StatusLegacy(m.Data.MCAddress, m.Data.MCPort, options.JavaStatusLegacy{
@ -88,6 +89,7 @@ func (m Marshal) NewMC() (MC, error) {
Mods: nil,
SecureProfilesEnforced: nil,
PreviewChatEnforced: nil,
PreventsChatReports: nil,
}, nil
case "bedrock":
r, err := mcutil.StatusBedrock(m.Data.MCAddress, m.Data.MCPort, options.BedrockStatus{
@ -117,6 +119,7 @@ func (m Marshal) NewMC() (MC, error) {
Mods: nil,
SecureProfilesEnforced: nil,
PreviewChatEnforced: nil,
PreventsChatReports: nil,
}, nil
default:
return MC{}, errors.New("Invalid MCType")
@ -191,6 +194,15 @@ func CollectPreviewChatEnforcement(data map[string]interface{}) *bool {
return nil
}
func CollectPreventsChatReports(data map[string]interface{}) *bool {
val, ok := data["preventsChatReports"]
if ok {
toReturn := val.(bool)
return &toReturn
}
return nil
}
func (m Marshal) CollectIPv4Port(port *uint16) uint16 {
if port == nil {
return m.Data.MCPort