Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add single msh MOTD variable which is updated when ms changes status #190

Open
gekigek99 opened this issue Dec 31, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@gekigek99
Copy link
Member

gekigek99 commented Dec 31, 2022

benefits:

  • remove:

    var motd string
    switch {
    case servstats.Stats.Status == errco.SERVER_STATUS_OFFLINE || servstats.Stats.Suspended:
    motd = config.ConfigRuntime.Msh.InfoHibernation
    case servstats.Stats.Status == errco.SERVER_STATUS_STARTING:
    motd = config.ConfigRuntime.Msh.InfoStarting
    case servstats.Stats.Status == errco.SERVER_STATUS_ONLINE:
    // server can't be online if this function was called
    case servstats.Stats.Status == errco.SERVER_STATUS_STOPPING:
    motd = "minecraft server is stopping..."
    }

  • remove:

    var motd string
    switch {
    case servstats.Stats.Status == errco.SERVER_STATUS_OFFLINE || servstats.Stats.Suspended:
    motd = config.ConfigRuntime.Msh.InfoHibernation
    case servstats.Stats.Status == errco.SERVER_STATUS_STARTING:
    motd = config.ConfigRuntime.Msh.InfoStarting
    case servstats.Stats.Status == errco.SERVER_STATUS_ONLINE:
    // server can't be online if this function was called
    case servstats.Stats.Status == errco.SERVER_STATUS_STOPPING:
    motd = "minecraft server is stopping..."
    }

  • remove:

    var mes []byte
    switch servstats.Stats.Status {
    case errco.SERVER_STATUS_OFFLINE:
    mes = buildMessage(reqType, config.ConfigRuntime.Msh.InfoHibernation)
    case errco.SERVER_STATUS_STARTING:
    mes = buildMessage(reqType, config.ConfigRuntime.Msh.InfoStarting)
    case errco.SERVER_STATUS_ONLINE: // ms suspended
    mes = buildMessage(reqType, config.ConfigRuntime.Msh.InfoHibernation)
    case errco.SERVER_STATUS_STOPPING:
    mes = buildMessage(reqType, "server is stopping...\nrefresh the page")
    }

@gekigek99 gekigek99 added the enhancement New feature or request label Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant