//音声タイプとそのタイプのファイル数を取得 //引数:取得するフォルダ,ref 音声タイプを入れるリスト,ref 音声数を入れるリスト (リストは初期化される) public static void Get_Voice_Type_And_Index(string Dir_Path, ref List <string> Voice_Type, ref List <int> Voice_Number) { string[] Dir_List = Directory.GetFiles(Dir_Path, "*", SearchOption.TopDirectoryOnly); List <string> Voice_List_Type = new List <string>(); for (int Number = 0; Number <= Dir_List.Length - 1; Number++) { if (Voice_Set.Voice_Name_Hide(Dir_List[Number])) { Voice_List_Type.Add(Path.GetFileName(Dir_List[Number])); } } List <string> Voice_Type_Ref = new List <string>(); List <int> Voice_Type_Number_Ref = new List <int>(); int Voice_Type_Number = 0; string Name_Now = ""; for (int Number = 0; Number < Voice_List_Type.Count; Number++) { string Name_Only = Voice_List_Type[Number].Substring(0, Voice_List_Type[Number].LastIndexOf('_')); if (Name_Now != Name_Only) { if (Name_Now != "") { Voice_Type_Number_Ref.Add(Voice_Type_Number); } Name_Now = Name_Only; Voice_Type_Number = 1; Voice_Type_Ref.Add(Voice_Set.Get_Voice_Type_Japanese_Name(Name_Only)); } else { Voice_Type_Number++; } } Voice_Type_Number_Ref.Add(Voice_Type_Number); Voice_Type = Voice_Type_Ref; Voice_Number = Voice_Type_Number_Ref; }
//管理者が設定を変更した場合それを反映 void TCP_Change_Config(string[] Message_Temp) { try { string Server_Rename = Message_Temp[2].Replace("\0", ""); if (Voice_Set.SRTTbacon_Server_Name != Server_Rename) { Directory.Move(Voice_Set.Special_Path + "/Server/" + Voice_Set.SRTTbacon_Server_Name, Voice_Set.Special_Path + "/Server/" + Server_Rename); Voice_Set.SRTTbacon_Server_Name = Server_Rename; } if (Voice_Set.FTPClient.File_Exist("/WoTB_Voice_Mod/" + Voice_Set.SRTTbacon_Server_Name + "/Remove_Files.dat")) { StreamReader str = Voice_Set.FTPClient.GetFileRead("/WoTB_Voice_Mod/" + Voice_Set.SRTTbacon_Server_Name + "/Remove_Files.dat"); string[] Read = str.ReadToEnd().Split('\n'); str.Dispose(); foreach (string Line in Read) { if (Line != "") { try { File.Delete(Voice_Set.Special_Path + "/Server/" + Voice_Set.SRTTbacon_Server_Name + "/Voices/" + Line); } catch { } } } } if (Voice_Set.FTPClient.File_Exist("/WoTB_Voice_Mod/" + Voice_Set.SRTTbacon_Server_Name + "/Add_Files.dat")) { bool IsChanged = false; StreamReader str = Voice_Set.FTPClient.GetFileRead("/WoTB_Voice_Mod/" + Voice_Set.SRTTbacon_Server_Name + "/Add_Files.dat"); string[] Read = str.ReadToEnd().Split('\n'); str.Dispose(); foreach (string Line in Read) { if (Line != "") { try { Voice_Set.FTPClient.DownloadFile("/WoTB_Voice_Mod/" + Voice_Set.SRTTbacon_Server_Name + "/Voices/" + Line, Voice_Set.Special_Path + "/Server/" + Voice_Set.SRTTbacon_Server_Name + "/Voices/" + Line); IsChanged = true; } catch { } } } if (IsChanged) { string[] Temp = Directory.GetFiles(Voice_Set.Special_Path + "/Server/" + Voice_Set.SRTTbacon_Server_Name + "/Voices"); List <string> Temp_01 = new List <string>(); for (int Number = 0; Number <= Temp.Length - 1; Number++) { if (!Voice_Set.Voice_Name_Hide(Temp[Number])) { Temp_01.Add(System.IO.Path.GetFileName(Temp[Number])); } } Voice_Set.Voice_Files = Temp_01; } } } catch (Exception e) { MessageBox.Show("エラー:" + e.Message); Sub_Code.Error_Log_Write(e.Message); } }