From a01985bc5e13028a4d0d9bb88d450f85c30347f2 Mon Sep 17 00:00:00 2001
From: Madpeterz <57852827+Madpeterz@users.noreply.github.com>
Date: Thu, 25 Feb 2021 04:46:36 +0000
Subject: [PATCH] corrects a issue and lowers the teleport lockout
---
.gitignore | 5 ++++-
BetterSecondbot/BetterAtHome/BetterAtHome.cs | 3 ++-
BetterSecondbot/BetterSecondbot.csproj | 1 +
BetterSecondbot/Cli.cs | 4 ++++
Core/bottypes/CommandsBot.cs | 10 ++++++----
LibreMetaverse/NetworkManager.cs | 17 ++++++++++++++---
6 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/.gitignore b/.gitignore
index 448e625..68fe191 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,4 +16,7 @@ mapgen.bat
PrimMesher/
Programs/
libremetaverse-core/.gitignore
-BetterSecondbot/Dockerfile
+BetterSecondbot/Dockerfile
+BetterSecondbot/wiki/
+BetterSecondbot/debug.json
+BetterSecondbot/settings.env
diff --git a/BetterSecondbot/BetterAtHome/BetterAtHome.cs b/BetterSecondbot/BetterAtHome/BetterAtHome.cs
index a900b74..1c12ddc 100644
--- a/BetterSecondbot/BetterAtHome/BetterAtHome.cs
+++ b/BetterSecondbot/BetterAtHome/BetterAtHome.cs
@@ -37,6 +37,7 @@ namespace BetterSecondbot.BetterAtHome
{
string[] bits = helpers.ParseSLurl(a);
homeRegions.Add(bits[0]);
+ LogFormater.Info("Added home region: " + bits[0]);
}
}
@@ -289,7 +290,7 @@ namespace BetterSecondbot.BetterAtHome
return;
}
dif = helpers.UnixTimeNow() - LastTeleportEvent;
- if (dif < 120)
+ if (dif < 45)
{
SetBetterAtHomeAction("Waiting for Teleport lockout");
return;
diff --git a/BetterSecondbot/BetterSecondbot.csproj b/BetterSecondbot/BetterSecondbot.csproj
index b4c29db..8fe5491 100644
--- a/BetterSecondbot/BetterSecondbot.csproj
+++ b/BetterSecondbot/BetterSecondbot.csproj
@@ -4,6 +4,7 @@
Exe
netcoreapp3.1
Linux
+ settings.env
..\..
git rev-parse --short HEAD
False
diff --git a/BetterSecondbot/Cli.cs b/BetterSecondbot/Cli.cs
index d47dd34..8c3ae7d 100644
--- a/BetterSecondbot/Cli.cs
+++ b/BetterSecondbot/Cli.cs
@@ -37,6 +37,10 @@ namespace BetterSecondBot
Thread.Sleep(1500);
}
betterAtHomeService = null;
+ betterTracking = null;
+ datastorage = null;
+ Bot = null;
+ exitBot = true;
}
public void attachEventListenerObjects(JsonConfig Config, bool as_docker)
diff --git a/Core/bottypes/CommandsBot.cs b/Core/bottypes/CommandsBot.cs
index 045b632..d13b75c 100644
--- a/Core/bottypes/CommandsBot.cs
+++ b/Core/bottypes/CommandsBot.cs
@@ -263,21 +263,23 @@ namespace BetterSecondBot.bottypes
message = input[0];
signing_code = input[1];
}
- List bits = message.Split(new[] { "|||" }, StringSplitOptions.RemoveEmptyEntries).ToList();
+ string outputto = "none";
+ List bigbits = message.Split(new[] { "#|#" }, StringSplitOptions.RemoveEmptyEntries).ToList();
+ List bits = bigbits[0].Split(new[] { "|||" }, StringSplitOptions.RemoveEmptyEntries).ToList();
if (bits.Count == 1)
{
bits.Add("");
}
- if (bits.Count == 2)
+ if(bigbits.Count == 2)
{
- bits.Add("none");
+ outputto = bigbits[1];
}
bool frommaster = false;
if ((avatar == true) && ((sender_uuid == master_uuid) || (SubMasters.Contains(sender_name) == true)))
{
frommaster = true;
}
- CoreCommandLib(sender_uuid, frommaster, bits[0], bits[1].Split("~#~"), signing_code,bits[2]);
+ CoreCommandLib(sender_uuid, frommaster, bits[0], bits[1].Split("~#~", StringSplitOptions.RemoveEmptyEntries), signing_code, outputto);
}
}
diff --git a/LibreMetaverse/NetworkManager.cs b/LibreMetaverse/NetworkManager.cs
index cfb89be..7c1f0bf 100644
--- a/LibreMetaverse/NetworkManager.cs
+++ b/LibreMetaverse/NetworkManager.cs
@@ -855,9 +855,20 @@ namespace OpenMetaverse
OnSimDisconnected(new SimDisconnectedEventArgs(CurrentSim, type));
}
}
-
- _packetInbox.Writer.Complete();
- _packetOutbox.Writer.Complete();
+ if (_packetInbox != null)
+ {
+ if (_packetInbox.Writer != null)
+ {
+ _packetInbox.Writer.Complete();
+ }
+ }
+ if (_packetOutbox != null)
+ {
+ if (_packetOutbox.Writer != null)
+ {
+ _packetOutbox.Writer.Complete();
+ }
+ }
_packetInbox = null;
_packetOutbox = null;