LadyDefile / Wordsmith-DalamudPlugin

Wordsmith is a Dalamud Plugin aiming to make roleplay easier, more convenient, and harder to accidentally "wrong chat" your post.
7 stars 3 forks source link

Random Scratchpad crashes #50

Closed Takamitai closed 10 months ago

Takamitai commented 10 months ago

{"Type":"Wordsmith.Gui.ScratchPadUI","ID":"1","Title":"","Header":"","Namespace":"","WindowName":"Wordsmith - Scratch Pad #1","IsFocused":"True","RespectCloseHotkey":"True","DisableWindowSounds":"False","OnOpenSfxId":"23","OnCloseSfxId":"24","Position":"","PositionCondition":"None","Size":"","SizeCondition":"None","SizeConstraints":"Dalamud.Interface.Windowing.Window\u002BWindowSizeConstraints","Collapsed":"","CollapsedCondition":"None","Flags":"NoScrollbar, NoScrollWithMouse, MenuBar","ForceMainWindow":"False","BgAlpha":"","ShowCloseButton":"True","AllowPinning":"True","AllowClickthrough":"True","IsOpen":"False","\u003CID\u003EkBackingField":"1","\u003CTitle\u003EkBackingField":"","_header_parse":"True","_header":"","_scratch":"| A breath of consideration and contemplation passingly absorbed the botanist as she let the\r\r\nbook rest on their table and instead neared the palm to her lips. Though a not of pity brought\r\r\non from the Keeper\u0027s proffered words wanted to break free, she would keep it contain as her\r\r\nhead merely dipped. \u0022I\u0027ll refrain from prying, should it displease you. But I do believe that\u0027s a\r\r\nworthy enough motivation as any other.\u0022 Bolstering the beam she wore upon the naturally\r\r\nstoic countenance, the pureblood\u0027s palm then raised to shift some loose ashen strands from\r\r\nher eyne. \u0022Although it is hardly anything too entertaining, you would be welcome to tag along\r\r\non one of my trips if you\u0027d feel that might contribute to that goal.\u0022\n\u0022In place of my usual trade, I\u0027ve taken to aiding a group of Garlean refugees within the city\r\r\nthat seek to make a new life for themselves among the other fair folk of Radz-at-Han. While\r\r\nthe volunteer tasks I do for them don\u0027t pay in gil, they do offer a sense of positive fulfillment\r\r\nall their own right.\u0022 Nodding firmly, she fell her gaze to her cup and lifted for another slow,\r\r\nsteady sip. \n\u0022... Mm.. Mayhaps it can be something to provide that enrichment you seek?\u0022","_useOOC":"False","_chunks":"{ \u0022Wordsmith.TextChunk, \u0022Wordsmith.TextChunk, \u0022Wordsmith.TextChunk, \u0022Wordsmith.TextChunk\u0022 }","_nextChunk":"3","_canUndo":"False","_textchanged":"False","_ignoreTextEdit":"False","_invalidateChunks":"False","_replaceText":"Mm..Mayhaps","_text_history":"{ \u0022{ ChatType: None, ScratchText: \u0022| The idle hours of the midafternoon had left the usually busy Shahani all but desolate as the\r\r\ndistant echoes of the city were nigh the only thing filling the varicolored halls with life.\r\r\nNearly. Situated within the quieter wings of the house, Marcella relished in this solitude with a\r\r\nteacup in one hand and a tome in the other. The sound of careful sips, alongside the\r\r\nresplendent chime of porcelain as she lifted and settled the cup had been about all there was\r\r\nwithin the tearoom to fill the space between each of her pages turns. In setting down the\r\r\nlemon scented beverage with a content hum, the peppered haired woman\u0027s usually weary\r\r\neyes howbeit absconded the confines of the paper world; travelling instead to one of the\r\r\nmany slated windows as though attention were tugged by an invisible string. Although the\r\r\novercast skies spoke of gloom, there was something refreshing too about the promise of rain\r\r\nwhich lingered in the air...\u0022, UseOOC: False, TellTarget: \u0022\u0022, CrossWorld: False, Linkshell: 0 }, \u0022{ ChatType: None, ScratchText: \u0022| Upon the subtle shift of the well cared for doors, the Garlean\u0027s once distant gaze swung back\r\r\ntoward the arrival and mirrored her surprise. \u0022I could well say the same. Many within our\r\r\ncompany seem quite busy in spite of the partial purpose for rest and reprieve this trip was to\r\r\nbe.\u0022 Airing out the words with a soft snicker, Marcella\u0027s lips danced to a familiarly polite\r\r\nsimper.\n\u0022Not that I\u0027m not. But greetings in turn; would you care for a seat?\u0022 She lifted a hand to\r\r\nmotion to one of the empty spaces around the table. \u0022Tis only the second time I\u0027ve been able\r\r\nto espy you since our initial meet that we weren\u0027t otherwise occupied, I believe.\u0022\u0022, UseOOC: False, TellTarget: \u0022\u0022, CrossWorld: False, Linkshell: 0 }, \u0022{ ChatType: None, ScratchText: \u0022| Following the trail of the unequipped weapon as Serris situated herself, Marcella took the\r\r\nopportunity to properly scrutinize over its form with a faint cant of her peppered head. Twas a\r\r\nblessed thing, to be sure - radiant and sublime in ways of its design. Afore her curiosity could\r\r\nburrow deeper into it howbeit, the comment on her attire summoned all that attention to its\r\r\nsource with a twitch of her brows. \n\u0022That I am, make no mistake.\u0022 The woman\u0027s simper lifted once more with a degree of\r\r\nsheepishness. \u0022While I still opted to carry that equipment here with me on the off chance I\r\r\nmay need to earn some gil, I decided that perhaps my trade should take a second seat to the\r\r\nopportunities otherwise present within this new land.\u0022 \nOn that note she lifted book a little to unveil its cover. Upon it there were two figures, one\r\r\nbestial with the mask of a man and the other just the opposite. \u0022One of them being\r\r\neducation. While I\u0027ve heard of Thavnair\u0027s reputation in the past, only since coming here have I\r\r\nbegun to properly educate myself on the finer points of its culture and traditions. While one\r\r\nmight say my new look was an attempt to embrace them...\u0022\n\u0022... The truth is that I simply felt it would perhaps be wise to dress in something better suited\r\r\nto the climate. My present repertoire faires better to more temperate and colder regions of\r\r\nthe star.\u0022 There was a speck of sheepishness behind those words, but quickly enough did it\r\r\nvanish behind a breath of ease. \u0022What of yourself? Have you had any particular plans for the\r\r\nduration of your stay with the company?\u0022\u0022, UseOOC: False, TellTarget: \u0022\u0022, CrossWorld: False, Linkshell: 0 }\u0022 }","_statisticsTracker":"Wordsmith.Helpers.StatisticsTracker","_stats_order_by":"usesdescending","_corrections":"{ \u0022\u0022 }","_rest_time":"-0.00022495072","_do_spell_check":"False","_hideOnly":"False","_lastWidth":"557","_lastScale":"1","_view_mode":"0","_nextID":"2","CORRECTIONS_FOUND":"-1","CHECKING_SPELLING":"1","CORRECTIONS_NOT_FOUND":"2","EDITING_TEXT":"0","VIEW_MODE_PAD":"0","VIEW_MODE_HISTORY":"1","VIEW_MODE_STATS":"2","Exception":{"Error":"System.ArgumentOutOfRangeException: Length cannot be less than zero. (Parameter \u0027length\u0027)\r\n at System.String.ThrowSubstringArgumentOutOfRange(Int32 startIndex, Int32 length)\r\n at System.String.Substring(Int32 startIndex, Int32 length)\r\n at Wordsmith.Helpers.StatisticsTracker.TallyWord(String line, Word word) in /work/repo/Wordsmith/Helpers/StatisticsTracker.cs:line 19\r\n at Wordsmith.Helpers.StatisticsTracker.TallyWords(String line, IEnumerable\u00601 words) in /work/repo/Wordsmith/Helpers/StatisticsTracker.cs:line 29\r\n at Wordsmith.Gui.ScratchPadUI.DoCopyToClipboard() in /work/repo/Wordsmith/Gui/ScratchPadUI.cs:line 1204","Message":"Length cannot be less than zero. (Parameter \u0027length\u0027)"},"Window":"ScratchPadUI #1"}

