Giter Club home page Giter Club logo

libremetaverse's Introduction

 _ _ _            __  __ ___ _____ ___   _____ ___  ___ ___ 
| (_) |__ _ _ ___|  \/  | __|_   _/_\ \ / / __| _ \/ __| __|
| | | '_ \ '_/ -_) |\/| | _|  | |/ _ \ V /| _||   /\__ \ _| 
|_|_|_.__/_| \___|_|  |_|___| |_/_/ \_\_/ |___|_|_\|___/___|

LibreMetaverse

LibreMetaverse is a fork of libOpenMetaverse which in turn was a fork of libSecondLife, a library for developing Second Life-compatible virtual world clients. LibreMetaverse returns the focus to up-to-date Second Life and OpenSim compatibility with an eye to performance, multi-threading, and memory management.

The canonical source for LibreMetaverse can be found at: https://github.com/cinderblocks/libremetaverse

Simple installation procedure

Windows

The dotnet utility is cross-platform so compilation is no different than on Linux/macOS. You may, however, opt to use Visual Studio as you would any other .NET application.

Linux/macOS

  • Make sure you have at least dotnet installed, with a valid SDK and runtime of at least .NET5 available!

  • This update includes a solution file to skip GUI applications for non-Windows platforms. Use LibreMetaverse.ReleaseNoGUI.sln instead

  • From the root, run dotnet restore LibreMetaverse.ReleaseNoGUI.sln. You should get some errors regarding missing Windows libraries; that's ok, you can ignore those, they're to be expected since Linux/macOS do not include such libraries. Some test applications are Windows-only.
    If all goes well, you should now have all dependent packages properly installed.

  • From the root, run dotnet msbuild LibreMetaverse.ReleaseNoGUI.sln, and enjoy the superfast Roslyn compiler at work ๐Ÿ˜„ It should finish after a few minutes, depending on the speed of your machine.

  • Your binaries will be under ../bin/net6.0 or ../bin/net7.0 (there might be a few more directories under ../bin), depending on what runtimes you have installed on your system. Make sure you cd to the correct directory depending on the runtime you have, and then search for all your binaries there: they should be normal-looking executable files (with the x attribute set) and having the name of the appropriate test application (e.g. TestClient for the interactive testing tool).

  • Unlike OpenSimulator and LibOpenMetaverse, you don't need to launch the binaries with Mono, they're directly executable; the dotnet chain already embeds the small runtime that allows .NET apps to run natively on whatever operating system you've got.

GUI support under Linux/macOS

LibreMetaverse.GUI is not available on Linux/macOS due to Microsoft's lack of support for GDI/WinForms on non-Windows platforms. They may work using Mono's implemention and can always be emulated using a product like Wine.

The GUI library is being phased out and eventually being replaced by a more cross-platform framework like Avalonia or MAUI.

LibreMetaverse NuGet-Release
NuGet Downloads
Build status
Test status
Codacy Badge
.NET
CodeQL
BSD Licensed
Commits per month
ZEC BTC

libremetaverse's People

Contributors

adversinc avatar antoncl avatar appurist avatar bengtgustafsson avatar bluewall avatar cinderblocks avatar dahliat avatar diva avatar example123 avatar fly-man- avatar gwynethllewelyn avatar jhurliman avatar jimradford avatar kf6kjg avatar lkalif avatar madpeterz avatar mcortez avatar melaniet avatar misterblue avatar nooperation avatar nopjmp avatar radams1 avatar robincornelius avatar root66 avatar ryemutt avatar shyrobbiani avatar signpostmarv avatar takeshich avatar teamspoon avatar techplexengineer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

libremetaverse's Issues

scripted agent falls off vehicle on sim borders

whenever I log in using radegast or any other client/viewer based on libremetaverse or any of its precessors, I can't use vehicles to cross sim borders.

To reproduce/demonstrate:

  • log in with radegast
  • sit on someone's vehicle
  • have that someone drive across a sim border
  • notice that the avatar that is logged in with radegast gets unseated at the sim border

