Browse Source

Remove newlines from dumps

Gotta sort the stuff, and most processing utilities don't take kindly to
newlines in CSV.
nosoop 7 years ago
parent
commit
57aa49d9f8
1 changed files with 5 additions and 1 deletions
  1. 5 1
      scripting/csrd_data_dump.sp

+ 5 - 1
scripting/csrd_data_dump.sp

@@ -13,7 +13,7 @@
 #include <stocksoup/files>
 #include <stocksoup/version>
 
-#define PLUGIN_VERSION "1.1.0"
+#define PLUGIN_VERSION "1.1.1"
 public Plugin myinfo = {
 	name = "[CSRD] SRCDS Automatic Data Dumper",
 	author = "nosoop",
@@ -173,6 +173,8 @@ void DumpServerCommands(const char[] format, any ...) {
 	do {
 		if (bIsCommand) {
 			ReplaceString(commandDescription, sizeof(commandDescription), "\"", "'");
+			ReplaceString(commandDescription, sizeof(commandDescription), "\n", " / ");
+			
 			outputFile.WriteLine("\"%s\",\"%s\",\"%s\"", commandName,
 					GetCommandFlagString(flags), commandDescription);
 		}
@@ -204,6 +206,8 @@ void DumpServerConVars(const char[] format, any ...) {
 			FindConVar(commandName).GetDefault(defaultValue, sizeof(defaultValue));
 			
 			ReplaceString(commandDescription, sizeof(commandDescription), "\"", "'");
+			ReplaceString(commandDescription, sizeof(commandDescription), "\n", " / ");
+			
 			outputFile.WriteLine("\"%s\",\"%s\",\"%s\",\"%s\"", commandName,
 					defaultValue, GetCommandFlagString(flags), commandDescription);
 		}