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
0002400Zandronum[All Projects] Suggestionpublic2015-08-10 17:392018-09-30 22:21
ReporterHypnotoad 
Assigned ToDusk 
PrioritynormalSeverityfeatureReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version3.0Fixed in Version3.0 
Summary0002400: Simple current date server variable that can be overwritten
DescriptionFollowing on from here:'http://zandronum.com/tracker/view.php?id=1853#c10622 [^]'

I spoke to Torr about this last night and explained how kpatch already has a simple read only DDMMYY date variable in place. I proposed that a similar variable, but that isn't read only so that hosts can override it, should be added to Zandronum. Being able to override it allows individuals to overcome any attempt by some project to lock down their mod after a certain date.

After speaking to Blzut3 who was the main opponent of being able to get the current time/date initially, he agrees that this server variable approach is okay since using getcvar is already indeterminate so it doesn't add additional determinism problems.
Attached Files

- Relationships
related to 0001853closed Ability to access time (but not date/year to prevent abuse) in ACS. 

-  Notes
User avatar (0013280)
StrikerMan780 (reporter)
2015-08-25 23:36
edited on: 2015-08-25 23:37

I really don't think anyone is so stupid as to lock down their mod by date. And if they do, their loss by cutting off their own playerbase. Chances are if someone does that, it isn't a mod worth playing anyhow.

User avatar (0013281)
Catastrophe (reporter)
2015-08-26 00:25

Yes. I have a working money system in-place for a certain mod, and it'd be nice to give automated discounts during halloween, christmas, etc.
User avatar (0013282)
Dusk (developer)
2015-08-26 01:33
edited on: 2015-08-26 02:33

Here goes..

I added 3 new ACS functions to read in system time stuff:

SystemTime() - returns a timestamp
GetTimeProperty (timestamp, which[, utc=false]) - returns a single localized property of the timestamp
Strftime (timestamp, format, [utc=false]) - returns a string representation of the date


The override mechanism takes the form of the CCMD acstime, which is an interface to the CVAR acstimestamp (so that it gets written to the ini):

acstime -- no arguments, prints override status
acstime yy-mm-dd [hh:mm] -- sets override
acstime clear -- clears override


Stuff for zspecial.acs/zdefs.acs:

special -127:SystemTime( 0 ),
    -128:GetTimeProperty( 2, 3 ),
    -129:Strftime( 2, 3 );

// The following can be used with the "which" parameter of GetTimeProperty
#define TM_SECOND 0
#define TM_MINUTE 1
#define TM_HOUR 2
#define TM_DAY 3
#define TM_MONTH 4
#define TM_YEAR 5
#define TM_WEEKDAY 6


The format parameter of strftime is naturally the format parameter of the real thing. (I'm supposing this is safe to just pass to the real strftime function unmodified.) This website seems like a pretty decent online strftime calculator.

User avatar (0013283)
WaTaKiD (updater)
2015-08-26 02:26
edited on: 2015-08-26 02:41

this build can be used to test:'https://www.dropbox.com/s/64yvcfs32pf9ih0/zandronum-3.0-r150826-0225-85291ed-windows.zip?dl=0 [^]'

User avatar (0013302)
Ivan (reporter)
2015-08-28 23:07

I used this simple test pk3 to test the features. All seem to work seamlessly offline and online.'https://www.dropbox.com/s/y21ary6qxale7ph/timetest.pk3?dl=0 [^]'
User avatar (0013336)
cobalt (updater)
2015-08-30 20:53

Issue addressed by commit cbc13f76b8f1: Added ACS date and time functions SystemTime, GetTimeProperty and Strftime and added a ccmd to override the result value of SystemTime (addresses 2400)
Committed by Teemu Piippo [Dusk] on Sunday 30 August 2015 23:43:28

Changes in files:

 docs/zandronum-history.txt | 1 +
 src/p_acs.cpp | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 0 deletions(-)

User avatar (0013423)
Dusk (developer)
2015-09-05 15:06

Was tested prior to merge

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: Hypnotoad Catastrophe Monsterovich
Opponents: No one explicitly opposes this issue yet.

- Issue History
Date Modified Username Field Change
2015-08-10 17:39 Hypnotoad New Issue
2015-08-10 17:41 Blzut3 Relationship added related to 0001853
2015-08-25 23:33 Dusk Assigned To => Dusk
2015-08-25 23:33 Dusk Status new => assigned
2015-08-25 23:36 StrikerMan780 Note Added: 0013280
2015-08-25 23:37 StrikerMan780 Note Edited: 0013280 View Revisions
2015-08-26 00:25 Catastrophe Note Added: 0013281
2015-08-26 01:33 Dusk Note Added: 0013282
2015-08-26 01:33 Dusk Status assigned => needs review
2015-08-26 01:36 Dusk Note Edited: 0013282 View Revisions
2015-08-26 02:26 WaTaKiD Note Added: 0013283
2015-08-26 02:30 Dusk Note Edited: 0013282 View Revisions
2015-08-26 02:33 Dusk Note Edited: 0013282 View Revisions
2015-08-26 02:41 WaTaKiD Note Edited: 0013283 View Revisions
2015-08-28 23:07 Ivan Note Added: 0013302
2015-08-30 20:53 cobalt Status needs review => needs testing
2015-08-30 20:53 cobalt Target Version => 3.0
2015-08-30 20:53 cobalt Description Updated View Revisions
2015-08-30 20:53 cobalt Note Added: 0013336
2015-09-05 15:06 Dusk Note Added: 0013423
2015-09-05 15:06 Dusk Status needs testing => resolved
2015-09-05 15:06 Dusk Fixed in Version => 3.0
2015-09-05 15:06 Dusk Resolution open => fixed
2018-09-30 22:21 Blzut3 Status resolved => closed






Questions or other issues? Contact Us.

Links


Copyright © 2000 - 2025 MantisBT Team
Powered by Mantis Bugtracker