LadyDefile commented 10 months ago

Thank you. It looks like the problem is in the new statistics tracking section. For now, go into the settings and turn off the setting to track word usage. I'll look into an actual fix for this as soon as I'm able.

Takamitai commented 10 months ago

You're welcome! I'm glad I could help out as the plugin is by now a lifesaver to me when it comes to RP and feel happy to be able to keep it running right!

On Sat, 4 Nov 2023 at 03:23, LadyDefile @.***> wrote:

Thank you. It looks like the problem is in the new statistics tracking section. For now, go into the settings and turn off the setting to track word usage. I'll look into an actual fix for this as soon as I'm able.

— Reply to this email directly, view it on GitHub https://github.com/LadyDefile/Wordsmith-DalamudPlugin/issues/50#issuecomment-1793285555, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATJDHQHKP5T3YSV6VMRRXITYCWKIRAVCNFSM6AAAAAA65B3TTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJTGI4DKNJVGU . You are receiving this because you authored the thread.Message ID: @.***>

LadyDefile commented 10 months ago

I was able to identify the problem already! So the issue is with "zero length words". The part of your text that was causing the crash was the "... Mm.." because the "..." counted as a "word object" but had no actual word in it so when attempting to tally what word you used it would cause an error. I've patched this and it will be live as soon as I can get the update packaged up and pushed out.