any viewer/client that uses libremetaverse or any of its precessors has this problem: it reproduces with at least radegast 2.32, corrade, and the "TestClient.exe" that comes with libopenmetaverse.

LoginResponseData.Parse(OSDMap) caught lacking

LoginResponseData.Parse(OSDMap) lacks handling all the parameters in the login response. It needs updated to match that of LoginResponseData.Parse(Hashtable). Otherwise, this may cause issues with LLSD logins down the road.

Many functions in InventoryManager are dead

As can be seen in this example of code: https://github.com/zontreck/BotCore5/blob/master/Visitors/Greeter.cs#L159-L188

It does not work. It continually fails to find the requested inventory item, and in code... https://github.com/zontreck/BotCore5/blob/master/Program.cs#L297-L343

I have it set up to try to request virtually all items as well as save the inventory cache to disk, and restore the cache when next logging in. Saving cache fails as does loading it from disk.

Requesting group members for a large group times out or never returns anything

If requesting group member lists for a very large group containing thousands of members, the request never appears to ever complete. But for significantly smaller groups the requests will complete, sometimes with a inaccurate number of members as compared to the GroupMemberCount property of the GroupProfile.

Missing Registration for ObjectAnimationEvent

I have encountered an issue with the Librametaverse library where the ObjectAnimationEvent is not registered, I attempted to extend the existing ObjectManager class to support this event, following a pattern similar to AvatarAnimationEvent in the AvatarManager class, but I encountered difficulties and was unable to succeed.

Questions:

  1. Is there a specific reason why ObjectAnimationEvent was not included in the library or registered with the ObjectManager class?
  2. Could someone please provide guidance or suggestions on the correct approach to extend the ObjectManager class to support ObjectAnimationEvent?

Missing function [Todo] / OpenMetaverse.Assets / Sounds / Encode function

the Encode function for AssetSound is currently blank and uploads will fail.

            AssetSound S = new AssetSound();
            S.AssetData = audioData;
            S.Encode();

            bot.GetClient.Inventory.RequestCreateItemFromAsset(S.AssetData, inventoryName, "", AssetType.Sound, InventoryType.Sound, AA.UUID, uploadFinished);

Large chat support

The current Chat command found in AgentManager.cs errors if you send a message that is to large.

Fix:
split the message into chunks of 900chars (with optional chunk_grouping details)

Commit

Madpeterz@71f01b0

InventoryAISClient / UpdateItem Fails

Message given:

Warning: The SSL connection could not be established, see inner exception.

What where you trying todo:

Rename a item.

Grid:

Secondlife

Example code:
InventoryItem item = Client.Inventory.FetchItem(target, Client.Self.AgentID, 3000);
if (item != null)
{
     item.Name = "New name here";
     Client.Inventory.RequestUpdateItem(item);
      return true;
}
return false;

Uploading Images Fails

Using the TestClient program and uploading an image fails:

1 avatars online> uploadimage todo 60000 todo.png
Loading image todo.png
Finished compressing image to JPEG2000, uploading...
RequestCreateItemFromAsset() returned: Success=False, Status=failure, ItemID=00000000-0000-0000-0000-000000000000, AssetID=00000000-0000-0000-0000-000000000000 Upload took 00:00:00.8660495
199356 [27] INFO  - <Bugsby Resident>: Texture upload failed: 00000000-0000-0000-0000-000000000000

Avatars with multiple attachments on the same point don't get fully rezzed

After getting some reports that my bots (in SL) were 'missing parts' (e.g. shoes not showing, the avatar is barefoot) or 'see-through' โ€” essentially, clothing that uses alpha layers to mask imperfections/irregularities on mesh clothing โ€” I logged in using the bots' account (using both Firestorm and the official SL Viewer), and everything was rezzed properly on the default outfit; but when the avatar is logged in via LibreMetaverse, there are, indeed, 'missing attachments'.

