Rather than add a bunch of other events, just extend alert handling

This commit is contained in:
Cinder
2021-09-11 09:21:35 -05:00
parent 54adf6e8c3
commit 93bfac58da
2 changed files with 35 additions and 15 deletions

View File

@@ -127,11 +127,14 @@ namespace OpenMetaverse.TestClient
Packet packet = e.Packet;
AlertMessagePacket alert = (AlertMessagePacket)packet;
string message = Utils.BytesToString(alert.AlertData.Message);
if (message.Contains("Autopilot cancel"))
if (alert.AlertInfo.Length > 0)
{
Logger.Log("FollowCommand: " + message, Helpers.LogLevel.Info, Client);
string id = Utils.BytesToString(alert.AlertInfo[0].Message);
if (id == "AutopilotCancelled")
{
Logger.Log("FollowCommand: " + Utils.BytesToString(alert.AlertData.Message),
Helpers.LogLevel.Info, Client);
}
}
}
}