turn off spectate on server?

SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
Is there a way to turn off spectating either by command line at server start up or ini config?

Thanks for your time :)

Comments

  • VitdomVitdom Join Date: 2012-04-30 Member: 151345Members, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, WC 2013 - Shadow
    edited January 2013
    No. But you can edit or mod \ns2\lua\NS2ConsoleCommands_Server.lua:47 to fail when the player attempts to join the Spectator team, and register an admin config setting to control this behavior, which updates on map change.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->local function Spectate(player)
        local specEnabled = Server.GetConfigSetting("spectate_enabled")
        if specEnabled and specEnabled == false then
            return false, player
        else
            return GetGamerules():JoinTeam(player, kSpectatorIndex)
        end
    end<!--c2--></div><!--ec2-->

    I can put this up on the workshop as a mod if you want + a server admin command for toggling the setting on/off live. Or else you'd have to exclude the file from consistency checks.

    If you want to give admins the ability to join spec I can look if it is possible to add that.
  • SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
    Wow, I'd love to have the mod version you describe. If it's too much of a hassle for the admin to be able to spectate then don't kill yourself coding that in. I'd be grateful with just the latter.

    My reason for asking about turning off spectator in the first place is that I have seen multiple people playing from the same ip's so they obviously know each other and one will spectate the op team and are telling revealing information to the others. To me this is bad sportsmanship.

    I'd be more than happy to test out your mod on my server if you like :)
  • SeeVeeSeeVee Join Date: 2012-10-31 Member: 165206Members
    Vitdom,

    If I edit the file NS2ConsoleCommands_Server.lua will my server appear as modded or is this truly server-side only?
Sign In or Register to comment.