I first thought it was just a local viewer issue, e.g. some items take longer to rez than others (like some HUDs with an insane number of textures in them). However, that theory didn't fit the facts: it's pretty much irrelevant which viewer or operating system is used, or if the cache has been freshly deleted, or wherever you log in from (different networks, local Ethernet, Wi-Fi...), or whatever region the avatars are in, it's always the same avatars that always miss the exact same items.

Because this happens to some avatars but not all I was stumped about this for quite a while, until I noticed a pattern: the avatars missing items/clothing seem to have multiple attachments/layers/clothes on the same attachment point.

This is, of course, not an issue with contemporary viewers: the ability to have multiple items on the same attachment point (or multiple layers of clothing on the same layer) has been around for quite a while (a decade or so) in SL, and it works flawlessly on OpenSimulator as well.

Obviously, this issue can be side-stepped simply by making sure that only one item is attached per attachment point.

Since I haven't seen this issue raised before, I wonder if this has some kind of workaround, or is there no other choice but to hack at the code and figure out what's not working as it should?

Caps 404 on connect

Since we are using LMV now I'll ask here too instead of fighting this alone lol

Does someone experience caps seed 404 error while logging in multiple agents simultaneously? Around 10 at time. This started recently (December) and drives us nuts.

  • XMLRPC returns a proper SeedCapability,
  • LMV tries initialising Caps
  • and SL region returns HTTP 404 with the following content:

cap not found: 'f91c296d-f824-a2fc-4aed-e2d7512e9602'

We had to implement the CapsError event to relog agent immediately, this seems to be working. I'll submit a detailed Jira bug after Christmas but curious if someone faces this too.

Feature request: RebuildPathing

There is no interface to request that a sim start rebuilding the object path finding.

Example requests

Estate.RebuildPathing(Network.CurrentSim);
Network.CurrentSim.RebuildPathing();

_packetInbox unexpectedly null under certain sequence of events

This is observed after a (vaguely observed) failed teleport event and an attempt to log out when the network seems to already log out the avatar. The evidence of this is a log message Ignoring RequestLogout(), client is already logged out that precedes the outcome below in the NetworkManager public void Shutdown(DisconnectType type, string message).

image

Knowing how flimsy the logging out and teleporting is, I wonder if this can be somehow addressed internally in the library, or rather it would be advisable to intercept the error on a higher level?

The stack seems to begin with the Logout():

 	LibreMetaverse.dll!OpenMetaverse.NetworkManager.Shutdown(OpenMetaverse.NetworkManager.DisconnectType type, string message) Line 856	C#
>	LibreMetaverse.dll!OpenMetaverse.NetworkManager.Logout() Line 729	C#

NullReferenceException in InventoryManager when passing Folder with Descendants

On line 2523, a null reference exception is thrown

2521             for (int i = 1; i <= folderContents.Count; ++i)
2522             {
2523                bucket[i * 17] = (byte)folderContents[i - 1].AssetType;
2524                Buffer.BlockCopy(folderContents[i - 1].UUID.GetBytes(), 0, bucket, i * 17 + 1, 16);
2525             }

The array objects inside folderContents are set to null.
It appears that it allocated enough array space for the items as the folder I tested this on had 2 subfolders.

  • This code is called when trying to give a folder:
Client.Inventory.GiveFolder(UUID folderID, string folderName, AssetType, UUID recipient, bool doEffect);

InventoryManager marks Remove as Obsolete...

Issue:

InventoryManager marks Remove as Obsolete [due to no longer being supported by secondlife]
but does not suggest corrective action in the comments.

Changes:
maybe add a note to use the move command and the trash folder?

Secondlife (LindenLabs) login servers returning expected content

