Fixing Weird client crash when [props on pre-filled book.

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,546
123
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
Operating System
Winsows 10
ServUO Version
Newest
Tested on a fresh copy of ServUO.

Added in Kabur's Journal - (a pre filled book) and everytime I [props on it the client crashes and closes.

Tried on both razor and steam.
 

Djeryv

Well-Known Member
Oct 2, 2014
387
65
I usually run into this when there is a value on an item that goes beyond what it is meant to show in the props gump. For example, I have a book on my server that stores an entire paragraph in a string and the book displays all of this text just fine...but my client will crash if I try to props that book.
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,265
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
Try this from the Client:

[get Author
[get Title
[get PagesCount
[get BookString

It's possible the [get command will return the string but the [props gump will not display it.

If it still crashes on the BookString, then I would suspect a bad character in it somewhere.

Or, does it do this on All pre-filled books?
 

Tasanar

Moderator
ServUO Developer
Oct 16, 2014
4,546
123
32
trueuo.com
Shard Name
Heritage
Donate
Donate money to this user
All pre-filled books my friend.

That is interesting @Djeryv I can not believe I never [props pre-filled books before.
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,265
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
Line 115 of BaseBook.cs, remove this:

C#:
[CommandProperty(AccessLevel.GameMaster)]
I am guessing the [props gump has something like a 255 character limit on strings.
 

Falkor

Well-Known Member
Apr 11, 2018
116
30
wpshard.com
Shard Name
Whispering Pines
Just another data point for you -- it does not happen with my ServUO code from about a year ago (roughly 4/10/2018). I can props that or any other book without issue.

Client 7.0.75.35
 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,265
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
Just another data point for you -- it does not happen with my ServUO code from about a year ago (roughly 4/10/2018). I can props that or any other book without issue.

Client 7.0.75.35
You are correct. I can see the change was made about a month ago to add that property.

 

Lokai

Moderator
ServUO Developer
Dec 4, 2014
1,265
211
Western New York State
Shard Name
Test Center
Donate
Donate money to this user
It's this property, or the method it calls (BuildBookFromString), when [props tries to display the string:

C#:
        [CommandProperty(AccessLevel.GameMaster)]
        public string BookString
        {
            get { return ContentAsString; }
            set { BuildBookFromString(value); }
        }
 

Dexter_Lexia

Moderator
ServUO Developer
Jul 3, 2014
3,935
169
43
Shard Name
Alexandria
Donate
Donate money to this user
ahh ok, got it. Yea I'll remove the command property, there is no need to access this property, or call it unless its explicitly used.