fix: 修复GuruServices 文档导入器解析报错的问题
							parent
							
								
									3673e3c594
								
							
						
					
					
						commit
						068f39a85d
					
				|  | @ -10,11 +10,13 @@ namespace Guru.Editor | |||
|      | ||||
|     public class GuruServiceConverterHelper | ||||
|     { | ||||
|         const string k_app_settings = "app_settings"; | ||||
|         const string k_adjust_settings = "adjust_settings"; | ||||
|         const string k_fb_settings = "fb_settings"; | ||||
|         const string k_ad_settings = "ad_settings"; | ||||
|         const string k_iap_settings = "iap_settings"; | ||||
|         const string K_APP_SETTINGS = "app_settings"; | ||||
|         const string K_ADJUST_SETTINGS = "adjust_settings"; | ||||
|         const string K_FB_SETTINGS = "fb_settings"; | ||||
|         const string K_AD_SETTINGS = "ad_settings"; | ||||
|         const string K_IAP_SETTINGS = "iap_settings"; | ||||
|         const char K_SPLITTER_TAB = '\t'; | ||||
|         const char K_SPLITTER_COMMA = ','; | ||||
|          | ||||
|         #region Export JSON | ||||
|          | ||||
|  | @ -41,10 +43,10 @@ namespace Guru.Editor | |||
|                 if (!IsInvalidLine(line)) | ||||
|                 { | ||||
|                     //---------------- app_settings ---------------- | ||||
|                     if (line.StartsWith(k_app_settings)) | ||||
|                     if (line.StartsWith(K_APP_SETTINGS)) | ||||
|                     { | ||||
|                         index++; | ||||
|                         while (!line.StartsWith(k_adjust_settings)) | ||||
|                         while (!line.StartsWith(K_ADJUST_SETTINGS)) | ||||
|                         { | ||||
|                             line = lines[index]; | ||||
|                             FillAppSettings(guru_service, line); | ||||
|  | @ -53,25 +55,25 @@ namespace Guru.Editor | |||
|                         } | ||||
|                     } | ||||
|                     //---------------- adjust_settings ---------------- | ||||
|                     if (line.StartsWith(k_adjust_settings)) | ||||
|                     if (line.StartsWith(K_ADJUST_SETTINGS)) | ||||
|                     { | ||||
|                         index++; | ||||
|                         FillAdjustSettings(guru_service, lines, ref index); | ||||
|                     } | ||||
|                     //---------------- fb_settings ---------------- | ||||
|                     if (line.StartsWith(k_fb_settings)) | ||||
|                     if (line.StartsWith(K_FB_SETTINGS)) | ||||
|                     { | ||||
|                         index++; | ||||
|                         FillFacebookSettings(guru_service, lines, ref index); | ||||
|                     } | ||||
|                     //---------------- ad_settings ---------------- | ||||
|                     if (line.StartsWith(k_ad_settings)) | ||||
|                     if (line.StartsWith(K_AD_SETTINGS)) | ||||
|                     { | ||||
|                         index++; | ||||
|                         FillAdSettings(guru_service, lines, ref index); | ||||
|                     } | ||||
|                     //---------------- iap_settings ---------------- | ||||
|                     if (line.StartsWith(k_iap_settings)) | ||||
|                     if (line.StartsWith(K_IAP_SETTINGS)) | ||||
|                     { | ||||
|                         index++; | ||||
|                         FillProducts(guru_service, lines, ref index); | ||||
|  | @ -183,7 +185,7 @@ namespace Guru.Editor | |||
|             bool pass = false; | ||||
|             List<string> events = new List<string>(20); | ||||
|              | ||||
|             while (!lines[index].StartsWith(k_fb_settings)) | ||||
|             while (!lines[index].StartsWith(K_FB_SETTINGS)) | ||||
|             { | ||||
|                 line = lines[index]; | ||||
|                 if (!IsInvalidLine(line)) | ||||
|  | @ -214,7 +216,7 @@ namespace Guru.Editor | |||
|             if(settings.fb_settings == null) settings.fb_settings = new GuruFbSettings(); | ||||
|             var line = ""; | ||||
| 
 | ||||
|             while (!lines[index].StartsWith(k_ad_settings)) | ||||
|             while (!lines[index].StartsWith(K_AD_SETTINGS)) | ||||
|             { | ||||
|                 line = lines[index]; | ||||
|                 if (!IsInvalidLine(line)) | ||||
|  | @ -258,7 +260,7 @@ namespace Guru.Editor | |||
|              | ||||
|             //------- 开始记录广告配置; | ||||
|             string[] arr; | ||||
|             while (!lines[index].StartsWith(k_iap_settings)) | ||||
|             while (!lines[index].StartsWith(K_IAP_SETTINGS)) | ||||
|             { | ||||
|                 line = lines[index]; | ||||
|                  | ||||
|  | @ -414,7 +416,7 @@ namespace Guru.Editor | |||
| 
 | ||||
|         private static bool IsInvalidLine(string line) | ||||
|         { | ||||
|             return (string.IsNullOrEmpty(line) || line.StartsWith("\t")); | ||||
|             return (string.IsNullOrEmpty(line) || line.StartsWith(K_SPLITTER_TAB)); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|  | @ -423,14 +425,14 @@ namespace Guru.Editor | |||
|             value = ""; // default   | ||||
|             if (line.StartsWith(key)) | ||||
|             { | ||||
|                 value = line.Split('\t')[1]; | ||||
|                 value = line.Split(K_SPLITTER_TAB)[1]; | ||||
|                 if (string.IsNullOrEmpty(value)) value = "empty"; | ||||
|                 return true; | ||||
|             } | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         private static string[] GetStringArray(string line, int startIndex = 0, int length = 0, char spliter = '\t') | ||||
|         private static string[] GetStringArray(string line, int startIndex = 0, int length = 0, char spliter = K_SPLITTER_TAB) | ||||
|         { | ||||
|             if (IsInvalidLine(line)) return null; | ||||
|              | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue