Куча мелочей, в том числе по #42.
This commit is contained in:
@@ -15,72 +15,72 @@ class Moderation
|
||||
GameLogs::addUserLog($userId, $message, "moderation");
|
||||
}
|
||||
|
||||
public static function muteChat(int $target, int $time): bool
|
||||
public static function muteChat(int $target, int $time)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[2]);
|
||||
return User::setUserEffect($target, 2, UserEffects::$effectName[2], $time);
|
||||
User::addUserEffect($target, 2, UserEffects::$effectName[2], $time);
|
||||
}
|
||||
|
||||
public static function unmuteChat(int $target): bool
|
||||
public static function unmuteChat(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[2] . self::STATUS_OFF);
|
||||
return User::removeUserEffect($target, 2);
|
||||
User::removeUserEffect($target, 2);
|
||||
}
|
||||
|
||||
public static function muteForum(int $target, int $time): bool
|
||||
public static function muteForum(int $target, int $time)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[3]);
|
||||
return User::setUserEffect($target, 3, UserEffects::$effectName[3], $time);
|
||||
User::addUserEffect($target, 3, UserEffects::$effectName[3], $time);
|
||||
}
|
||||
|
||||
public static function unmuteForum(int $target): bool
|
||||
public static function unmuteForum(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[3] . self::STATUS_OFF);
|
||||
return User::removeUserEffect($target, 3);
|
||||
User::removeUserEffect($target, 3);
|
||||
}
|
||||
|
||||
public static function hideUserInfo(int $target, int $time): bool
|
||||
public static function hideUserInfo(int $target, int $time)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[5]);
|
||||
return User::setUserEffect($target, 5, UserEffects::$effectName[5], $time);
|
||||
User::addUserEffect($target, 5, UserEffects::$effectName[5], $time);
|
||||
}
|
||||
|
||||
public static function unHideUserInfo(int $target): bool
|
||||
public static function unHideUserInfo(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[5] . self::STATUS_OFF);
|
||||
return User::removeUserEffect($target, 5);
|
||||
User::removeUserEffect($target, 5);
|
||||
}
|
||||
|
||||
public static function blockUser(int $target): void
|
||||
public static function blockUser(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, "Блокировка");
|
||||
DBPDO::INIT()->execute('UPDATE battles.users SET block = 1 WHERE id = ?', $target);
|
||||
}
|
||||
|
||||
public static function unBlockUser(int $target): void
|
||||
public static function unBlockUser(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, "Блокировка" . self::STATUS_OFF);
|
||||
DBPDO::INIT()->execute('UPDATE battles.users SET block = 0 WHERE block = 1 AND id = ?', $target);
|
||||
}
|
||||
|
||||
public static function addToUserLog(int $target, string $message, int $senderId): void
|
||||
public static function addToUserLog(int $target, string $message, int $senderId)
|
||||
{
|
||||
GameLogs::addUserLog($target, $message, "moderation", $senderId);
|
||||
}
|
||||
|
||||
public static function setAlign(int $target, int $align): void
|
||||
public static function setAlign(int $target, int $align)
|
||||
{
|
||||
DBPDO::INIT()->execute('UPDATE users SET align = ? WHERE id = ?', [$align, $target]);
|
||||
}
|
||||
|
||||
public static function addChatSysMsg(string $message): void
|
||||
public static function addChatSysMsg(string $message)
|
||||
{
|
||||
DBPDO::INIT()->execute('INSERT INTO chat (user_id,msg,type) VALUES (-1,?,?)', [$message, 'sys']);
|
||||
}
|
||||
|
||||
public static function addUserCheck(int $target): bool
|
||||
public static function addUserCheck(int $target)
|
||||
{
|
||||
self::addEffectStatusToUserLog($target, UserEffects::$effectName[20]);
|
||||
return User::setUserEffect($target, 20, UserEffects::$effectName[20], strtotime('3days'));
|
||||
User::addUserEffect($target, 20, UserEffects::$effectName[20], strtotime('3days'));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user