Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
d269b445
Commit
d269b445
authored
Apr 02, 2023
by
hisuinohoshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update roomcheck
变化: - (临时)使用当前游戏自检功能,可以在房间内人数出现错误时重新统计房间内人数,并关闭无人房间;
parent
bfd17530
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
20 deletions
+28
-20
include/admin/gamecheck.php
include/admin/gamecheck.php
+21
-15
index.php
index.php
+7
-5
No files found.
include/admin/gamecheck.php
View file @
d269b445
...
@@ -22,24 +22,30 @@ if($gamestate >= 20){
...
@@ -22,24 +22,30 @@ if($gamestate >= 20){
adminlog
(
'infomng'
);
adminlog
(
'infomng'
);
$cmd_info
=
"状态更新:激活人数
{
$validnum
}
,生存人数
{
$alivenum
}
,死亡人数
{
$deathnum
}
<br>"
;
$cmd_info
=
"状态更新:激活人数
{
$validnum
}
,生存人数
{
$alivenum
}
,死亡人数
{
$deathnum
}
<br>"
;
$cmd_info
.=
"已重置移动地点缓存数据"
;
$cmd_info
.=
"已重置移动地点缓存数据
<br>
"
;
}
else
{
}
else
{
$cmd_info
=
"当前游戏未开始!"
;
$cmd_info
=
"当前游戏未开始!
<br>
"
;
}
}
//$db->query("ALTER TABLE {$gtablepre}winners ADD itmsk6 char(5) not null default '' AFTER itmsk5");
# 暂时把房间人数自检放在这里
//$db->query("ALTER TABLE {$gtablepre}winners ADD itms6 char(5) not null default '0' AFTER itmsk5");
if
(
!
empty
(
$roomlist
))
//$db->query("ALTER TABLE {$gtablepre}winners ADD itme6 mediumint unsigned NOT NULL default '0' AFTER itmsk5");
{
//$db->query("ALTER TABLE {$gtablepre}winners ADD itmk6 char(5) not null default '' AFTER itmsk5");
foreach
(
$roomlist
as
$rkey
=>
$rinfo
)
//$db->query("ALTER TABLE {$gtablepre}winners ADD itm6 CHAR( 30 ) NOT NULL default '' AFTER itmsk5");
{
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme0 itme0 mediumint unsigned NOT NULL default '0'");
$result
=
$db
->
query
(
"SELECT uid FROM
{
$gtablepre
}
users WHERE roomid =
{
$rkey
}
"
);
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme1 itme1 mediumint unsigned NOT NULL default '0'");
if
(
$db
->
num_rows
(
$result
))
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme2 itme2 mediumint unsigned NOT NULL default '0'");
{
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme3 itme3 mediumint unsigned NOT NULL default '0'");
$join_nums
=
$db
->
num_rows
(
$result
);
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme4 itme4 mediumint unsigned NOT NULL default '0'");
$db
->
query
(
"UPDATE
{
$gtablepre
}
game SET groomnums =
{
$join_nums
}
WHERE groomid =
{
$rkey
}
"
);
//$db->query("ALTER TABLE {$gtablepre}winners CHANGE itme5 itme5 mediumint unsigned NOT NULL default '0'");
$cmd_info
.=
"房间
{
$rkey
}
状态更新:房间内人数
{
$join_nums
}
<br>"
;
//$db->query("ALTER TABLE {$gtablepre}users ADD validgames smallint unsigned NOT NULL default '0' AFTER credits");
}
//$db->query("ALTER TABLE {$gtablepre}users ADD wingames smallint unsigned NOT NULL default '0' AFTER validgames");
else
{
$db
->
query
(
"DELETE FROM
{
$gtablepre
}
game WHERE groomid =
{
$rkey
}
"
);
$cmd_info
.=
"房间
{
$rkey
}
无人参与:已关闭<br>"
;
}
}
}
include
template
(
'admin_menu'
);
include
template
(
'admin_menu'
);
...
...
index.php
View file @
d269b445
...
@@ -39,7 +39,8 @@ if(!empty($roomact))
...
@@ -39,7 +39,8 @@ if(!empty($roomact))
$result
=
$db
->
query
(
"SELECT groomnums FROM
{
$gtablepre
}
game WHERE groomid =
{
$join_id
}
"
);
$result
=
$db
->
query
(
"SELECT groomnums FROM
{
$gtablepre
}
game WHERE groomid =
{
$join_id
}
"
);
if
(
$db
->
num_rows
(
$result
))
if
(
$db
->
num_rows
(
$result
))
{
{
$join_nums
=
$db
->
fetch_array
(
$result
)[
0
]
+
1
;
$join_nums
=
$db
->
result
(
$result
,
0
);
$join_nums
++
;
$db
->
query
(
"UPDATE
{
$gtablepre
}
game SET groomnums =
{
$join_nums
}
WHERE groomid =
{
$join_id
}
"
);
$db
->
query
(
"UPDATE
{
$gtablepre
}
game SET groomnums =
{
$join_nums
}
WHERE groomid =
{
$join_id
}
"
);
}
}
}
}
...
@@ -47,19 +48,20 @@ if(!empty($roomact))
...
@@ -47,19 +48,20 @@ if(!empty($roomact))
{
{
gexit
(
'要加入的房间不存在!'
,
__file__
,
__line__
);
gexit
(
'要加入的房间不存在!'
,
__file__
,
__line__
);
}
}
unset
(
$roomact
);
}
}
if
(
$roomact
==
'exit'
)
else
if
(
$roomact
==
'exit'
)
{
{
if
(
empty
(
$udata
[
'roomid'
]))
gexit
(
'你没有在任何房间里!'
,
__file__
,
__line__
);
if
(
empty
(
$udata
[
'roomid'
]))
gexit
(
'你没有在任何房间里!'
,
__file__
,
__line__
);
$result
=
$db
->
query
(
"SELECT groomnums FROM
{
$gtablepre
}
game WHERE groomid =
{
$udata
[
'roomid'
]
}
"
);
$result
=
$db
->
query
(
"SELECT groomnums FROM
{
$gtablepre
}
game WHERE groomid =
{
$udata
[
'roomid'
]
}
"
);
if
(
$db
->
num_rows
(
$result
))
if
(
$db
->
num_rows
(
$result
))
{
{
$join_nums
=
$db
->
fetch_array
(
$result
)[
0
]
-
1
;
$join_nums
=
$db
->
result
(
$result
,
0
);
$join_nums
--
;
$db
->
query
(
"UPDATE
{
$gtablepre
}
game SET groomnums =
{
$join_nums
}
WHERE groomid =
{
$udata
[
'roomid'
]
}
"
);
$db
->
query
(
"UPDATE
{
$gtablepre
}
game SET groomnums =
{
$join_nums
}
WHERE groomid =
{
$udata
[
'roomid'
]
}
"
);
}
}
$db
->
query
(
"UPDATE
{
$gtablepre
}
users SET roomid = 0 WHERE username='
$cuser
'"
);
$db
->
query
(
"UPDATE
{
$gtablepre
}
users SET roomid = 0 WHERE username='
$cuser
'"
);
unset
(
$roomact
);
}
}
}
}
else
else
...
...
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