Closed skittles1 closed 7 years ago
The CharCreationInfo class has a property IsDataOK which is currently set when the message is processed in DataController.
I think you should change this property from BOOL to e.g. INT and set it with the error-code from the message. Finally, modify the CEGUI behaviour which is already listening on the PropertyChangedEvent to show/hide/set the error label.
Oh, and about "from error-code to string": this should definitely happen in ogreclient so far. e.g. when the PropertyChangedEvent of the ErrorCode property is processed. I tried to use as few strings in corelib as possible, since it doesn't have and likely won't have multilanguage support...
And the enum with the error codes should probably go into corelib Common/Enums. There are several examples which derive from a simple type (e.g. int/uint/byte) already
Submitted #247
Looking at how to implement this... receiving the error code from the server is fine (stored in new ErrorID property in Meridian59.Protocol.GameMessages.CharInfoNotOKMessage) however once HandleCharInfoNotOKMessage() in DataController gets called I'm a little unsure what to do. Should we have a new Data.Model.CharInfoNotOK to hold the error code, or should we replace the IsDataOK property in CharCreationInfo with an ErrorID property and check that the same way as IsDataOK (just with more options)? Also unsure at which point we should convert error code -> string.
See https://github.com/skittles1/meridian59-dotnet/commit/5c63ee105236c4ae98e7479facc6346cb0a00d84 for the initial work on this (receive error code from server, dialog OK box in UI).