<reponame>CorySanin/stepmania-server
""" Discovery controller """

from smserver.smutils.smpacket import smcommand
from smserver.smutils.smpacket import smpacket
from smserver.stepmania_controller import StepmaniaController
from smserver import models

class DiscoveryController(StepmaniaController):
    command = smcommand.SMClientCommand.NSCFormatted
    require_login = False

    def handle(self):
        self.send(smpacket.SMPacketServerNSCFormatted(
            server_port=self.server.config.server["port"],
            server_name=self.server.config.server["name"],
            nb_players=models.User.nb_onlines(self.session)
        ))

""" Discovery controller """

from smserver.smutils.smpacket import smcommand
from smserver.smutils.smpacket import smpacket
from smserver.stepmania_controller import StepmaniaController
from smserver import models

class DiscoveryController(StepmaniaController):
    command = smcommand.SMClientCommand.NSCFormatted
    require_login = False

    def handle(self):
        self.send(smpacket.SMPacketServerNSCFormatted(
            server_port=self.server.config.server["port"],
            server_name=self.server.config.server["name"],
            nb_players=models.User.nb_onlines(self.session)
        ))
Discovery controller