Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SRB2-Query
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Golden
SRB2-Query
Compare revisions
master to 0d23d60b0fb767d29e21c24493e4cda403f7e2bc
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
Golden/SRB2-Query
Select target project
No results found
0d23d60b0fb767d29e21c24493e4cda403f7e2bc
Select Git revision
Branches
master
update-to-2.2.1
2 results
Swap
Target
james/SRB2-Query
Select target project
james/SRB2-Query
Golden/SRB2-Query
2 results
master
Select Git revision
Branches
master
1 result
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
Update packet format to SRB2 2.2.1's, remove redundant code, and intval the major version number.
· 0d23d60b
Golden
authored
4 years ago
0d23d60b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
srb2query.php
+12
-52
12 additions, 52 deletions
srb2query.php
with
12 additions
and
52 deletions
srb2query.php
View file @
0d23d60b
...
@@ -182,15 +182,6 @@ class SRB2Query
...
@@ -182,15 +182,6 @@ class SRB2Query
private
const
TICRATE
=
35
;
private
const
TICRATE
=
35
;
// doomstat.h
// doomstat.h
private
const
GT_COOP
=
0
;
private
const
GT_COMPETITION
=
1
;
private
const
GT_RACE
=
2
;
private
const
GT_MATCH
=
3
;
private
const
GT_TEAMMATCH
=
4
;
private
const
GT_TAG
=
5
;
private
const
GT_HIDEANDSEEK
=
6
;
private
const
GT_CTF
=
7
;
private
const
GF_REDFLAG
=
1
;
private
const
GF_REDFLAG
=
1
;
private
const
GF_BLUEFLAG
=
2
;
private
const
GF_BLUEFLAG
=
2
;
...
@@ -214,16 +205,19 @@ class SRB2Query
...
@@ -214,16 +205,19 @@ class SRB2Query
private
const
pkformats
=
[
private
const
pkformats
=
[
self
::
PT_SERVERINFO
=>
[
self
::
PT_SERVERINFO
=>
[
'format'
=>
'format'
=>
'C_255/'
.
'Cpacketversion/'
.
'a16application/'
.
'Cversion/'
.
'Cversion/'
.
'Csubversion/'
.
'Csubversion/'
.
'Cnumberofplayer/'
.
'Cnumberofplayer/'
.
'Cmaxplayer/'
.
'Cmaxplayer/'
.
'Cgametype/'
.
'Crefusereason/'
.
'a24gametypename/'
.
'Cmodifiedgame/'
.
'Cmodifiedgame/'
.
'Ccheatsenabled/'
.
'Ccheatsenabled/'
.
'Cisdedicated/'
.
'Cisdedicated/'
.
'Cfileneedednum/'
.
'Cfileneedednum/'
.
'cadminplayer/'
.
'Vtime/'
.
'Vtime/'
.
'Vleveltime/'
.
'Vleveltime/'
.
'a32servername/'
.
'a32servername/'
.
...
@@ -235,12 +229,14 @@ class SRB2Query
...
@@ -235,12 +229,14 @@ class SRB2Query
'a*fileneeded'
,
'a*fileneeded'
,
'strings'
=>
[
'strings'
=>
[
'application'
,
'gametypename'
,
'servername'
,
'servername'
,
'mapname'
,
'mapname'
,
'maptitle'
,
'maptitle'
,
],
],
'minimum'
=>
1
09
,
'minimum'
=>
1
51
,
],
],
self
::
PT_PLAYERINFO
=>
[
self
::
PT_PLAYERINFO
=>
[
'format'
=>
'format'
=>
...
@@ -286,43 +282,6 @@ class SRB2Query
...
@@ -286,43 +282,6 @@ class SRB2Query
private
$fileneedednum
;
private
$fileneedednum
;
private
$fileneeded
;
private
$fileneeded
;
private
function
Versionname
(
$pk
)
{
switch
(
$pk
[
'version'
])
{
case
100
:
case
110
:
return
'SRB2Kart'
;
default
:
return
'SRB2'
;
}
}
private
function
Gametype
(
$pk
)
{
// SRB2Kart
if
(
$pk
[
'version'
]
==
100
||
$pk
[
'version'
]
==
110
)
{
$kartnames
=
[
self
::
GT_COMPETITION
=>
'Battle'
,
];
if
(
isset
(
$kartnames
[
$pk
[
'gametype'
]]))
return
$kartnames
[
$pk
[
'gametype'
]];
}
$names
=
[
self
::
GT_COOP
=>
'Co-op'
,
self
::
GT_COMPETITION
=>
'Competition'
,
self
::
GT_RACE
=>
'Race'
,
self
::
GT_MATCH
=>
'Match'
,
self
::
GT_TEAMMATCH
=>
'Team Match'
,
self
::
GT_TAG
=>
'Tag'
,
self
::
GT_HIDEANDSEEK
=>
'Hide and Seek'
,
self
::
GT_CTF
=>
'CTF'
,
];
$name
=
$names
[
$pk
[
'gametype'
]];
return
(
(
$name
)
?
$name
:
'Unknown'
);
}
private
function
Zonetitle
(
$pk
)
private
function
Zonetitle
(
$pk
)
{
{
$maptitle
=
$pk
[
'maptitle'
];
$maptitle
=
$pk
[
'maptitle'
];
...
@@ -545,11 +504,11 @@ class SRB2Query
...
@@ -545,11 +504,11 @@ class SRB2Query
}
}
$t
[
'version'
]
=
[
$t
[
'version'
]
=
[
'major'
=>
$version
/
100
,
'major'
=>
intval
(
$version
/
100
)
,
'minor'
=>
$version
%
100
,
'minor'
=>
$version
%
100
,
'patch'
=>
$subversion
,
'patch'
=>
$subversion
,
];
];
$t
[
'version'
][
'name'
]
=
self
::
Versionname
(
$pk
)
;
$t
[
'version'
][
'name'
]
=
$pk
[
'application'
]
;
$t
[
'servername'
]
=
$pk
[
'servername'
];
$t
[
'servername'
]
=
$pk
[
'servername'
];
...
@@ -558,7 +517,7 @@ class SRB2Query
...
@@ -558,7 +517,7 @@ class SRB2Query
'max'
=>
$pk
[
'maxplayer'
],
'max'
=>
$pk
[
'maxplayer'
],
];
];
$t
[
'gametype'
]
=
self
::
G
ametype
(
$pk
)
;
$t
[
'gametype'
]
=
$pk
[
'g
ametype
name'
]
;
copy_bool
(
$t
[
'mods'
],
$pk
[
'modifiedgame'
]);
copy_bool
(
$t
[
'mods'
],
$pk
[
'modifiedgame'
]);
copy_bool
(
$t
[
'cheats'
],
$pk
[
'cheatsenabled'
]);
copy_bool
(
$t
[
'cheats'
],
$pk
[
'cheatsenabled'
]);
...
@@ -609,6 +568,7 @@ class SRB2Query
...
@@ -609,6 +568,7 @@ class SRB2Query
function
Fileinfo
()
:
array
function
Fileinfo
()
:
array
{
{
self
::
Unfileneeded
(
$fileinfo
,
$this
->
fileneedednum
,
$this
->
fileneeded
);
self
::
Unfileneeded
(
$fileinfo
,
$this
->
fileneedednum
,
$this
->
fileneeded
);
if
(
$this
->
lotsofaddons
)
if
(
$this
->
lotsofaddons
)
{
{
$start
=
$this
->
fileneedednum
;
$start
=
$this
->
fileneedednum
;
...
...
This diff is collapsed.
Click to expand it.