CnCNet / xna-cncnet-client

XNA / MonoGame based client for playing classic Command & Conquer games both online and offline with a CnCNet game spawner.
Other
228 stars 91 forks source link

[Bug Report] Cannot save client opinions when using filesettingdropdown or filesettingcheckbox section in OptionsWindow.ini. #381

Closed AmethystCR closed 1 year ago

AmethystCR commented 2 years ago

I cannot save client opinions when using custom filesettingdropdown and filesettingcheckbox section in OptionsWindow.ini, I'm not sure whether the problem is caused by CNCNET or Rampastring.Tools or Others. Here are relevant screenshots.

AmethystCR commented 1 year ago

屏幕截图 2022-11-10 185129 屏幕截图 2022-11-10 185212 屏幕截图 2022-11-10 185321

frg2089 commented 1 year ago

It looks like it only supports folders, and I'm not sure if that's the right behavior.

To support file, you must used SafePath.CombineFilePath method.

https://github.com/CnCNet/xna-cncnet-client/blob/2fc20495f9e001555844c0a9383547661b159247/DTAConfig/Settings/FileSourceDestinationInfo.cs#L14-L16

AmethystCR commented 1 year ago

The previous version supported the file replacement function. Will this function be added in the future? Otherwise, it can only be used in the old version. I hope it's just a bug.

AmethystCR commented 1 year ago

It looks like it only supports folders, and I'm not sure if that's the right behavior.

To support file, you must used SafePath.CombineFilePath method.

https://github.com/CnCNet/xna-cncnet-client/blob/2fc20495f9e001555844c0a9383547661b159247/DTAConfig/Settings/FileSourceDestinationInfo.cs#L14-L16

I recompiled the client with this method, and now it works normally again. Thank you for your guidance.