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
d1981422
Commit
d1981422
authored
Feb 11, 2026
by
Nemo Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(admin): preserve itmpara JSON commas in resource editor
parent
7d154693
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
464 additions
and
3 deletions
+464
-3
admin.php
admin.php
+1
-0
include/admin/admin.lang.php
include/admin/admin.lang.php
+2
-0
include/admin/resourcemng.php
include/admin/resourcemng.php
+303
-0
templates/default/admin_menu.htm
templates/default/admin_menu.htm
+5
-0
templates/default/admin_resourcemng.htm
templates/default/admin_resourcemng.htm
+144
-0
valid.php
valid.php
+9
-3
No files found.
admin.php
View file @
d1981422
...
@@ -22,6 +22,7 @@ $admin_cmd_list = Array(
...
@@ -22,6 +22,7 @@ $admin_cmd_list = Array(
'roommng'
=>
5
,
'roommng'
=>
5
,
'antiAFKmng'
=>
4
,
'antiAFKmng'
=>
4
,
'templates_clean'
=>
4
,
'templates_clean'
=>
4
,
'resourcemng'
=>
7
,
);
);
if
(
!
$cuser
||!
$cpass
)
{
gexit
(
$_ERROR
[
'no_login'
],
__file__
,
__line__
);
}
if
(
!
$cuser
||!
$cpass
)
{
gexit
(
$_ERROR
[
'no_login'
],
__file__
,
__line__
);
}
...
...
include/admin/admin.lang.php
View file @
d1981422
...
@@ -257,6 +257,8 @@ $lang = array
...
@@ -257,6 +257,8 @@ $lang = array
'templates_clean_comment'
=>
'清空已生成的模板缓存文件'
,
'templates_clean_comment'
=>
'清空已生成的模板缓存文件'
,
'roommng'
=>
'临时性房间管理'
,
'roommng'
=>
'临时性房间管理'
,
'roommng_comment'
=>
'强制关闭指定编号的房间<br>不能关闭0号大房间(临时功能)'
,
'roommng_comment'
=>
'强制关闭指定编号的房间<br>不能关闭0号大房间(临时功能)'
,
'resourcemng'
=>
'游戏资源管理'
,
'resourcemng_comment'
=>
'管理地图物品/商店/开局物品与NPC配置,支持按RuleSet编辑'
,
'pcmng'
=>
'玩家数据管理'
,
'pcmng'
=>
'玩家数据管理'
,
'pcmng_comment'
=>
'修改当前局玩家的各数值,不影响帐号'
,
'pcmng_comment'
=>
'修改当前局玩家的各数值,不影响帐号'
,
...
...
include/admin/resourcemng.php
0 → 100644
View file @
d1981422
This diff is collapsed.
Click to expand it.
templates/default/admin_menu.htm
View file @
d1981422
...
@@ -91,6 +91,11 @@
...
@@ -91,6 +91,11 @@
<td>
$lang['templates_clean_comment']
</td>
<td>
$lang['templates_clean_comment']
</td>
<td>
$admin_cmd_list['templates_clean']
</td>
<td>
$admin_cmd_list['templates_clean']
</td>
</tr>
</tr>
<tr
height=
"45px"
>
<td><input
type=
"submit"
style=
"width:100;height:40;"
value=
"$lang['resourcemng']"
onclick=
"$('command').value='resourcemng'"
<!
--
{
if
$
mygroup
<
$
admin_cmd_list
['
resourcemng
']}
--
>
disabled="true"
<!--{/if}-->
>
</td>
<td>
$lang['resourcemng_comment']
</td>
<td>
$admin_cmd_list['resourcemng']
</td>
</tr>
<tr
height=
"45px"
>
<tr
height=
"45px"
>
<td><input
type=
"submit"
style=
"width:100;height:40;"
value=
"$lang['roommng']"
onclick=
"$('command').value='roommng'"
<!
--
{
if
$
mygroup
<
$
admin_cmd_list
['
roommng
']}
--
>
disabled="true"
<!--{/if}-->
>
</td>
<td><input
type=
"submit"
style=
"width:100;height:40;"
value=
"$lang['roommng']"
onclick=
"$('command').value='roommng'"
<!
--
{
if
$
mygroup
<
$
admin_cmd_list
['
roommng
']}
--
>
disabled="true"
<!--{/if}-->
>
</td>
<td>
$lang['roommng_comment']
</td>
<td>
$lang['roommng_comment']
</td>
...
...
templates/default/admin_resourcemng.htm
0 → 100644
View file @
d1981422
<form
method=
"post"
name=
"resmng"
action=
"admin.php"
enctype=
"multipart/form-data"
>
<input
type=
"hidden"
name=
"mode"
value=
"resourcemng"
>
<input
type=
"hidden"
name=
"start"
value=
"$start"
>
<input
type=
"hidden"
name=
"record_id"
id=
"record_id"
value=
"$record_id"
>
<table
class=
"admin"
cellspacing=
"1"
cellpadding=
"4"
>
<tr>
<td
colspan=
"4"
class=
"tdtitle"
>
游戏资源管理
</td>
</tr>
<tr>
<td>
资源类型
</td>
<td>
<select
name=
"res_type"
>
<option
value=
"mapitem"
<!
--
{
if
$
res_type=
='mapitem'}--
>
selected
<!--{/if}-->
>地图物品
</option>
<option
value=
"shopitem"
<!
--
{
if
$
res_type=
='shopitem'}--
>
selected
<!--{/if}-->
>商店物品
</option>
<option
value=
"stitem"
<!
--
{
if
$
res_type=
='stitem'}--
>
selected
<!--{/if}-->
>开局物品
</option>
<option
value=
"stwep"
<!
--
{
if
$
res_type=
='stwep'}--
>
selected
<!--{/if}-->
>开局武器
</option>
<option
value=
"npc"
<!
--
{
if
$
res_type=
='npc'}--
>
selected
<!--{/if}-->
>开局NPC
</option>
</select>
</td>
<td>
配置来源
</td>
<td>
<select
name=
"ruleset"
>
<!--{loop $ruleset_list $rid $rinfo}-->
<option
value=
"$rid"
<!
--
{
if
$
ruleset=
=$rid}--
>
selected
<!--{/if}-->
>$rinfo['name']
</option>
<!--{/loop}-->
</select>
<input
type=
"submit"
name=
"action"
value=
"list"
>
</td>
</tr>
<tr>
<td>
搜索
</td>
<td
colspan=
"3"
>
<input
type=
"text"
name=
"keyword"
value=
"$keyword"
style=
"width:300px;"
>
<input
type=
"submit"
name=
"action"
value=
"list"
>
<span
class=
"yellow"
>
$resultinfo
</span>
</td>
</tr>
<tr>
<td>
文件操作
</td>
<td
colspan=
"3"
>
<input
type=
"submit"
name=
"action"
value=
"download"
>
<!--{if $allow_upload}-->
<input
type=
"file"
name=
"cfgfile"
>
<input
type=
"submit"
name=
"action"
value=
"upload"
>
<!--{else}-->
<span
class=
"grey"
>
上传覆盖仅限管理员等级
>
10
</span>
<!--{/if}-->
</td>
</tr>
</table>
<br>
<!--{if $res_type!='npc'}-->
<table
class=
"admin"
cellspacing=
"1"
cellpadding=
"4"
>
<tr>
<th>
ID
</th>
<!--{loop $columns $i $c}-->
<th>
$c
</th>
<!--{/loop}-->
<th>
操作
</th>
</tr>
<!--{loop $paged_records $idx $row}-->
<tr>
<td>
$row['_idx']
</td>
<!--{loop $columns $ci $c}-->
<td>
{eval echo $row[$ci];}
</td>
<!--{/loop}-->
<td>
<button
type=
"submit"
name=
"edit_id"
value=
"$row['_idx']"
>
编辑
</button>
<button
type=
"submit"
name=
"delete_id"
value=
"$row['_idx']"
onclick=
"return confirm('确认删除该记录?');"
>
删除
</button>
</td>
</tr>
<!--{/loop}-->
</table>
<!--{else}-->
<table
class=
"admin"
cellspacing=
"1"
cellpadding=
"4"
>
<tr>
<th>
NPC类别
</th>
<th>
子键数量
</th>
<th>
操作
</th>
</tr>
<!--{loop $paged_records $idx $row}-->
<tr>
<td>
$row['_idx']
</td>
<td>
$row['_sub_count']
</td>
<td>
<button
type=
"submit"
name=
"edit_id"
value=
"$row['_idx']"
>
编辑
</button>
<button
type=
"submit"
name=
"delete_id"
value=
"$row['_idx']"
onclick=
"return confirm('确认删除该类别?');"
>
删除
</button>
</td>
</tr>
<!--{/loop}-->
</table>
<!--{/if}-->
<br>
<table
class=
"admin"
cellspacing=
"1"
cellpadding=
"4"
>
<tr>
<td
colspan=
"2"
class=
"tdtitle"
>
编辑/新增
</td>
</tr>
<!--{if $res_type!='npc'}-->
<tr>
<td>
ID
</td>
<td><input
type=
"text"
name=
"record_id"
value=
"$record_id"
></td>
</tr>
<!--{loop $columns $i $c}-->
<tr>
<td>
$c
</td>
<td><input
type=
"text"
name=
"col_$i"
style=
"width:98%;"
value=
"{$edit_record[$i]}"
></td>
</tr>
<!--{/loop}-->
<tr>
<td
colspan=
"2"
>
<button
type=
"submit"
name=
"action"
value=
"save_record"
>
保存当前ID
</button>
<button
type=
"submit"
name=
"action"
value=
"add"
>
新增记录
</button>
</td>
</tr>
<!--{else}-->
<tr>
<td>
NPC类别ID
</td>
<td><input
type=
"text"
name=
"record_id"
value=
"$record_id"
></td>
</tr>
<tr>
<td>
JSON配置
</td>
<td>
<textarea
name=
"npc_json"
style=
"width:98%;height:260px;"
>
$edit_record_json
</textarea>
</td>
</tr>
<tr>
<td
colspan=
"2"
>
<button
type=
"submit"
name=
"action"
value=
"save_record"
>
保存当前类别
</button>
<button
type=
"submit"
name=
"action"
value=
"add"
>
新增类别
</button>
</td>
</tr>
<!--{/if}-->
</table>
<div
style=
"margin-top:8px;"
>
<button
type=
"submit"
name=
"pagemode"
value=
"up"
>
上一页
</button>
<button
type=
"submit"
name=
"pagemode"
value=
"down"
>
下一页
</button>
</div>
</form>
valid.php
View file @
d1981422
...
@@ -117,7 +117,8 @@ if($mode == 'enter') {
...
@@ -117,7 +117,8 @@ if($mode == 'enter') {
$arhe
=
$arae
=
$arfe
=
$arte
=
0
;
$arhe
=
$arae
=
$arfe
=
$arte
=
0
;
$arhs
=
$aras
=
$arfs
=
$arts
=
0
;
$arhs
=
$aras
=
$arfs
=
$arts
=
0
;
for
(
$i
=
0
;
$i
<=
6
;
$i
++
){
$itm
[
$i
]
=
$itmk
[
$i
]
=
$itmsk
[
$i
]
=
''
;
$itme
[
$i
]
=
$itms
[
$i
]
=
0
;}
for
(
$i
=
0
;
$i
<=
6
;
$i
++
){
$itm
[
$i
]
=
$itmk
[
$i
]
=
$itmsk
[
$i
]
=
$itmpara
[
$i
]
=
''
;
$itme
[
$i
]
=
$itms
[
$i
]
=
0
;}
$weppara
=
''
;
$itm
[
1
]
=
'面包'
;
$itmk
[
1
]
=
'HH'
;
$itme
[
1
]
=
120
;
$itms
[
1
]
=
15
;
$itm
[
1
]
=
'面包'
;
$itmk
[
1
]
=
'HH'
;
$itme
[
1
]
=
120
;
$itms
[
1
]
=
15
;
$itm
[
2
]
=
'矿泉水'
;
$itmk
[
2
]
=
'HS'
;
$itme
[
2
]
=
140
;
$itms
[
2
]
=
15
;
$itm
[
2
]
=
'矿泉水'
;
$itmk
[
2
]
=
'HS'
;
$itme
[
2
]
=
140
;
$itms
[
2
]
=
15
;
//$itm[6] = '银白盒子'; $itmk[6] = 'p'; $itme[6] = 1; $itms[6] = 1; $itmsk[6] = 'ps';
//$itm[6] = '银白盒子'; $itmk[6] = 'p'; $itme[6] = 1; $itms[6] = 1; $itmsk[6] = 'ps';
...
@@ -139,7 +140,9 @@ if($mode == 'enter') {
...
@@ -139,7 +140,9 @@ if($mode == 'enter') {
$weplist
=
openfile
(
config
(
'stwep'
,
$gamecfg
));
$weplist
=
openfile
(
config
(
'stwep'
,
$gamecfg
));
do
{
do
{
$index
=
rand
(
1
,
count
(
$weplist
)
-
1
);
$index
=
rand
(
1
,
count
(
$weplist
)
-
1
);
list
(
$wep
,
$wepk
,
$wepe
,
$weps
,
$wepsk
)
=
explode
(
","
,
$weplist
[
$index
]);
$wline
=
rtrim
(
$weplist
[
$index
]);
$wline
=
preg_replace
(
'/,\s*$/'
,
''
,
$wline
);
list
(
$wep
,
$wepk
,
$wepe
,
$weps
,
$wepsk
,
$weppara
)
=
array_pad
(
explode
(
","
,
$wline
,
6
),
6
,
''
);
}
while
(
!
$wepk
);
}
while
(
!
$wepk
);
$stitemlist
=
openfile
(
config
(
'stitem'
,
$gamecfg
));
$stitemlist
=
openfile
(
config
(
'stitem'
,
$gamecfg
));
...
@@ -149,7 +152,9 @@ if($mode == 'enter') {
...
@@ -149,7 +152,9 @@ if($mode == 'enter') {
} while(!$itmk[3]);*/
} while(!$itmk[3]);*/
do
{
do
{
$index
=
rand
(
1
,
count
(
$stitemlist
)
-
1
);
$index
=
rand
(
1
,
count
(
$stitemlist
)
-
1
);
list
(
$itm
[
4
],
$itmk
[
4
],
$itme
[
4
],
$itms
[
4
],
$itmsk
[
4
])
=
explode
(
","
,
$stitemlist
[
$index
]);
$iline
=
rtrim
(
$stitemlist
[
$index
]);
$iline
=
preg_replace
(
'/,\s*$/'
,
''
,
$iline
);
list
(
$itm
[
4
],
$itmk
[
4
],
$itme
[
4
],
$itms
[
4
],
$itmsk
[
4
],
$itmpara
[
4
])
=
array_pad
(
explode
(
","
,
$iline
,
6
),
6
,
''
);
}
while
(
!
$itmk
[
4
]
||
(
$itmk
[
3
]
==
$itmk
[
4
]));
}
while
(
!
$itmk
[
4
]
||
(
$itmk
[
3
]
==
$itmk
[
4
]));
if
(
$name
==
'Amarillo_NMC'
)
{
if
(
$name
==
'Amarillo_NMC'
)
{
...
@@ -185,6 +190,7 @@ if($mode == 'enter') {
...
@@ -185,6 +190,7 @@ if($mode == 'enter') {
{
{
$
{
'itm'
.
$i
}
=
$value
;
$
{
'itmk'
.
$i
}
=
$itmk
[
$i
];
$
{
'itme'
.
$i
}
=
$itme
[
$i
];
$
{
'itms'
.
$i
}
=
$itms
[
$i
];
$
{
'itm'
.
$i
}
=
$value
;
$
{
'itmk'
.
$i
}
=
$itmk
[
$i
];
$
{
'itme'
.
$i
}
=
$itme
[
$i
];
$
{
'itms'
.
$i
}
=
$itms
[
$i
];
if
(
isset
(
$itmsk
[
$i
]))
$
{
'itmsk'
.
$i
}
=
$itmsk
[
$i
];
if
(
isset
(
$itmsk
[
$i
]))
$
{
'itmsk'
.
$i
}
=
$itmsk
[
$i
];
if
(
isset
(
$itmpara
[
$i
]))
$
{
'itmpara'
.
$i
}
=
$itmpara
[
$i
];
}
}
}
}
...
...
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