JackHunter Posted August 3, 2020 Posted August 3, 2020 (edited) Hi all, I modified the old ServerMan and so that you can send commands to the console. Download Add new class to server-side: public class CommandLine { public static void CmdInput() { while(true){ string command = Console.ReadLine(); if (command.Length > 0) { if (command.Equals("notifyhello")) { NAPI.Notification.SendNotificationToAll("Hello!"); NAPI.Util.ConsoleOutput("[INFO] You send notification 'Hello!' to all"); } else { Console.WriteLine("ERROR: Command not found!"); } } } } } And add into server-side ResourceStart event: [ServerEvent(Event.ResourceStart)] public void ResourceStart() { Thread cmdLine = new Thread(new ThreadStart(CommandLine.CmdInput)); cmdLine.Start(); } Edited August 4, 2020 by JackHunter
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now