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:
But I getting an error: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); // ... } } }
How to properly do a simple socket?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
Accessing System.Net.Sockets?
Discussion in 'Hurtworld Development' started by DestinyClan.Hekey, May 5, 2016.
-
Wulf Community Admin
You'd need to use an extension to handle that, it isn't available in plugins due to the sandbox.
-
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?
-
Wulf Community Admin
-
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.
-
Wulf Community Admin