cyberjunk / meridian59-dotnet

New 3D client and tools for Meridian 59
GNU General Public License v3.0
34 stars 35 forks source link

BP_CHARINFO_NOT_OK in Ogre #246

Closed skittles1 closed 7 years ago

skittles1 commented 7 years ago

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).

cyberjunk commented 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.

cyberjunk commented 7 years ago

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...

cyberjunk commented 7 years ago

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

skittles1 commented 7 years ago

Submitted #247