Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	content/messenger.lua
  • Loading branch information
brightrim committed Oct 20, 2023
2 parents 26f5c3b + 7a25b84 commit ea47052
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions content/messenger.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ function M.sendStoredMessages(recipient)
local texts = {text1, text2, text3, text4}
table.insert(contents, {text = text1, sender = signature})
spawnParchment(recipient, texts, signature, descriptionEn, descriptionDe)
else
log("Message "..i.." out of "..numberOfMessages.." player sent messages to be received by "..recipient.name.."("..recipient.id..") failed to be sent. Texts found: "..tostring(foundText1).." "..tostring(foundText2).." "..tostring(foundText3).." "..tostring(foundText4).." ".." Signature found: "..tostring(foundSignature).." Descriptions found: "..tostring(foundDescriptionEn).." "..tostring(foundDescriptionDe))
end
end
end
Expand All @@ -144,6 +146,8 @@ function M.sendStoredMessages(recipient)
if foundGermanText1 and foundGermanText2 and foundGermanText3 and foundGermanText4 and foundEnglishText1 and foundEnglishText2 and foundEnglishText3 and foundEnglishText4 then
local texts = common.GetNLS(recipient, {germanText1, germanText2, germanText3, germanText4}, {englishText1, englishText2, englishText3, englishText4})
spawnParchment(recipient, texts, "", descriptionEnglish, descriptionGerman)
else
log("Message "..i.." out of "..numberOfScriptMessages.." script sent messages to be received by "..recipient.name.."("..recipient.id..") failed to be sent. Texts found: "..tostring(foundGermanText1).." "..tostring(foundGermanText2).." "..tostring(foundGermanText3).." "..tostring(foundGermanText4)..tostring(foundEnglishText1).." "..tostring(foundEnglishText2).." "..tostring(foundEnglishText3)..tostring(foundEnglishText4))
end
end
end
Expand All @@ -152,6 +156,11 @@ function M.sendStoredMessages(recipient)
logThatMessagesWereReceived(recipient, contents)
end

if tonumber(#contents) ~= tonumber(totalMessages) then
local failed = tonumber(totalMessages) - tonumber(#contents)
log(failed.." messages meant for "..recipient.name.."("..recipient.id..")".."failed to send!")
end

ScriptVars:set(recipient.id.."storedMessages", "0")
ScriptVars:set(recipient.id.."storedScriptMessages", "0")
ScriptVars:save()
Expand Down

0 comments on commit ea47052

Please sign in to comment.