237 [8] WARN  - Login response failure: Notation LLSD parsing: Unknown type marker 'S'.    at OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDNotationElement(StringReader reader) in D:\VS projects\BetterSecondBot\LibreMetaverse.StructuredData\LLSD\NotationLLSD.cs:line 272
   at OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDNotation(StringReader reader) in D:\VS projects\BetterSecondBot\LibreMetaverse.StructuredData\LLSD\NotationLLSD.cs:line 86
   at OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDNotation(String notationData) in D:\VS projects\BetterSecondBot\LibreMetaverse.StructuredData\LLSD\NotationLLSD.cs:line 79
   at OpenMetaverse.LoginResponseData.Parse(Hashtable reply) in D:\VS projects\BetterSecondBot\LibreMetaverse\Login.cs:line 468
   at OpenMetaverse.NetworkManager.LoginReplyXmlRpcHandler(XmlRpcResponse response, LoginParams context) in D:\VS projects\BetterSecondBot\LibreMetaverse\Login.cs:line 1354

Issue started as part of Second Life Login Maintenance

not sure if just broken login servers yet or if they changed something.

Issue seems to also affect Lumiya

could not create ssl/tls secure channel

Greetings,
I am moving from standard open metaverse libs to this.
The main issue appears during the login via XmlRPC

XmlRpcHttpClientExtentions.cs, line 60ish

"var response = await client.SendAsync(request, cancellationToken)
.ConfigureAwait(false);"

While i am running it on windows 10(the dev machine) everything works correct,
On Windows Server 2008 R2 i am getting the error "could not create ssl/tls secure channel"
On Windows Server 2012 R2 i am getting the error "A fatal alert was received from the remote endpoint. The TLS protocol defined fatal alert code is 40." witch according to docs refers to "SSL3_ALERT_HANDSHAKE_FAILURE 40" ???

Due to my recent communication with LindenLabs as of 11/1/2021 they have discontinued TLS 1.0 and TLS 1.1.

As i am very unfamiliar with .Net (C++ programmer) i have notices a toon of .NET craziness so I am wandering if there is any necessary runtime i need to install additional or is something that you guys need to check.

Thanks in advance.

Proprietary libraries

Is there no alternative to vivox? It would be best if there is a purely libre solution for voice chat.

missing "Parcel" settings

Parcel settings that are not flags are currently missing.

from my first pass looking into this it seems at some point the parcel data was expanded to include these
values

SeeAVs
AnyAVSounds
GroupAVSounds

I will have a play around with unpacking parcel data but if anyone else wants to beat me to it you are more than
welcome to

What's a good value for ServicePoint.MaxIdleTime in DownloadManager.SetupRequest?

In DownloadManager.SetupRequest(),
does it make sense to change
request.ServicePoint.MaxIdleTime = 0;
to
request.ServicePoint.MaxIdleTime = Timeout.Infinite;
or maybe change it to the value used for CapsBase:
request.ServicePoint.MaxIdleTime = 60 * 1000;

I am running the library on Unity editor in windows,
and my main thread blocks if this value is set to 0. (the debugger will enter BeginGetResponse() and staying there for minutes, accumulating RAM and eventually even blue screening my pc)
On the other hand, both 60*1000 and Infinite are ok in my testing.

I will do more testing and confirm what's causing this issue and if its unity specific. Even if the underlying runtime/compiler interpret the 0 as literally '0 seconds' (instead of infinite). BeginGetResponse() should not be blocking UI thread, i think.

Issue with AppearanceManager

the function ReplaceOutfit when in safe mode calls GetAgentWearables
but this function seems to be failing (returning false) and this is breaking updates to appearences.

SetupHttpCapsClient fails in Unity

We have a Unity project that using the Mono Scripting Backend, and the .Net Framework API Compatibility Level. We are referencing the netstandard2.1 version of the compiled assembly in the Unity Project.

We have found that the SetupHttpCapsClient code in GridClient, attempts to configure MaxConnectionsPerServer. The MaxConnectionsPerServer property is not supported on all platforms. We have found that if we take out the code to set that on the HttpClientHandler, then the HttpClientHandler works just fine.

