Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to limit custom prof text to 15 char #43

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 6 comments
Open

Need to limit custom prof text to 15 char #43

GoogleCodeExporter opened this issue Mar 14, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

Custom profession tags are truncated in the game at 15 characters but DT 
allows longer.
This disconnects the custom professions from the loaded professions in the 
game.

Original issue reported on code.google.com by khermann@gmail.com on 23 Jul 2009 at 6:19

@GoogleCodeExporter
Copy link
Author

Original comment by treyst...@gmail.com on 25 Jul 2009 at 12:05

  • Changed state: Accepted
  • Added labels: Milestone-Eventually

@GoogleCodeExporter
Copy link
Author

This isn't a bug. The game allows arbitrarily long profession names and 
nicknames.

Original comment by treyst...@gmail.com on 2 Aug 2009 at 8:57

  • Changed state: Invalid

@GoogleCodeExporter
Copy link
Author

This is actually a bug. Kind of a nasty one at that. If custom professions 
longer than 
15 characters are entered, it's actually overrunning a std::string buffer in 
the game. 
This can cause corruption but doesn't 99% of the time.

Will have to do something about this...

Original comment by treyst...@gmail.com on 11 Sep 2009 at 12:18

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

To fully match up with what VC++ does with strings, you need to track the 
original
string length on read.  If the original string is empty or < 16 bytes, you can 
safely
write back anything up to 16 bytes.  If the original string is 16+ bytes, you 
can
safely write back up to that length (since it goes into a buffer allocated 
separately
from the std::string structure.)  That is, I could customize the profession 
through
df to 24 'A's and then replace that with a 24-character string through DT, and 
it
should be able to write that back with no corruption.

And, of course, none of this works on Linux :(

Original comment by kutu...@gmail.com on 28 Nov 2009 at 4:41

@GoogleCodeExporter
Copy link
Author

A visual solution would be to have the data entry box:
* Presented in a mono-spaced font
* Surrounded by a bitmap that is one color on the left and another color just 
past
valid input.

This would mark the end of text length for easy editing, but not impose a hard 
limit.

Original comment by anglew...@gmail.com on 18 May 2010 at 7:29

@GoogleCodeExporter
Copy link
Author

Original comment by treyst...@gmail.com on 13 Oct 2010 at 4:41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant