1. I have a problem with the server socket. It has to be something on a remote control. I'm trying to do it this way:

    Code:
    using System;
    using System.Net;
    using System.Net.Sockets;
    using System.Text;
    using System.Threading;using Oxide.Core;
    using Oxide.Core.Libraries;namespace Oxide.Plugins
    {
        class Remote : HurtworldPlugin
        {
            void Init()
            {
                IPEndPoint localEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 29000);
                //IPEndPoint localEndPoint = CreateIPEndPoint("127.0.0.1:29000");            // Create a TCP/IP socket.
                Socket listener = new Socket(AddressFamily.InterNetwork,
                    SocketType.Stream, ProtocolType.Tcp);            // Bind the socket to the local endpoint and listen for incoming connections.
                listener.Bind(localEndPoint);
                listener.Listen(100);            // ...        }
        }
    }
    
    But I getting an error:

    Code:
    15:13 [Error] Failed to initialize plugin 'Remote v1.0.0' (UnauthorizedAccessException: System access is restricted, you are not allowed to use System.Net.IPEndPoint)
    15:13 [Debug]   at Oxide.Plugins.Remote.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.HandleAddedToManager (Oxide.Core.Plugins.PluginManager manager) [0x00000] in <filename unknown>:0 
    How to properly do a simple socket?
     
  2. Wulf

    Wulf Community Admin

    You'd need to use an extension to handle that, it isn't available in plugins due to the sandbox.
     
  3. From your other posts I know that the extension should be placed in Hurtworld_Data/Managed. But how to do them? It must be in the format .dll? You can give tips on how you can do extension?
     
  4. Wulf

    Wulf Community Admin

    Most of Oxide is extensions, but yes, they'd be placed under Managed as a .dll. You can see some examples here: Oxide/Extensions at master · OxideMod/Oxide · GitHub. Keep in mind that not all hosts allow custom extensions though.
     
  5. Thanks, socket works. I have not used before C#. How in the extension call any server command and chat command? I have a problem to get to ConsoleManager.Instance?.ExecuteCommand() or similar method executeCommand in extension.
     
  6. Wulf

    Wulf Community Admin

    You'd need the correct using statements and references. You may be able to use API already wrapped by Oxide, but I've not tried with custom extensions.