39 lines
891 B
PHP
39 lines
891 B
PHP
|
<?php
|
||
|
|
||
|
use Core\Db;
|
||
|
|
||
|
class Actions
|
||
|
{
|
||
|
public static function addDungeon(
|
||
|
int $dungeonid,
|
||
|
int $userid,
|
||
|
int $x,
|
||
|
int $y,
|
||
|
string $vars = '',
|
||
|
string $vals = '',
|
||
|
): void {
|
||
|
Db::sql(
|
||
|
'insert into dungeon_actions (dn, x, y, time, uid, vars, vals) values (?,?,?,unix_timestamp(),?,?,?)',
|
||
|
[
|
||
|
$dungeonid,
|
||
|
$x,
|
||
|
$y,
|
||
|
$userid,
|
||
|
$vars,
|
||
|
$vals,
|
||
|
]
|
||
|
);
|
||
|
}
|
||
|
|
||
|
public static function countDungeon(int $dungeonid, int $userid, string $vars = ''): int
|
||
|
{
|
||
|
return Db::getValue(
|
||
|
'select count(id) from dungeon_actions where dn = ? and uid = ? and vars = ?',
|
||
|
[
|
||
|
$dungeonid,
|
||
|
$userid,
|
||
|
$vars,
|
||
|
]
|
||
|
);
|
||
|
}
|
||
|
}
|