clans slots

TechnoTechno Join Date: 2012-08-23 Member: 156268Members
<div class="IPBDescription">reserve slots</div>ok guys any 1 no how to set up reserve slots for our server

Comments

  • JuCCiJuCCi Join Date: 2011-08-08 Member: 114961Members, NS2 Map Tester
    We have been working on a solid way for a while and found 1 way but not solid. Hope the Dev's have a idea.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Coincidentally just answered a PM about this very subject. Simply put, I've perfected it using only the scripts\code we have available to us now, but it's buried in an incomplete version of GameOvermind, and is A LOT of work to rebuild (by another capable modder). What is best is for the devs to just add a function to the Lua-scripts to allow modders to set what num of slots will be sent out by the query-responder.
  • JuCCiJuCCi Join Date: 2011-08-08 Member: 114961Members, NS2 Map Tester
    Thanks for chiming in Player. I wish the devs would put this a lil higher on the list, since people need help to pay and keep servers up.
  • ZeikkoZeikko Join Date: 2007-12-16 Member: 63179Members, Squad Five Blue, NS2 Map Tester
    I hope so too. It makes very little sense to host a public server if you can't play on it yourself without kicking people out.
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    The system I had created does work (i think) and seems to work reasonably well, its just somewhat annoying for users as you can connect to the server and fully load into the game, only to get kicked about 2 seconds after (need to wait so that the client actually gets the message about being kicked for reserve slot). Without having any way to provide a message to a client on disconnect (kick/ban really needs this too), or a way to modify the query response (or interact with the client much earlier in the connection process) it will always remain a slightly quirky solution at best.
  • WyzcrakWyzcrak Pot Pie Aficionado Join Date: 2002-12-04 Member: 10447Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue
    <b>UWE DEV Request:</b>

    Please give modders an easy way to lie to people about a server's maximum slots. A setter/mutator method for manipulating the behind-the-scenes number your server engine is reporting to server queries would be <i>delicious</i>. (Correct me if I'm wrong, but) I think Build 216 gives us everything else we need to build a first-class reserved slots system.

    <b>Rationale:</b>

    Build 216 doesn't provide any Lua API for fabricating the number that's reported to server queries as the number of maximum slots. To build a proper reserved slots solution, you need to be able to lie, claiming you have one or two fewer available slots than you actually do.
  • xmtxmt Join Date: 2012-08-22 Member: 156218Members
    I was thinking about writing a "proxy" application that would pretend to be an ns2 server, but really forward connections and queries to a real server. The idea was to implement a queuing system to join full servers for my <a href='index.php?showtopic=120313'>server browser</a>, but I think it could also be used to do reserved slots too.

    If GameOvermind can already do a lot of this stuff, that'd be fantastic. Anyway if anyone would like to collaborate on something like this let me know.
  • ScardyBobScardyBob ScardyBob Join Date: 2009-11-25 Member: 69528Forum Admins, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    +1

    However, realistically UWE is unlikely to get to this anytime soon. You'll likely have to wait/rely on a mod (player's revised OM if/when it gets continued or Dragon's mod).

    Though, if you could figure out how to write this in lua, UWE does accept community code submissions sometimes (its not guaranteed, however).
  • xDragonxDragon Join Date: 2012-04-04 Member: 149948Members, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow
    My reserve slot system is pretty hacky, because its all in lua. Without a way to intercept client connect early and/or lie about the maximum players I cannot think of a good way to do this. Currently mine lets the client connect fully before it can check their status, which it then sends a message if they will be kicked, and waits 2 seconds before kicking them. It also uses a buffer slot so that people can always connect, and needs to be configured with the maximum number of players on the server (since you cannot even read it in lua).
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Here are the contents of a PM I sent earlier, describing my (perfected) method in more detail:

    I did manage to perfect reserved-slots, but it required quite a bit of work to accomplish, and may be a bit out of most modders' league.

    What I did is disable NS2's query-responder, replace it with my own on a different port, and build a mastergameserver-communicator on the same socket to make it show up in the serverbrowser-list. The code-base is in shambles at the moment, because I was rewriting the whole thing at the time I decided to stop due to lack of motivation, so I can't really help you out by providing snippets.

    What you need to do:
    Disable NS2's query-responder (using the <a href="http://hg.opensteamworks.org/open-steamworks/src" target="_blank">Steam-API</a>).
    Learn how to use the <a href="http://www.lua.org/pil/index.html#P4" target="_blank">Lua C-API</a> (or use something like Luabind)
    Build a query-responder using the <a href="https://developer.valvesoftware.com/wiki/Server_queries" target="_blank">SourceEngine-protocol</a>.
    Build a MasterServer-Communicator (<a href="https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol#Game_server_to_master_server" target="_blank">protocol</a>).

    It's a ton of work to do from scratch, the unreleased GameOvermind is over 100.000 lines large using a dozen libraries. It's probably easier to maybe ask Max (or another UWE developer) to just introduce a SetMaxSlots-function to the Lua-scripts.
  • TechnoTechno Join Date: 2012-08-23 Member: 156268Members
    i didnt relize i wood get so much feed back me and my fello clan members donot want to do any 3ed party stuff with the server just if ns2 allready had sumthing to help wih my problem im amased a dev wood post in hear and if any 1 wants to come play with us im the leader of oNoes and atm our server is 1 of the most populat in australia we are trying to get in to the pro sean we v MR on sunday best of for they beat us but we has sume glichy isheys and olney got to play 2 games im loveing this game

    ps i know my spelling is bad no need to tell me c u guys on soom
  • xmtxmt Join Date: 2012-08-22 Member: 156218Members
    Thanks for the info player, a few questions:

    <!--quoteo(post=1966595:date=Aug 25 2012, 07:20 AM:name=player)--><div class='quotetop'>QUOTE (player @ Aug 25 2012, 07:20 AM) <a href="index.php?act=findpost&pid=1966595"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->What you need to do:
    Disable NS2's query-responder (using the <a href="http://hg.opensteamworks.org/open-steamworks/src" target="_blank">Steam-API</a>).
    Learn how to use the <a href="http://www.lua.org/pil/index.html#P4" target="_blank">Lua C-API</a> (or use something like Luabind)
    Build a query-responder using the <a href="https://developer.valvesoftware.com/wiki/Server_queries" target="_blank">SourceEngine-protocol</a>.
    Build a MasterServer-Communicator (<a href="https://developer.valvesoftware.com/wiki/Master_Server_Query_Protocol#Game_server_to_master_server" target="_blank">protocol</a>).<!--QuoteEnd--></div><!--QuoteEEnd-->
    Can you elaborate on step #1 a bit?
    I've checked out OpenSteamWorks, there's a pair of classes that look suitable for this, ISteamGameServer and ISteamMasterServerUpdater. They both seem to share a lot of functionality, and both have a method for controlling heartbeats, so I don't know which to use, although I suppose I could try both.
    Anyway how exactly would I go about using these interfaces? ns2.exe will already have initialised the steamclient api by the time my code would load, so if OSW is loaded as normal via it's CSteamLoader api, would it hook into the existing interfaces created by ns2? Next, I'd probably have to detour some of these functions, such as EnableHeartbeats and replace them with no-ops.

    Imo that seems to be the hard part. Assuming those wiki pages are accurate re-implementing the protocols would be fairly straightforward.
  • playerplayer Join Date: 2010-09-12 Member: 73982Members
    Load steam_api.dll. Because your Lua-DLL mod loads long after the NS2.exe-process has already worked with steam_api.dll, you will be sharing the same instance. Fetch the "SteamGameServer"-symbol, and cast it into the function-prototype:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->typedef ISteamGameServer011* ( *getSteamGameServer )( void );<!--c2--></div><!--ec2-->and execute the function to recieve the pointer to the Steam-API construct.

    Then call the function:
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->EnableHeartbeats( false );<!--c2--></div><!--ec2-->
    You should then be set to build your own systems.
Sign In or Register to comment.