MCPcopy Create free account
hub / github.com/crossuo/crossuo / ParseVersion

Function ParseVersion

src/Config.cpp:100–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98static config::Modified s_Mark;
99
100static uint32_t ParseVersion(const char *versionStr)
101{
102 if (!versionStr || !versionStr[0])
103 {
104 return CV_LATEST;
105 }
106
107 int a = 0, b = 0, c = 0, d = 0;
108 char extra[16]{};
109 char tok = 0;
110 sscanf(versionStr, "%d.%d.%d%s", &a, &b, &c, extra);
111
112 if (strlen(extra))
113 {
114 tok = extra[0];
115 if (tok == '.')
116 {
117 sscanf(extra, ".%d", &d);
118 }
119 else if (tok >= 'a' && tok <= 'z')
120 {
121 d = tok;
122 }
123 }
124
125 return VERSION(a, b, c, d);
126}
127
128static CLIENT_FLAG GetClientTypeFromString(const astr_t &str)
129{

Callers 1

ClientVersionFixupFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected