diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 10f1bb1..1102dfd 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -22,9 +22,4 @@ jobs: - name: Restore Dependencies run: dotnet restore - name: Build - run: dotnet build --configuration Release - - name: Upload Artifact - uses: actions/upload-artifact@v1.0.0 - with: - name: artifact - path: bin/Release + run: dotnet build --configuration Release \ No newline at end of file diff --git a/Assembly/ASMInfo.cs b/Assembly/ASMInfo.cs index 2483c3e..0578460 100644 --- a/Assembly/ASMInfo.cs +++ b/Assembly/ASMInfo.cs @@ -6,7 +6,7 @@ using System.Reflection; [assembly: AssemblyCompany("ZNI")] [assembly: AssemblyAlgorithmId(System.Configuration.Assemblies.AssemblyHashAlgorithm.MD5)] [assembly: AssemblyCopyright("© 2020 Tara Piccari")] -[assembly: AssemblyFileVersion("5.617")] +[assembly: AssemblyFileVersion("5.724")] [assembly: AssemblyDescription("Second Life Bot - BotCore5")] @@ -15,7 +15,7 @@ namespace Bot.Assemble public class ASMInfo { public static string BotName = "ZBotCore"; - public static double BotVer = 5.617; + public static double BotVer = 5.724; public static string GitPassword { get diff --git a/Program.cs b/Program.cs index 5579b20..6371fab 100644 --- a/Program.cs +++ b/Program.cs @@ -675,11 +675,46 @@ namespace Bot cfg.Save(); } - [CommandGroup("assign", 75, 1, "assign [DLL Name] - Sets the active DLL", MessageHandler.Destinations.DEST_AGENT | MessageHandler.Destinations.DEST_LOCAL | MessageHandler.Destinations.DEST_CONSOLE_INFO)] + [CommandGroup("assign", 75, 1, "assign [DLL Name] - Sets the primary active DLL", MessageHandler.Destinations.DEST_AGENT | MessageHandler.Destinations.DEST_LOCAL | MessageHandler.Destinations.DEST_CONSOLE_INFO)] public void SetActiveProgram(UUID client, int level, GridClient grid, string[] additionalArgs, MessageHandler.MessageHandleEvent MHE, MessageHandler.Destinations source, CommandRegistry registry, UUID agentKey, string agentName) { MHE(MessageHandler.Destinations.DEST_ACTION, UUID.Zero, "{\"type\":\"assignProgram\",\"newProgram\":\"" + additionalArgs[0] + "\"}"); } + private ManualResetEvent profile_get = new ManualResetEvent(false); + private Avatar.AvatarProperties Properties_AV; + [CommandGroup("set_profile_text", 75, 1, "set_profile_text [text:Base64] - Sets the profile text", MessageHandler.Destinations.DEST_AGENT | MessageHandler.Destinations.DEST_LOCAL | MessageHandler.Destinations.DEST_CONSOLE_INFO)] + public void setProfileText(UUID client, int level, GridClient grid, string[] additionalArgs, MessageHandler.MessageHandleEvent MHE, MessageHandler.Destinations source, CommandRegistry registry, UUID agentKey, string agentName) + { + MHE(source, client, "Setting..."); + + BotSession.Instance.grid.Avatars.AvatarPropertiesReply += Avatars_AvatarPropertiesReply; + BotSession.Instance.grid.Avatars.RequestAvatarProperties(BotSession.Instance.grid.Self.AgentID); + profile_get.Reset(); + + if (profile_get.WaitOne(TimeSpan.FromSeconds(30))) + { + Properties_AV.AboutText = Encoding.UTF8.GetString(Convert.FromBase64String(additionalArgs[0])); + + BotSession.Instance.grid.Self.UpdateProfile(Properties_AV); + MHE(source, client, "Profile text set"); + } + else + { + MHE(source, client, "The profile text could not be set. Timeout experienced"); + + BotSession.Instance.grid.Avatars.AvatarPropertiesReply -= Avatars_AvatarPropertiesReply; + } + + } + + private void Avatars_AvatarPropertiesReply(object sender, AvatarPropertiesReplyEventArgs e) + { + Properties_AV = e.Properties; + + profile_get.Set(); + + BotSession.Instance.grid.Avatars.AvatarPropertiesReply -= Avatars_AvatarPropertiesReply; + } [STAThread()] private static void onObjectTerseUpdate(object sender, TerseObjectUpdateEventArgs e)