See:
zangetsu-oe@72c1620

I'm not sure what's the correct way to go about making this particular line conditional, otherwise I would have and included a pull request.

Advice is appreciated.

Looking for Ray and a proper OpenJPeg

Sorry for this mechanism to address a question. I don't have a way afaik to contact you otherwise. I'm in the process of updating a Halcyon derived codebase to use the latest LibreMetaverse. From the legacy version in use now an obvious change was the factoring of OpenJPEG out of the codebase into what I think is a separate OpenJPEG library (named -LMV). Is this a correct version to use?

The other issue is a missing Class in .Types). The Halcyon code was using Ray defined there. Did this move or get renamed? If not, I can dig up the source in an older tree and migrate it to Halcyon directly. Probably the more correct thing to do if the Ray class isn't used in LibreMetaverse directly.

Finally what is the best way to follow up on questions like this? I can enter issues and I don't expect a ton of this sort of question but I'm happy to use a different mechanism if opening issues feels wrong.

Assets.RequestInventoryAsset is broken for reading notecards [SL]

libremetaverse
Known broken versions:

  • 2.0.10.575
  • 2.0.6.545
  • 2.0.3.521

works on version:

  • 1.9.17.425

Radegast

  • Known broken in version: 2.41
  • works on version: 2.30

example code

    public void NotecardToMem(string notecardUUID)
    {
        if (UUID.TryParse(notecardUUID, out UUID inventoryUUID) == false)
        {
             client.Self.Chat("Unable to read notecard UUID", 0, ChatType.Normal);
        }
        InventoryItem A = client.Inventory.FetchItem(inventoryUUID, client.Self.AgentID, 2000);
        if (A == null)
        {
            client.Self.Chat("Unable to find notecard with UUID", 0, ChatType.Normal);
        }
        if(A.InventoryType != InventoryType.Notecard)
        {
            client.Self.Chat("Unable to find notecard with UUID", 0, ChatType.Normal);
        }
        var transferID = UUID.Random();
        client.Assets.RequestInventoryAsset(
            A,
            true,
            transferID,
            (AssetDownload transfer, Asset asset) =>
            {
                if (transfer.Success && transfer.ID == transferID)
                {
                    AssetNotecard n = (AssetNotecard)asset;
                    n.Decode();
                    AssetNotecard recievedNotecard = n;

                    string text = string.Empty;

                    for (int i = 0; i < n.BodyText.Length; i++)
                    {
                        char c = n.BodyText[i];

                        // Special marker for embedded things.
                        if ((int)c == 0xdbc0)
                        {
                            int index = (int)n.BodyText[++i] - 0xdc00;
                            InventoryItem e = n.EmbeddedItems[index];
                            text += " (embedded) ";
                        }
                        else
                        {
                            text += c;
                        }
                    }
                    client.Self.Chat(text, 0, ChatType.Normal);

                }
                else
                {
                    client.Self.Chat("Transfer failed", 0, ChatType.Normal);
                }
            }
        );
        client.Self.Chat("working on it", 0, ChatType.Normal);
    }

expected output:
working on it
"Hello world"

current results:
Failed to fetch asset : BadRequest Bad Request

notes:
if you request a asset that was loaded with the older version and then update to current
and redo the request it works as expected.

Feature request: Experience controls

The following Experience controls are missing

 Parcel
          Allowed
                    [Add/Remove]
          Block
                   [Add/Remove]
 
 Estate
           Key
                   [Add/Remove]
         Allowed
                    [Add/Remove]
          Block
                   [Add/Remove]

Error opening the login server connection: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on the XmlReaderSettings to Parse and pass the settings into XmlReader.Create method

I've been trying to access my ROBUST server using Radegast. I have it behind an Apache reverse proxy to take advantage of https and ModSecurity. Admittedly, this is a big part of the issue as I can access a localhost standalone region with no problems. However, https in OpenSim is a mess on its own. I managed to get it to work and it still refuses to play nice (as well as not benefit from ModSecurity protections), so I abandoned it for the time being. I have no problems accessing my ROBUST server and logging in with Firestorm.

