bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 931
- Solutions
- 7
- Reaction score
- 128
- Location
- Brazil
- YouTube
- caruniawikibr
how do i enable this in compiler? GAME_FEATURE_RULEVIOLATION where should i set itAdd deprecated rule violations · rookgaard/optimized_forgottenserver@5640e43
-Add deprecated rule violation system for pre-8.7 protocols -Chat code optimization + auto-detection chaneel ids for hardcoded channelsgithub.com
in tfs 1.5 no have features.h what i do?Add deprecated rule violations · rookgaard/optimized_forgottenserver@5640e43
-Add deprecated rule violation system for pre-8.7 protocols -Chat code optimization + auto-detection chaneel ids for hardcoded channelsgithub.com
Remove all:in tfs 1.5 no have features.h what i do?
Remove all:
#if GAME_FEATURE_RULEVIOLATION > 0
#endif
uint32_t targetAccId;
if (targetPlayer) {
targetAccId = targetPlayer->getAccount();
} else {
targetAccId = IOBan::getAccountID(target);
}
if (targetAccId == 0) {
player->sendCancelMessage("A player with this name does not exist.");
return;
}
if (IOBan::isAccountBanned(targetAccId, banInfo)) {
player->sendCancelMessage(target + " is already banned.");
if (targetPlayer) {
targetPlayer->kickPlayer(true);
}
return;
}
if (targetAccId > 0) {
db.executeQuery(fmt::format("INSERT INTO `account_bans` (`account_id`, `reason`, `banned_at`, `expires_at`, `banned_by`) VALUES ({:d}, {:s}, {:d}, {:d}, {:d})", targetAccId, db.escapeString(reasonStr), timeNow, (timeNow + timeBan), player->getGUID()));
}
player->sendTextMessage(MESSAGE_EVENT_ADVANCE, target + " has been banned.");
if (targetPlayer) {
targetPlayer->kickPlayer(true);
}
if (action == 1) {
uint32_t targetPlayerGuid;
if (targetPlayer) {
targetPlayerGuid = targetPlayer->getPlayer()->getID();
} else {
targetPlayerGuid = IOBan::getPlayerID(target);
}
if (targetPlayerGuid > 0) {
db.executeQuery(fmt::format("INSERT INTO `player_namelocks` (`player_id`, `reason`, `namelocked_at, `namelocked_by`) VALUES ({:d}, {:s}, {:d}, {:d})", targetPlayerGuid, db.escapeString(reasonStr), timeNow, player->getGUID()));
}
player->sendTextMessage(MESSAGE_EVENT_ADVANCE, target + " has been namelocked.");
if (targetPlayer) {
targetPlayer->kickPlayer(true);
}
return;
}
else
function report()
local reasonLabel = reasonsTextList:getFocusedChild()
if not reasonLabel then
displayErrorBox(tr('Error'), tr('You must select a reason.'))
return
end
local actionLabel = actionsTextList:getFocusedChild()
if not actionLabel then
displayErrorBox(tr('Error'), tr('You must select an action.'))
return
end
local target = ruleViolationWindow:getChildById('nameText'):getText()
local reason = reasonLabel.reasonId
local action = actionLabel.actionId
local comment = ruleViolationWindow:getChildById('commentText'):getText()
local statement = ruleViolationWindow:getChildById('statementText'):getText()
local statementId = 0 -- TODO: message unique id ?
local ipBanishment = ruleViolationWindow:getChildById('ipBanCheckBox'):isChecked()
if action == 6 and statement == '' then
displayErrorBox(tr('Error'), tr('No statement has been selected.'))
elseif comment == '' then
displayErrorBox(tr('Error'), tr('You must enter a comment.'))
else
g_game.reportRuleViolation(target, reason, action, comment, statement, statementId, ipBanishment)
g_game.talkChannel(1, 0, "!notate".. target ..", " .. comment)
hide()
end
end