makes the multi link support update faster and does some basic checks

This commit is contained in:
Madpeter 2020-04-25 23:04:05 +01:00
parent 8f5446f89a
commit 7302a732c1
4 changed files with 30 additions and 16 deletions

View file

@ -36,7 +36,7 @@ namespace BetterSecondBot
Bot.LastStatusMessage = NewStatusMessage; Bot.LastStatusMessage = NewStatusMessage;
ConsoleLog.Status(Bot.LastStatusMessage); ConsoleLog.Status(Bot.LastStatusMessage);
} }
Thread.Sleep(5000); Thread.Sleep(1000);
} }
Bot.GetClient.Network.Logout(); Bot.GetClient.Network.Logout();
} }

View file

@ -27,7 +27,7 @@ namespace BetterSecondBot
last_cnc_status = NewStatusMessage; last_cnc_status = NewStatusMessage;
ConsoleLog.Status(last_cnc_status); ConsoleLog.Status(last_cnc_status);
} }
Thread.Sleep(5000); Thread.Sleep(1000);
} }
ConsoleLog.Status("Shutting down now"); ConsoleLog.Status("Shutting down now");
if (my_http_server.GetBot != null) if (my_http_server.GetBot != null)

View file

@ -24,7 +24,7 @@ namespace BSB.bottypes
{ {
if (delay_appearence_update == 0) if (delay_appearence_update == 0)
{ {
delay_appearence_update = helpers.UnixTimeNow() + 5; delay_appearence_update = helpers.UnixTimeNow();
} }
else if (delay_appearence_update > 0) else if (delay_appearence_update > 0)
{ {
@ -34,7 +34,7 @@ namespace BSB.bottypes
delay_appearence_update = -1; delay_appearence_update = -1;
if(Client.Appearance.RequestSetAppearance() == "retry") if(Client.Appearance.RequestSetAppearance() == "retry")
{ {
delay_appearence_update = helpers.UnixTimeNow() + 5; delay_appearence_update = helpers.UnixTimeNow() + 1;
} }
} }
} }
@ -42,7 +42,7 @@ namespace BSB.bottypes
} }
} }
} }
return "Rendering: "+ delay_appearence_update.ToString()+" "+base.GetStatus(); return base.GetStatus();
} }
protected override void AfterBotLoginHandler() protected override void AfterBotLoginHandler()

View file

@ -459,7 +459,16 @@ namespace OpenMetaverse
{ {
try try
{ {
KeyValuePair<string,List < InventoryBase >> reply = Client.Inventory.FolderContents_replyed(GetCOF().UUID, Client.Self.AgentID, true, true, InventorySortOrder.ByDate, 40 * 1000, false); if (Client != null)
{
if (Client.Self != null)
{
if (Client.Self.AgentID != null)
{
InventoryFolder cof = GetCOF();
if (cof != null)
{
KeyValuePair<string, List<InventoryBase>> reply = Client.Inventory.FolderContents_replyed(cof.UUID, Client.Self.AgentID, true, true, InventorySortOrder.ByDate, 40 * 1000, false);
if (reply.Key == "ok") if (reply.Key == "ok")
{ {
List<InventoryBase> contents = reply.Value; List<InventoryBase> contents = reply.Value;
@ -478,10 +487,15 @@ namespace OpenMetaverse
} }
return reply.Key; return reply.Key;
} }
}
}
}
}
catch catch
{ {
return "fail";
} }
return "retry";
} }
/// <summary> /// <summary>