I tracked down the DtdProcessing property in /libremetaverse/tree/master/LibreMetaverse.StructuredData/LLSD/XmlLLSD.cs line 68.

I changed it to Parse. After much wrangling, I managed to compile Radegast with the new LibreMetaverse.StructuredData. That did not work.

I later found https://www.assistmyteam.com/kb/workaround-on-error-for-security-reasons-dtd-is-prohibited-in-this-xml-document/

So I made sure that I was not behind two routers to get to the Internet. Still no dice.

So, let me try to clarify the postition I'm in:

OpenSim requires some minor code changes to replace trying to use .pfx, .p12, or what have you. It's possible to do now since OpenSim uses .net 6. That is really nice. It lets everything load without having to do certificate gymnastics. It will bind to the port and do what it is expected to do. Yet that prevents me from having ModSecurity protections on the ROBUST server since Apache cannot also bind to the port.

I intend to try using a dedicated server to test this configuration in the future for development. This I have not yet done because I'm starting a production environment and wanted something stable to use for now. I will get to it soon. That way I can test Radegast/libremetaverse hopefully without running into the DTD error. I will keep you posted.

So, for now, I'm stuck in this bind with Radegast/libremetaverse. I need this to work because I'm going to write some custom code for a Radegast plugin. Any help is greatly appreciated.

'Prims' without Faces/TextureID cause Null Reference

We have observed that some data packets arrive in the client code where the ObjectManager.ObjectUpdateCompressedHandler can receive block data where the TextureEntry is not included. This causes int textureEntryLength to have a zero in it. The subsequent call to texture entry constructor calls the FromBytes method which sets the default texture to null and returns when the length is less than 16. Understandably, without the UUID in data, the specific texture can not be setup, but by setting the Default texture to null, the result that later calls to GetFace returns a null, causing null reference exceptions in other parts of the code.

Where the data block may not have the texture UUID;
https://github.com/zangetsu-oe/libremetaverse-crystal-frost/blob/72c16209ae5c6fab31fb6e69a7c6e6b8b82ad4b1/LibreMetaverse/ObjectManager.cs#L2583-L2585

It seems to make more sense to not set this to null, but then to skip further initialization of the TextureEntry. There are other places in the code that fall back to return DefaultTexture to avoid returning a null.

The following change cleared up the problem for us, letting the code fall back the the default blank texture when GetFace is called later.
zangetsu-oe@cacae06

I'm not 100% sure what block data it is that doesn't have the texture, but I think its something to do with Linden Grass on the mainland, which sorta makes sense that these would not have faces or a user set Texture.

I would be inclined to submit the above change to not let DefaultTexture ever be null as pull request.

client.Inventory.RemoveFolder fails

Dear Sirs and friends,
I am trying to delete a folder from the root directory and seems that the folders still remains while the CreateFolder works perfect

Dim test_folder As String = "RoboBuddy Received Items"
Dim items As New List(Of KeyValuePair(Of UUID, InventoryNode))
For Each item In client.Inventory.Store.Items
If item.Value.ToString() = test_folder Then
items.Add(item)
End If
Next

For Each item In items
client.Inventory.RemoveFolder(item.Key)
Next

in the above code what i am doing is i passing each pair into a new list and then removing each uuid from the store to avoid list collection modification change.

Do i need to do anything additional?

Best regards

Client-Side baking is broken

Hi,

The client-side baking not working at all because conditional brake fills only the first item of the VisualParam array in the instance of AgentSetAppearancePacket :

if (vpIndex <= nrParams) break;

This condition leads to null ref exception in the next loop:
MyVisualParameters = new byte[set.VisualParam.Length];
for (int i = 0; i < set.VisualParam.Length; i++)
{
MyVisualParameters[i] = set.VisualParam[i].ParamValue;
}

