MantisBT - Zandronum
View Issue Details
0000923Zandronum[All Projects] Suggestionpublic2012-07-14 02:532015-03-22 17:56
ZzZombo 
 
normalminorN/A
closedinvalid 
MicrosoftWindowsXP/Vista/7
 
 
0000923: New DISCONNECT CLIENTSIDE scripts
Scripts of such types would be useful for restoring CVARs, changed by ClientCommand(). In order to this to work properly server must send all serverside variables, so client could look for his default values.
No tags attached.
Issue History
2012-07-14 02:53ZzZomboNew Issue
2012-07-15 10:14DuskNote Added: 0003986
2012-07-15 10:15DuskStatusnew => feedback
2012-07-15 11:51Torr SamahoNote Added: 0003991
2012-07-15 14:04ZzZomboNote Added: 0003995
2012-07-15 14:04ZzZomboStatusfeedback => new
2012-07-15 14:07ZzZomboNote Edited: 0003995bug_revision_view_page.php?bugnote_id=3995#r2164
2012-07-15 14:07ZzZomboNote Edited: 0003995bug_revision_view_page.php?bugnote_id=3995#r2165
2012-07-15 18:54Torr SamahoNote Added: 0003997
2012-07-15 18:54Torr SamahoNote Edited: 0003997bug_revision_view_page.php?bugnote_id=3997#r2167
2012-07-15 18:55Torr SamahoNote Revision Dropped: 3997: 0002166
2012-07-16 01:55ZzZomboNote Added: 0003998
2012-07-16 01:57ZzZomboNote Edited: 0003998bug_revision_view_page.php?bugnote_id=3998#r2169
2012-07-16 04:22ZzZomboNote Edited: 0003995bug_revision_view_page.php?bugnote_id=3995#r2170
2012-07-16 09:48DuskNote Added: 0004000
2012-07-16 09:49DuskNote Edited: 0004000bug_revision_view_page.php?bugnote_id=4000#r2174
2012-07-16 11:08ZzZomboNote Added: 0004001
2012-07-16 12:26DuskNote Added: 0004002
2012-07-16 12:26DuskNote Edited: 0004002bug_revision_view_page.php?bugnote_id=4002#r2176
2012-07-16 12:27DuskNote Edited: 0004002bug_revision_view_page.php?bugnote_id=4002#r2177
2012-07-16 12:40ZzZomboNote Added: 0004003
2012-07-16 13:51DuskNote Added: 0004004
2012-07-16 13:52DuskStatusnew => feedback
2012-07-16 14:30ZzZomboNote Added: 0004005
2012-07-16 14:30ZzZomboStatusfeedback => new
2012-07-16 17:23DuskNote Added: 0004006
2012-07-16 17:23DuskNote Edited: 0004006bug_revision_view_page.php?bugnote_id=4006#r2179
2012-07-17 19:34Torr SamahoNote Added: 0004008
2012-07-17 19:35Torr SamahoStatusnew => feedback
2012-07-18 02:09ZzZomboNote Added: 0004011
2012-07-18 02:09ZzZomboStatusfeedback => new
2012-07-18 19:05Torr SamahoNote Added: 0004012
2012-07-18 19:06Torr SamahoStatusnew => feedback
2012-07-23 19:19Torr SamahoNote Added: 0004059
2012-07-24 02:18ZzZomboNote Added: 0004064
2012-07-24 02:18ZzZomboStatusfeedback => new
2012-07-24 06:26Torr SamahoNote Added: 0004065
2012-07-24 06:27Torr SamahoStatusnew => feedback
2012-07-24 07:22ZzZomboNote Added: 0004069
2012-07-24 07:22ZzZomboStatusfeedback => new
2012-07-24 07:27ZzZomboNote Edited: 0004069bug_revision_view_page.php?bugnote_id=4069#r2217
2012-07-24 13:33Edward-sanNote Added: 0004071
2012-07-24 13:46Edward-sanNote Edited: 0004071bug_revision_view_page.php?bugnote_id=4071#r2219
2012-07-24 13:48Edward-sanNote Edited: 0004071bug_revision_view_page.php?bugnote_id=4071#r2220
2012-07-24 14:55ZzZomboNote Added: 0004072
2012-07-24 18:15Torr SamahoNote Added: 0004074
2012-07-24 18:16Torr SamahoStatusnew => feedback
2012-07-25 01:56ZzZomboNote Added: 0004077
2012-07-25 01:56ZzZomboStatusfeedback => new
2014-06-11 21:43WatermelonNote Added: 0009115
2014-06-11 21:43WatermelonStatusnew => closed
2015-03-22 17:56Edward-sanResolutionopen => invalid

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.
(0003991)
Torr Samaho   
2012-07-15 11:51   
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?

(0003997)
Torr Samaho   
2012-07-15 18:54   
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

(0004001)
ZzZombo   
2012-07-16 11:08   
"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..

(0004003)
ZzZombo   
2012-07-16 12:40   
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.
(0004005)
ZzZombo   
2012-07-16 14:30   
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.

(0004008)
Torr Samaho   
2012-07-17 19:34   
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?
(0004011)
ZzZombo   
2012-07-18 02:09   
+NOSKIN doesn't work. And no, I have no need for anything else.
(0004012)
Torr Samaho   
2012-07-18 19:05   
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.
(0004059)
Torr Samaho   
2012-07-23 19:19   
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.
(0004064)
ZzZombo   
2012-07-24 02:18   
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.
(0004065)
Torr Samaho   
2012-07-24 06:26   
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

(0004072)
ZzZombo   
2012-07-24 14:55   
Hey, why you are so curious about it? Just accept this as a fact: I'm not gonna test it in Zandronum. Dot.
(0004074)
Torr Samaho   
2012-07-24 18:15   
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?
(0004077)
ZzZombo   
2012-07-25 01:56   
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.
(0009115)
Watermelon   
2014-06-11 21:43   
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.