PDA

View Full Version : RCON Status Fix (Alternative to Router changes)


imported_Corporal Punisher
02-11-2004, 10:28 PM
Well, I've sucessfully implemented a replacement for the status command. So far it's clumsy and displays to everyone on the server, but could be fixed.

I was about to post it but it's mixed with all our other mods and stuff so I'll work out the bugs, and create a short textfile on how it's done.

Basically a cvar is set by an admin and it lists all clients and their client number.

It's not the best way, but for us people with $50 routers that dont allow fragmented packets to come thru it's the perfect way :) No more minimizing to kick someone :P


Anyways watch this thread, I'll post the solution soon.

imported_Corporal Punisher
02-11-2004, 10:58 PM
Here is the raw code, set up specifically for our server, just change it around as you see fit.

Also, if you find a way to get it to display to whoever issues the command only and not the entire server, please let me know :P

Oh the command.... /rcon stat 1



Instructions. If your running a custom mod, open the pk3 and look under maps/mp/gametypes for the gametype you run. If your not running a mod then see the many threads on creating a pk3 and put the gametypes into your own pk3 under the proper folders.

/////////////////////////////////////////////////////////////////////
//Put this code in the Main() function (near the top of the gsc file)
/////////////////////////////////////////////////////////////////////
/////////// StatusFeed v1.1 /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
if(getcvar("stat") == "") // Sets up the Cvar
setcvar("stat", "0");
thread StatusFeed(); // Starts the listener
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////
//Put this section at the bottom of the file after the last "}"
/////////////////////////////////////////////////////////////////////
/////////// StatusFeed v1.1 /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
StatusFeed()
{


while(1)
{
wait 2; // checks every 2 seconds for the command


if (getcvarint("stat") == 1 )
{
setcvar("stat", "0");
cplayers = getentarray("player", "classname");
iprintln ("^2CorpyStat ^2: ^3Rcon Status replacement.");
iprintln ("------------------------------------");
for(i = 0; i < cplayers.size; i++)
{
cplayer = cplayers[i];
iprintln ("^1Client ^2" + cplayer getEntityNumber() + " ^1: ^7" + cplayer.name);
}
iprintln ("------------------------------------");
iprintln ("^2CorpyStat ^2: ^3End of Status Report");
iprintln (" ");
iprintln (" ");
iprintln (" "); // these blank lines scrolls the hud element so that only
iprintln (" "); // people with a quick eye see's it.... we get a lot of
iprintln (" "); // "HOLY SHIP WTF WAS THAT" when it runs without this :P
iprintln (" "); // Look in the console for the results :P
}
}
}
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////


If anyone wants to put together a stock level pk3 for unmodded servers to use this then cool, or if anyone with some time wants to add it to PRM or the other realism mods or whatever, it's all cool.

thejerk
02-12-2004, 12:28 AM
? for experienced modders reading this: is it possible to use the tell command instead of lprintln? I mean, you'd have to get the clientnumber of the person giving the command first, which I can't imagine would be too tough for you experienced guys, but once you've done that it would be rather easy, right? Ultimately that would fix the issue of displaying it to everyone.

imported_Corporal Punisher
02-12-2004, 02:03 AM
The problem here is that the code has to be server thread and not a self thread, simply because it's taking names of everyone playing. If a self thread had access to the player data then it would be a snap. I haven't had time to play around much more with it yet, but it could be done.

I thought about maybe setting a bind to a key which loads my in game name to the cvar on the server. This way the server would know which client to send the information our to, or een "tell" the specific user.

The problem being that not everyone wants to go setup a bind to have a server cvar set to their in game name.... but worth a try regardless eh?

There's tons of ways of doing stuff, that's why I've always loved programming, that's what gets me up in the mornings :P

Anyways if I get it working in whatever fashion I'll be posting it free for all here. This rcon issue is getting to a lot of people and I dont think IW are going to do anything about it really. ... but that's another story for another thread :P

Night.

imported_Sparty
02-12-2004, 07:35 AM
The strange thing is that All Seeing Eye shows a complete user list with ping and score. How is that done? Can't we just do that in an rcon client? I myself am having the rcon status problem when more than 15 players are on the server. But ASE sees everyone. How can that be possible?

2drunk2funk
02-12-2004, 08:54 AM
Use my Rcon4COD utility.
If you have problems getting player list with the rcon command then click the "Query Mode" check box and you will get the player list on populate. Less information but still allows you to kick/ban/message player

Sparky,
If you look closely ASE does not actually show you everything like you think. All it shows is Ping/Score and name from the server.
That is exactly what I have implemented as option in my Rcon4Cod utility which gets around the fragmented packets issue.

:wink:
Link in sig

imported_Corporal Punisher
02-12-2004, 11:50 AM
Nothing beats being able to get a status in game again :P No more minimizing! Thank gawd!

2drunk2funk
02-16-2004, 07:35 PM
Your right there Corporal
It certainly helps :)

Maybe Inifinity will start answering some of these issues, help us people out writing utilities, maps and mods.

Where is the SDK ?