Also if I switch the comparison to if (vpIndex >= nrParams) break;, the character appears without textures and alpha.

This issue appears on opensim instance but not in SL because LL server supports server-side baking

System.Drawing only supported on Windows

System.Drawing is only supported on Windows, well we already knew that, but .NET6 marks classes like Bitmap as unsupported outside of Windows. The joy... Convert to using ImageSharp or something like that.

InventoryManager.RequestUploadNotecardAsset always fails.

When uploading a notecard's contents using this method: RequestUploadNotecardAsset, the function always returns a fail. The asset In world when opened with a viewer reports it isn't in the database.

I can share a snippet of how I invoked this when next at the computer.

Problem with InventoryManager.RequestUpdateScriptAgentInventory

When using the function InventoryManager.RequestUpdateScriptAgentInventory the server returns a error.
Upload: The remote server returned an error: (400) Invalid viewer parameters..; Compile: False

The code I pasted was generated in the code below

Expand code block
// Encode Script function and declaration for the MessageHandlerEvent (MHE)

        private byte[] EncodeScript(string raw)
        {
            byte[] strByte = Encoding.UTF8.GetBytes(raw);
            byte[] assetData = new byte[strByte.Length];
            Array.Copy(strByte, 0, assetData, 0, strByte.Length);
            return assetData;
        }
 public delegate void MessageHandleEvent(MessageHandler.Destinations DType, UUID AgentOrSession, string MSG, int channel = 0);
                    // Create a Inventory Item (Similar code to this can be seen in TestClient code / UploadScriptCommand.cs)
                    grid.Inventory.RequestCreateItem(PrimaryFolder, kvp.Value.ScriptName, "Automatically uploaded script", AssetType.LSLText, UUID.Random(), InventoryType.LSL, PermissionMask.All,
                        delegate (bool success, InventoryItem item)
                        {
                            if (success)
                            {
                                MHE(source, client, "Script [" + kvp.Value.ScriptPath + "] was generated in inventory. Attempting to inject bytecode");
                                ManualResetEvent mreLSL = new ManualResetEvent(false);
                                mreLSL.Reset();
                                
                                grid.Inventory.RequestUpdateScriptAgentInventory(EncodeScript(LSLText), item.AssetUUID, true, new InventoryManager.ScriptUpdatedCallback(delegate (bool uploadSuccess, string uploadStatus, bool compileSuccess, List<string> compileMessages, UUID itemid, UUID assetid)
                                {
                                    if (uploadSuccess && compileSuccess)
                                    {
                                        mreLSL.Set();
                                        MHE(source, client, kvp.Value.ScriptName + " has been uploaded to local inventory. Sending item");
                                        grid.Inventory.GiveItem(itemid, item.Name, item.AssetType, agentKey, true);
                                    }
                                    else
                                    {
                                        MHE(source, client, "Upload: " + uploadStatus.ToString() + "; Compile: " + compileSuccess.ToString());
                                        foreach (string MSG in compileMessages)
                                        {
                                            MHE(source, client, "Compile Message: " + MSG);
                                        }
                                    }
                                }));
                                if (!mreLSL.WaitOne(TimeSpan.FromSeconds(30)))
                                {
                                    MHE(source, client, "!! Failure when uploadingbytecode. Script Length [" + LSLText.Length.ToString() + "] ByteCode Length: " + EncodeScript(LSLText).Length.ToString());
                                }
                            }
                            else
                            {
                                MHE(source, client, kvp.Value.ScriptName + " failed to upload or compile.");
                            }
                        });
                }
  • Note that the code block contains a lot of custom functions written for my bot, using this exact code snippet will likely be impossible. But you can replace all the MHE calls with client.Self.Chat

login fails due to badly formed xml

if you set the version of your client to a empty string
there are no warnings/errors but the login event fails due to "multiple root elements"

suggested actions
check if any value being added to the xml is a empty string
add a warning / error message and set it to "dev".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.