Jump to content

Server Slots?


KiraMama

Recommended Posts

Hi, just joined, even though I tend to dislike forums. I just wanted to ask about an issue with the server. Out of the modded servers I've played on, this one would have to be my favorite, because of the balance of the buy system. One of, or the only issue that I've had a problem with and thought was strange was the slot reserveration system. It creates quite a headache to play a game from the beginning of the first round and then get kicked on the third of forth checkpoint because slots being reservered for admins only. Which makes no sense. My only guess is that for some reason, when people load while the game is full, if during the start of a new area on the map and someone hasn't loaded yet, they get kicked in replace of the new person.

 

My first question is: Is it possible to make it like normal verses games in terms of team slots, so that people who are playing aren't kicked while loading after a checkpoint. And second: If it's a matter of an issue with admin slots, is that possible to make invisible, thus making the game "full" and unjoinable unless someone is actually not there. Seen it happen with other people a lot. Of course it's happened like 3-4 times for me today also, which is why I actually decided to post. Anyway, thanks for your time, regardless of the answer. ^_^

Link to comment
Share on other sites

It really depends on what I have for plugins for SourceMod. Something like that would have to be coded by someone who knows what they're doing, which I do not. I've made several additions to the buy points plugin itself like general fixes and other additions like achievements, but I'm building on something, not something from scratch which prevents me from making something good, lol.

 

The whole reserve slots thing is basically for members to occupy spectator slots until someone leaves so that member can then join the game under that slot. There is a bug with it where it kicks someone even though the server isn't full, but the plugin isn't supported anymore and it's the best one around apparently for L4D. Wish there was, but it's all I have to work with now.

 

I appreciate you registering and giving your input. Thanks for that. I'm always lurking on the Sourcemod.net forums and hoping to find something I can replace stuff with, but the L4D 10v10 support is pretty much nil since a lot of servers out there have private plugins because they want player volume so that's why they don't distribute their private plugins to the public. I'm the only admin for the L4D server that has the least bit of experience with sourcemod coding which is pretty on the low side. :(

Link to comment
Share on other sites

  • 1 month later...

I'm going to attempt to dissect what you are requesting here and see if I can answer your question regarding it.

 

You'd like the server to create an additional slot during level load to prevent players being kicked if an admin were to connect while a new level is loading. The problem being that if there are 20 slots and 21 people are trying to connect, a player will be dropped based on load times, which usually results in international players due to the pings which come into play with the load times, i.e. a player with a better connection will load faster.

 

Answer:

 

 

There are several ways, in fact, to handle this.

1.) A new slot can simply be created during the duration of the load, generally PlayersConnected() + 1 , to prevent any players from disconnected for any reason during load.

You would then check and see if there are any slots available.

The other way would, again simply to set sv_maxplayers to always PlayersConnected + 1.

 

I won't spoil the fun on the other ways, but for me, I have it where a player connects, they are sent to spectator, and a slot is created for them, then they are assigned to a team, and if the teams

are over the limit, a player is, at random, dropped from the team they were placed on (assuming, again if that team is now 10/9 players).

 

I've included some code examples , as simply examples.

 

I would offer my code, but you'd have to go through and disable the modules you don't want, and there are a lot of modules, so it could be a hassle.

 

stock PlayersConnected()
{
   for (new i = 1; i <= MaxClients; i++)
   {
       if (!IsClientConnected(i) || IsFakeClient(i)) continue;
       clients_ingame++;
   }
}

stock bool:AnySlotsAvailable()
{
   if (FindConVar("sv_maxplayers") >= clients_ingame)
       return false;
   return true;
}

SetMapLoadSlots()
{
   if (!AnySlotsAvailable())
   {
       SetConVarInt(FindConVar("sv_maxplayers"), clients_ingame + 1);
   }
}

Link to comment
Share on other sites

  • 1 month later...
Member
(edited)

So... Thanks to sky. I pmed him, asking about the loading issue. This message i guess is pretty much for Jackie. I may post this on the allied modders forum for help.

 

My pm:

Basically, what I wanted to ask has to do with slot jacking. In the campaign, between loads for new maps, sometimes new people load in. During that time they will take a spot that someone had, and that person that loads slower will get kicked. The reason they can do this is because there are 2 spectator slots for members/admins.

 

Is there a way to disable loading at the end of a map round between checkpoints/Bind people to the slots? Or something along those lines so that people don't get slot jacked?

 

Sky said:

======================================================================

The easiest way would be to grab the steamid's of all the players at the end of the round who are in the game

 

#define PLUGIN_VERSION "blah"

 

new String:SteamID[MAXPLAYERS + 1][64];

new roundEndCount;

new clientCount;

 

public OnPluginStart()

{

// whatever

HookEvent("round_end", Event_RoundEnd);

}

 

public OnMapStart()

{

roundEndCount = 0;

}

 

public Action:Event_RoundEnd(Handle:event, String:event_name[], bool:dontBroadcast)

{

roundEndCount++;

// Round end occurs twice every time it occurs. If it isn't the third time, it was the first round end.

if (roundEndCount < 3) return;

for (new i = 1; i <= MaxClients; i++)

{

if (!IsClientInGame(i) || IsFakeClient(i)) continue;

GetClientAuthString(i, SteamID, sizeof(SteamID));

}

clientCount = MaxClients;

}

 

public OnClientPostAdminCheck(client)

{

if (clientCount < 1) return;

decl String:compareSteamID[64];

GetClientAuthString(client, compareSteamID, sizeof(compareSteamID));

if (!StrEqual(compareSteamID, SteamID[client]))

{

KickClient(client, "");

}

else clientCount--;

}

 

 

 

That will save the steamids of all the users before the map change.

Then, when connecting users enter the server, it will check to see if they are one of the original users.

Every time a valid user connects, it decrements the counter.

When it hits 0, all users from last round have connected.

 

 

You'll need to write code to check in case a player disconnects between map rounds, otherwise it'll never let players in,

since it'll stay at clientCount + 1 forever.

 

But that should get you started.

======================================================================

 

 

Sounds like a good idea, wouldn't you say? Though it still needs something for checking for disconnects. Then maybe a message added to the screen for people in game alerting that everyone has connected? Or an alert for how many are left from the last round? There should already be a similar code on the server, as we all get alerted when someone leaves mid game. So it should be possible to implement, right? Though i wonder if it automatically kicks those that aren't bound to the ID, even if they are members and reserve spots are there.

 

Either way,I think this would really help. Especially when there are games with even teams. Teams generally get unbalanced during those epic matches cause of loads in-between maps. Anyway, just my two cents. Disclaimer: I take no credit for this, etc, as I know jack squat about coding this. Mind you, I doubt I'll care about this code at all after I build a desktop and stop using this laptop.

Edited by KiraMama
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...