Zandronum Chat on our Discord Server Get the latest version: 3.2
Source Code

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000923Zandronum[All Projects] Suggestionpublic2012-07-14 02:532015-03-22 17:56
ReporterZzZombo 
Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
StatusclosedResolutioninvalid 
PlatformMicrosoftOSWindowsOS VersionXP/Vista/7
Product Version 
Target VersionFixed in Version 
Summary0000923: New DISCONNECT CLIENTSIDE scripts
DescriptionScripts 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.
Attached Files

- Relationships

-  Notes
User avatar (0003986)
Dusk (developer)
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.
User avatar (0003991)
Torr Samaho (administrator)
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.
User avatar (0003995)
ZzZombo (reporter)
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?

User avatar (0003997)
Torr Samaho (administrator)
2012-07-15 18:54
edited on: 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?

User avatar (0003998)
ZzZombo (reporter)
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.

User avatar (0004000)
Dusk (developer)
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

User avatar (0004001)
ZzZombo (reporter)
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.
User avatar (0004002)
Dusk (developer)
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..

User avatar (0004003)
ZzZombo (reporter)
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?
User avatar (0004004)
Dusk (developer)
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.
User avatar (0004005)
ZzZombo (reporter)
2012-07-16 14:30

AFAIK client has zero knowledge about variables in ACS.
User avatar (0004006)
Dusk (developer)
2012-07-16 17:23
edited on: 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.

User avatar (0004008)
Torr Samaho (administrator)
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?
User avatar (0004011)
ZzZombo (reporter)
2012-07-18 02:09

+NOSKIN doesn't work. And no, I have no need for anything else.
User avatar (0004012)
Torr Samaho (administrator)
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.
User avatar (0004059)
Torr Samaho (administrator)
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.
User avatar (0004064)
ZzZombo (reporter)
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.
User avatar (0004065)
Torr Samaho (administrator)
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?
User avatar (0004069)
ZzZombo (reporter)
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.

User avatar (0004071)
Edward-san (developer)
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

User avatar (0004072)
ZzZombo (reporter)
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.
User avatar (0004074)
Torr Samaho (administrator)
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?
User avatar (0004077)
ZzZombo (reporter)
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.
User avatar (0009115)
Watermelon (developer)
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.

Issue Community Support
This issue is already marked as resolved.
If you feel that is not the case, please reopen it and explain why.
Supporters: No one explicitly supports this issue yet.
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2012-07-14 02:53 ZzZombo New Issue
2012-07-15 10:14 Dusk Note Added: 0003986
2012-07-15 10:15 Dusk Status new => feedback
2012-07-15 11:51 Torr Samaho Note Added: 0003991
2012-07-15 14:04 ZzZombo Note Added: 0003995
2012-07-15 14:04 ZzZombo Status feedback => new
2012-07-15 14:07 ZzZombo Note Edited: 0003995 View Revisions
2012-07-15 14:07 ZzZombo Note Edited: 0003995 View Revisions
2012-07-15 18:54 Torr Samaho Note Added: 0003997
2012-07-15 18:54 Torr Samaho Note Edited: 0003997 View Revisions
2012-07-15 18:55 Torr Samaho Note Revision Dropped: 3997: 0002166
2012-07-16 01:55 ZzZombo Note Added: 0003998
2012-07-16 01:57 ZzZombo Note Edited: 0003998 View Revisions
2012-07-16 04:22 ZzZombo Note Edited: 0003995 View Revisions
2012-07-16 09:48 Dusk Note Added: 0004000
2012-07-16 09:49 Dusk Note Edited: 0004000 View Revisions
2012-07-16 11:08 ZzZombo Note Added: 0004001
2012-07-16 12:26 Dusk Note Added: 0004002
2012-07-16 12:26 Dusk Note Edited: 0004002 View Revisions
2012-07-16 12:27 Dusk Note Edited: 0004002 View Revisions
2012-07-16 12:40 ZzZombo Note Added: 0004003
2012-07-16 13:51 Dusk Note Added: 0004004
2012-07-16 13:52 Dusk Status new => feedback
2012-07-16 14:30 ZzZombo Note Added: 0004005
2012-07-16 14:30 ZzZombo Status feedback => new
2012-07-16 17:23 Dusk Note Added: 0004006
2012-07-16 17:23 Dusk Note Edited: 0004006 View Revisions
2012-07-17 19:34 Torr Samaho Note Added: 0004008
2012-07-17 19:35 Torr Samaho Status new => feedback
2012-07-18 02:09 ZzZombo Note Added: 0004011
2012-07-18 02:09 ZzZombo Status feedback => new
2012-07-18 19:05 Torr Samaho Note Added: 0004012
2012-07-18 19:06 Torr Samaho Status new => feedback
2012-07-23 19:19 Torr Samaho Note Added: 0004059
2012-07-24 02:18 ZzZombo Note Added: 0004064
2012-07-24 02:18 ZzZombo Status feedback => new
2012-07-24 06:26 Torr Samaho Note Added: 0004065
2012-07-24 06:27 Torr Samaho Status new => feedback
2012-07-24 07:22 ZzZombo Note Added: 0004069
2012-07-24 07:22 ZzZombo Status feedback => new
2012-07-24 07:27 ZzZombo Note Edited: 0004069 View Revisions
2012-07-24 13:33 Edward-san Note Added: 0004071
2012-07-24 13:46 Edward-san Note Edited: 0004071 View Revisions
2012-07-24 13:48 Edward-san Note Edited: 0004071 View Revisions
2012-07-24 14:55 ZzZombo Note Added: 0004072
2012-07-24 18:15 Torr Samaho Note Added: 0004074
2012-07-24 18:16 Torr Samaho Status new => feedback
2012-07-25 01:56 ZzZombo Note Added: 0004077
2012-07-25 01:56 ZzZombo Status feedback => new
2014-06-11 21:43 Watermelon Note Added: 0009115
2014-06-11 21:43 Watermelon Status new => closed
2015-03-22 17:56 Edward-san Resolution open => invalid






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker