diff --git a/Oxide.Ext.GamingApi/GamingApiNats.cs b/Oxide.Ext.GamingApi/GamingApiNats.cs index 0ef1624..6fef8de 100644 --- a/Oxide.Ext.GamingApi/GamingApiNats.cs +++ b/Oxide.Ext.GamingApi/GamingApiNats.cs @@ -10,6 +10,7 @@ using NATS.Client.JetStream; using System.Configuration; using System.IO; +using System.Text; namespace Oxide.Ext.GamingApi { @@ -84,7 +85,7 @@ private GamingApiNats(LoggingInterface logger) { // get a private key seed from your environment. string seed = this.GetNatsJwtSeed(); - this.Logger.Info("NATS: Loading jwt seed : " + seed.Substring(0, 3)); + this.Logger.Info("NATS: Loading jwt seed : " + seed.Substring(0, 3) + "...."); // Generate a NkeyPair NkeyPair kp = Nkeys.FromSeed(seed); @@ -176,7 +177,16 @@ private string GetNatsNkeySeed() } return value; } - + public string PrintByteArray(byte[] bytes) + { + var sb = new StringBuilder("new byte[] { "); + foreach (var b in bytes) + { + sb.Append(b + ", "); + } + sb.Append("}"); + return sb.ToString(); + } private string GetNatsJwtUser() { @@ -188,6 +198,7 @@ private string GetNatsJwtUser() { this.Logger.Info($"NATS: {envFileName} loading from file"); string contents = File.ReadAllText(@fileName); + this.Logger.Info($"NATS: {envFileName} length was - {PrintByteArray(Encoding.UTF8.GetBytes(contents))}"); return contents; } @@ -211,6 +222,7 @@ private string GetNatsJwtSeed() { this.Logger.Info($"NATS: {envFileName} loading from file"); string contents = File.ReadAllText(@fileName); + this.Logger.Info($"NATS: {envFileName} length was - {PrintByteArray(Encoding.UTF8.GetBytes(contents))}"); return contents; } var value = Environment.GetEnvironmentVariable(envName);