mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-24 01:02:06 +00:00
* Initial Commit - Need to test this on TGS * Bump to V5 (needs testing) * CRLF --> LF * Tweaks * Latest cyberboss request * Forgot to prime TGS * Integrated TG #52572 / TGS #1087 * Fixes var(space) not being var/ * DMAPI 5.2.4 * Bump to 5.2.5
29 lines
931 B
Plaintext
29 lines
931 B
Plaintext
/datum/tgs_version/New(raw_parameter)
|
|
src.raw_parameter = raw_parameter
|
|
deprefixed_parameter = replacetext(raw_parameter, "/tg/station 13 Server v", "")
|
|
var/list/version_bits = splittext(deprefixed_parameter, ".")
|
|
|
|
suite = text2num(version_bits[1])
|
|
if(version_bits.len > 1)
|
|
minor = text2num(version_bits[2])
|
|
if(version_bits.len > 2)
|
|
patch = text2num(version_bits[3])
|
|
if(version_bits.len == 4)
|
|
deprecated_patch = text2num(version_bits[4])
|
|
|
|
/datum/tgs_version/proc/Valid(allow_wildcards = FALSE)
|
|
if(suite == null)
|
|
return FALSE
|
|
if(allow_wildcards)
|
|
return TRUE
|
|
return !Wildcard()
|
|
|
|
/datum/tgs_version/Wildcard()
|
|
return minor == null || patch == null
|
|
|
|
/datum/tgs_version/Equals(datum/tgs_version/other_version)
|
|
if(!istype(other_version))
|
|
return FALSE
|
|
|
|
return suite == other_version.suite && minor == other_version.minor && patch == other_version.patch && deprecated_patch == other_version.deprecated_patch
|