From 370cfd61da2a7b6c7a8310f0fb721a10de85fa66 Mon Sep 17 00:00:00 2001 From: memo Date: Sun, 7 Jul 2024 08:35:45 +0200 Subject: [PATCH] add sanity check for correct cookie syntax --- src/main/scala/sc4pac/Constants.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/scala/sc4pac/Constants.scala b/src/main/scala/sc4pac/Constants.scala index b28ae25..63801f2 100644 --- a/src/main/scala/sc4pac/Constants.scala +++ b/src/main/scala/sc4pac/Constants.scala @@ -64,6 +64,12 @@ object Constants { * For details, see the instructions in `sc4pac.bat`. */ lazy val simtropolisCookie: Option[String] = Option(System.getenv("SC4PAC_SIMTROPOLIS_COOKIE")).filter(_.nonEmpty) + .map { s => + if (s.startsWith("\"") || s.endsWith("\"")) { + System.err.println("Warning: SC4PAC_SIMTROPOLIS_COOKIE should not be surrounded by quotes. Remove the quotes and try again.") + } + s + } /* On non-Windows platforms, cicdec is invoked by `mono cicdec [args]`, but on Windows Mono is not required: `cicdec [args]`. * We choose reasonable defaults, but allow customizing these two commands via environment variables (which are set in the launch scripts).