• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Linux Huge messages?....

Vrotz

Member
Joined
Apr 7, 2011
Messages
1,071
Reaction score
7
Location
Brazil
Hi,

I receive that message in my console when a player say the comand to see the frags or deathlist but didn't get the message and don't see the ranking of !frags or !deathlist name

[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message.
[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message.

How to fix?

Thanks.
 
Can you post the scripts for the !frags and !deathlist commands?

yes, brah!

function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 666, 10)) then
return false
end

if(not getBooleanFromString(getConfigValue('useFragHandler'))) then
return false
end

local time = os.time()
local times = {today = (time - 86400), week = (time - (7 * 86400))}

local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `k`.`war` = 0 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC")
if(result:getID() ~= -1) then
repeat
local content = {
name = result:getDataString("name"),
level = result:getDataInt("level"),
date = result:getDataInt("date")
}
if(content.date > times.today) then
table.insert(contents.day, content)
elseif(content.date > times.week) then
table.insert(contents.week, content)
else
table.insert(contents.month, content)
end
until not result:next()
result:free()
end

local size = {
day = table.maxn(contents.day),
week = table.maxn(contents.week),
month = table.maxn(contents.month)
}

if(getBooleanFromString(getConfigValue('advancedFragList'))) then
local result = "Frags gained today: " .. size.day .. "."
if(size.day > 0) then
for _, content in ipairs(contents.day) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end

result = result .. "\n"
end

result = result .. "\nFrags gained this week: " .. (size.day + size.week) .. "."
if(size.week > 0) then
for _, content in ipairs(contents.week) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end

result = result .. "\n"
end

result = result .. "\nFrags gained this month: " .. (size.day + size.week + size.month) .. "."
if(size.month > 0) then
for _, content in ipairs(contents.month) do
result = result .. "\n* " .. os.date("%d %B %Y %X at ", content.date) .. content.name .. " on level " .. content.level
end

result = result .. "\n"
end

local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
result = result .. "\nYour " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd)
end

doPlayerPopupFYI(cid, result)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You currently have " .. size.day .. " frags today, " .. (size.day + size.week) .. " this week and " .. (size.day + size.week + size.month) .. " this month.")
if(size.day > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Last frag at " .. os.date("%d %B %Y %X", contents.day[1].date) .. " on level " .. contents.day[1].level .. " (" .. contents.day[1].name .. ").")
end

local skullEnd = getPlayerSkullEnd(cid)
if(skullEnd > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your " .. (getCreatureSkullType(cid) == SKULL_RED and "red" or "black") .. " skull will expire at " .. os.date("%d %B %Y %X", skullEnd))
end
end

return true
end

And deathlist:

local config = {
deathAssistCount = getConfigValue('deathAssistCount') + 1,
maxDeathRecords = getConfigValue('maxDeathRecords'),
limit = ""
}
if(config.deathAssistCount > 0) then
config.limit = " LIMIT 0, " .. config.deathAssistCount
end

function onSay(cid, words, param, channel)
if(not checkExhausted(cid, 666, 10)) then
return false
end

local target = db.getResult("SELECT `name`, `id` FROM `players` WHERE `name` = " .. db.escapeString(param) .. ";")
if(target:getID() == -1) then
doPlayerSendCancel(cid, "A player with that name does not exist.")
return true
end

local targetName, targetId = target:getDataString("name"), target:getDataInt("id")
target:free()

local str, deaths = "", db.getResult("SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = " .. targetId .." ORDER BY `date` DESC LIMIT 0, " .. config.maxDeathRecords)
if(deaths:getID() ~= -1) then
repeat
local killers = db.getResult("SELECT environment_killers.name AS monster_name, players.name AS player_name FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = " .. deaths:getDataInt("id") .. " ORDER BY killers.final_hit DESC, killers.id ASC" .. config.limit)
if(killers:getID() ~= -1) then
if(str ~= "") then
str = str .. "\n" .. os.date("%d %B %Y %X ", deaths:getDataLong("date"))
else
str = os.date("%d %B %Y %X ", deaths:getDataLong("date"))
end

local count, i = killers:getRows(false), 0
repeat
local monster = killers:getDataString("monster_name")
if(i == 0 or i == (count - 1)) then
monster = string.gsub(monster:gsub("an ", ""), "a ", "")
end

if(killers:getDataString("player_name") ~= "") then
if(i == 0) then
str = str .. "Killed at level " .. deaths:getDataInt("level") .. " by:\n "
elseif(i == count) then
str = str .. " and by "
elseif(i % 4 == 0) then
str = str .. ",\n "
else
str = str .. ", "
end

if(monster ~= "") then
str = str .. monster .. " summoned by "
end

str = str .. killers:getDataString("player_name")
else
if(i == 0) then
str = str .. "Died at level " .. deaths:getDataInt("level") .. " by:\n "
elseif(i == count) then
str = str .. " and by "
elseif(i % 4 == 0) then
str = str .. ",\n "
else
str = str .. ", "
end

str = str .. monster
end

i = i + 1
if(i == count) then
str = str .. "."
end
until not(killers:next())
killers:free()
end
until not(deaths:next())
deaths:free()
else
str = "No deaths recorded."
end

doPlayerPopupFYI(cid, "Deathlist for player: " .. targetName .. ".\n\n" .. str)
return true
end
 
Use ASC/DESC LIMIT for the scripts.

protocolgame.cpp
Code:
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }
 
Use ASC/DESC LIMIT for the scripts.

protocolgame.cpp
Code:
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

Sorry? Can u explain me better bro? I need change? I dont understand.. @Ninja
 
Use ASC/DESC LIMIT for the scripts.

protocolgame.cpp
Code:
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

Sorry? Can u explain me better bro?
 
The message means that the output of your script is to long so the server is not sending it to the client so that it will not crash it. To fix this make sure that the output of that script is under 1018. Ninja posted the section of code responsible for this behavior.
 
you need to include LIMIT x in the query (assuming MySQL)
@StreamSide posted the link showing that. Please at least try to learn things yourself! The support team here are great but they cannot spoon feed you every answer or you will never learn!

Have a play with the information you have in front of you now, you should be able to trial-and-error your way to getting the result you want from here.
You will feel much more accomplished when you get it to work!

Good luck =]
 
Like any that

PHP:
void ProtocolGame::sendFYIBox(const std::string& message)
{
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0x100); < before is   msg->put<char>(0x15);
    msg->putString(message);
}
???
 
Like any that

PHP:
void ProtocolGame::sendFYIBox(const std::string& message)
{
    if(message.empty() || message.length() > 1018) //Prevent client debug when message is empty or length is > 1018 (not confirmed)
    {
        std::clog << "[Warning - ProtocolGame::sendFYIBox] Trying to send an empty or too huge message." << std::endl;
        return;
    }

    NetworkMessage_ptr msg = getOutputBuffer();
    if(!msg)
        return;

    TRACK_MESSAGE(msg);
    msg->put<char>(0x100); < before is   msg->put<char>(0x15);
    msg->putString(message);
}
???

Learn about SQL to later understand http://otland.net/threads/huge-messages.222549/#post-2141758 this answer which solves your problem.
 
Back
Top