Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
G
gameauth
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
sucssite
gameauth
Commits
91a0b248
Commit
91a0b248
authored
Oct 08, 2015
by
Stuart John Watson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index's populate now correctlly respects domaining[C
parent
f589d60d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
40 deletions
+28
-40
controll.php
controll.php
+6
-1
games/_manager.php
games/_manager.php
+6
-4
games/sauerbraten.html
games/sauerbraten.html
+6
-2
index.php
index.php
+10
-33
No files found.
controll.php
View file @
91a0b248
...
...
@@ -179,6 +179,11 @@ if ($accessLevel == "GAME_ACCESS" || ($accessLevel == "AS_BEFORE" && $oldLevel =
}
}
//Get other payload data
chdir
(
"games"
);
include
"_manager.php"
;
$services
=
getGameStatus
();
header
(
'Content-Type: application/json'
);
//Echo response
echo
json_encode
([
...
...
@@ -187,7 +192,7 @@ echo json_encode([
username
=>
$authdUser
,
extraPayload
=>
[
onlineUsers
=>
$onlineUsers
,
services
=>
[]
services
=>
$services
]
]);
...
...
games/_manager.php
View file @
91a0b248
...
...
@@ -4,7 +4,7 @@
"sauerbraten"
];
function
getGameStatus
(
$
includeTemplate
){
function
getGameStatus
(
$
templateHeader
=
FALSE
,
$templateFooter
=
FALSE
){
global
$GAMES_TO_INCLUDE
;
$gameInfo
=
[];
...
...
@@ -12,12 +12,14 @@
include
"
$game
.php"
;
$a
=
"
$game
\\
getInfo"
;
$gameInfo
[
$game
]
=
$a
();
if
(
$includeTemplate
){
if
(
$templateHeader
!==
FALSE
){
echo
$templateHeader
;
echo
"<div data-target=
\"
$game
\"
>"
;
echo
file_get_contents
(
"
$game
.html"
);
echo
"</div>"
;
echo
$templateFooter
;
}
}
return
$gameInfo
;
}
var_dump
(
getGameStatus
(
1
));
?>
games/sauerbraten.html
View file @
91a0b248
...
...
@@ -5,9 +5,13 @@
<dd>
<span
data-target=
"players_on"
></span>
/
<span
data-target=
"players_max"
></span>
</dd>
<dt>
Version
:
</dt>
<dt>
Game Mode
:
</dt>
<dd>
<span
data-target=
"version"
></span>
<span
data-target=
"gameMode"
></span>
</dd>
<dt>
Map:
</dt>
<dd>
<span
data-target=
"map"
></span>
</dd>
</dl>
...
...
index.php
View file @
91a0b248
...
...
@@ -88,38 +88,15 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-md-4"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<?php
chdir
(
'games'
);
include
'_manager.php'
;
getGameStatus
(
1
);
?>
</div>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<h2>
OpenTTD -
<font
color=
"green"
>
Online
</font></h2>
<p>
</p>
</div>
</div>
</div>
<div
class=
"col-md-4"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<h2>
Cube 2: Sauerbraten -
<font
color=
"green"
>
Online
</font></h2>
<p>
</p>
</div>
</div>
</div>
<div
class=
"row"
data-target=
"services"
>
<?php
chdir
(
'games'
);
include
'_manager.php'
;
getGameStatus
(
'<div class="col-md-4"><div class="panel panel-default"><div class="panel-body">'
,
'</div></div></div>'
);
?>
</div>
</div>
<footer>
...
...
@@ -158,7 +135,7 @@
domain
=
$
(
"
body
"
)
}
$
.
each
(
data
,
function
(
key
,
value
){
var
target
=
$
(
"
body
"
)
.
find
(
"
[data-target='
"
+
key
+
"
']
"
);
var
target
=
domain
.
find
(
"
[data-target='
"
+
key
+
"
']
"
);
if
(
target
.
length
==
0
){
console
.
warn
(
"
failed to find target
"
,
key
,
"
under
"
,
domain
);
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment