• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OTClient rule violation no work; tfs 1.5 otv8

bpm91

Intermediate OT User
Joined
May 23, 2019
Messages
928
Solutions
7
Reaction score
127
Location
Brazil
YouTube
caruniawikibr
Hey guys, I'm using otv8 and I would like to know if anyone knows how to make this thing work. it does not ban or notify. If anyone has had this problem and knows how to solve it, I would appreciate the help.
i use tfs 1.5




1670359741825.png
 
I'm looking through several old posts, and it seems to me that no one has ever solved this problem. Is this so complicated that it doesn't work on any server?
this tool would help a lot
 
did some good soul get this to work in tfs 1.5? I tried to adapt but some files do not exist in 1.5 until today trying to solve this :/
 
could anyone help? trying to understand why when banning a player with rule violations, the server crashes, but it doesn't say why. but when banning the player offline the server does not crash. otv8 i use
game.cpp

Lua:
    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);
            }
Post automatically merged:

this also holds for name_locks

Lua:
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
Post automatically merged:

to name report show this on tfs. i think same problem to banishment.
Screenshot_1.png
 
Last edited:
Typo in query, use:
SQL:
INSERT INTO `player_namelocks` (`player_id`, `reason`, `namelocked_at`, `namelocked_by`) VALUES ({:d}, {:s}, {:d}, {:d})
 
for while you could modify game_ruleviolation of otc xd

Lua:
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
g_game.talkChannel(1, 0, "!notate".. target ..", " .. comment)

 
Back
Top