Notes |
|
(0003986)
|
Dusk
|
2012-07-15 10:14
|
|
I don't understand this request. DISCONNECT CLIENTSIDE already works - it executes a client-side script when someone disconnects or spectates. |
|
|
|
I suspect that the point of this request has to do with
Quote from ZzZombo
In order to this to work properly server must send all serverside variables, so client could look for his default values.
I don't understand what exactly this is supposed to do either though. Serverside ACS variables are not synced with the clients and I don't think that we should change this. |
|
|
(0003995)
|
ZzZombo
|
2012-07-15 14:04
(edited on: 2012-07-16 04:22) |
|
Oh, I forgot to mention, I meant that the script is supposed to check that script executing client is the client left the server and in this case it restores old player settings. Whether it made my request clear?
|
|
|
|
I don't really know what it should restore and how it should know that it has to restore something. It would certainly help if you post a minimal (pseudo) code example to outline what exactly you want to happen. BTW: Do you mean ConsoleCommand instead of ClientCommand?
|
|
|
(0003998)
|
ZzZombo
|
2012-07-16 01:55
(edited on: 2012-07-16 01:57) |
|
#include "zcommon.acs"
#define START_ID 600
bool cl_skins[32];
script 650(void) CLIENTSIDE
{
SetResultValue(GetCVar("cl_skins"));
}
script 651(int player) DISCONNECT CLIENTSIDE
{
if(!ThingCount("DoomPlayer",START_ID+player)==0)//ThingCount() should return 0 if disconnected player is the player executing the script
{//restoring old player settings
if(cl_skins[Player]==1)ConsoleCommand("cl_skins 1");else
if(cl_skins[Player]==2)ConsoleCommand("cl_skins 2");
}
}
script 652 ENTER
{
cl_skins[PlayerNumber()]=ACS_ExecuteWithResult(650,0,0,0);//remembering old CVar value
if(cl_skins[PlayerNumber()])ConsoleCommand("cl_skins 0");//anticheat: don't allow other players to trick us with changing skins (actual in Zombie Horde) to hidden by completely prohibiting them on client side.
Thing_ChangeTID(0,START_ID+PlayerNumber());
}
And yes, I mean ConsoleCommand(), but I was writing a plugin for SourceMod while opening the ticket and might confused it with ClientCommand() function which is available there.
|
|
|
(0004000)
|
Dusk
|
2012-07-16 09:48
(edited on: 2012-07-16 09:49) |
|
Can't you just store the value of cl_skins in an OPEN CLIENTSIDE script in a map variable?
if(!ThingCount("DoomPlayer",START_ID+player)==0)//ThingCount() should return 0 if
disconnected player is the player executing the script
argh! remember what I said about a possible SetActivatorToConsolePlayer() and how it could be used to retrieve the consoleplayer number? :P
|
|
|
|
"Can't you just store the value of cl_skins in an OPEN CLIENTSIDE script in a map variable?" - show, please, what do you mean in a short script, I'm unsure I got it right. |
|
|
(0004002)
|
Dusk
|
2012-07-16 12:26
(edited on: 2012-07-16 12:27) |
|
Something like this methinks:
int cl_skins;
script 1 OPEN CLIENTSIDE {
cl_skins = GetCVar ("cl_skins");
// Define a net-script 3 if you need to send
// cl_skins value to server
// ConsoleCommand ("puke -3 $cl_skins)
}
script 2 DISCONNECT CLIENTSIDE (int gone) {
// no need to check against "gone" here..
switch (cl_skins) {
case 0:
ConsoleCommand ("cl_skins 0");
break;
case 1:
ConsoleCommand ("cl_skins 1");
break;
case 2:
ConsoleCommand ("cl_skins 2");
break;
}
}
That is, if DISCONNECT CLIENTSIDE scripts do execute when you disconnect from the server..
|
|
|
|
I wonder will it even compile...script 2 DISCONNECT CLIENTSIDE (int gone)
And won't every connected player just override cl_skins to his own value? |
|
|
(0004004)
|
Dusk
|
2012-07-16 13:51
|
|
It's a CLIENTSIDE script, so GetCVar will obviously return the client's version of the CVar. It's as if you retrieved the value by calling the CVar from the console. |
|
|
|
AFAIK client has zero knowledge about variables in ACS. |
|
|
(0004006)
|
Dusk
|
2012-07-16 17:23
|
|
The client does not know any script variables the server sets in scripts, but it can set values of its own to script variables and read them.
|
|
|
|
First and foremost, mods are not supposed to mess with non-volatile configuration settings via ConsoleCommand. I said this before back then on the Skulltag forums and say it again now: If the situation gets out of hand (and it was close to this at one point when somebody IIRC enforced a certain gamma setting) I will be forced to either remove ConsoleCommand completely or at least severely restrict what can be done with it. By design ConsoleCommand is a security nightmare that never should have been added in the first place...
In your example, instead of trying to mess with the local cl_skins value, you should give the player classes the NOSKIN flag. In case you want to restrict something that can't be restricted yet (there are a couple of dmflags, e.g. sv_noidentifytarget and sv_forcegldefaults, I added solely to prevent people from abusing ConsoleCommand), please request a dmflag.
Having that said, do you need your request for anything than other restoring CVARs messed up by ConsoleCommand? |
|
|
|
+NOSKIN doesn't work. And no, I have no need for anything else. |
|
|
|
Did you try NOSKIN in Zandronum? It was broken in 98d, but it should work in Zandronum. If it doesn't, it's a bug that should be fixed. |
|
|
|
Independently of that messing around with user cvars like this is evil, I think CLIENTSIDE UNLOADING scripts are possibly what you are looking for. I guess those don't work yet, but if there is demand for them, I consider adding them. You should find a different example though that it is not just trying to revert an evil hack :P. |
|
|
|
NOSKIN in Zandronum is out of my interests right now cuz Grandvoid Zombie Horde server is on version 98d of Skulltag, if to be honest.
I can use that script to message players something like "Good luck, see ya later!". But really, I only had need for restoring CVARs, but since you said I shouldn't even touch them I refused of this idea. |
|
|
|
Quote from ZzZombo NOSKIN in Zandronum is out of my interests right now cuz Grandvoid Zombie Horde server is on version 98d of Skulltag, if to be honest.
I don't see how this changes anything. Anything you request now obviously won't work in 98d. What's the difference between not being able to use NOSKIN in 98d and not being able to use your idea of DISCONNECT CLIENTSIDE scripts in 98d? |
|
|
(0004069)
|
ZzZombo
|
2012-07-24 07:22
(edited on: 2012-07-24 07:27) |
|
That explains why I didn't test NOSKIN in Zandronum yet. Konar6, the owner of those servers, can change anything that is server-side as he forked from St so if this idea could be implemented he could backport it.
|
|
|
(0004071)
|
Edward-san
|
2012-07-24 13:33
(edited on: 2012-07-24 13:48) |
|
The NOSKIN fix involves the client executable, not the server, so it's counterproductive and may cause crashes to your skulltag executable or the server.
Quote from ZzZombo NOSKIN in Zandronum is out of my interests right now cuz Grandvoid Zombie Horde server is on version 98d of Skulltag, if to be honest.
Get a reason and wait till Zandronum stable will come out. Also, if you want a faster release of Zandronum stable, it's better for you to help devs by testing the alpha, ie do what Torr asks :P
|
|
|
|
Hey, why you are so curious about it? Just accept this as a fact: I'm not gonna test it in Zandronum. Dot. |
|
|
|
I'm confused. The sole reason to post anything on the tracker is to influence future Zandronum versions. Why would you refuse to test the Zandronum beta builds? The only way to ensure that something you want to have in the next version is working as you want it to is to test it in the beta builds. If you notice that it doesn't work in the final 1.0 version, you will have to wait for the next public release for a fix. Or are you planning to allow players to use skins as they desire in Zombie Horde? |
|
|
|
I can't test because due to HDD crash all Zandronum installations was blowed up with all games I had there and I can't redownload right now due to my shitty connection. |
|
|
|
Since ConsoleCommand is getting axed, I can't think of anything one would do on disconnect, since all the game info is gone.
If there is something it can do that is relevant, PM me and I'll re-open. |
|