be more obvious pleaseWhy does not output to the console work in a new thread?
Can anyone encountered - not how to not send a message to the server console from a new thread
be more obvious please
public class Init
{
public static void Initialize()
{
new Thread(new Class1().Test).Start(); // server-side
}
}
public class Class1
{
public void Test()
{
System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.Highest;
UnityEngine.Debug.Log("Initialize");
}
}
to log try Logger.Log("Initialize");C#:public class Init { public static void Initialize() { new Thread(new Class1().Test).Start(); // server-side } }But the message never gets meCode:public class Class1 { public void Test() { System.Threading.Thread.CurrentThread.Priority = System.Threading.ThreadPriority.Highest; UnityEngine.Debug.Log("Initialize"); } }
It does not work! From the new thread it does not send out as for some reasonto log try Logger.Log("Initialize");
He also uses Debug.Log.It does not work! From the new thread it does not send out as for some reason
public static void Log(string Message, UnityEngine.Object Context = null)
{
Debug.Log(Message, Context);
Message = "[Console] " + Message;
WriteLog(Message);
}
Do you offer to install a new thread as the main one?EDIT: https://github.com/jakkee/FougeritePlugins/blob/master/CSharpPlugins/CountryBlackList/CountryBlackList.cs
Look at my PlayerConnected & Threaded_PlayerConnected() function
Thread.CurrentThread.IsBackground
Still does not print a message to the server consoleEDIT: https://github.com/jakkee/FougeritePlugins/blob/master/CSharpPlugins/CountryBlackList/CountryBlackList.cs
Look at my PlayerConnected & Threaded_PlayerConnected() function
Included - found a way to use for this ConsoleSystem.printWhat code are you using?
Also do you have Debug enabled in Fougerite.cfg?
If I'm not wrong you should use ConsoleSystem.Print("some message");Why does not output to the console work in a new thread?
Can anyone encountered - not how to not send a message to the server console from a new thread
I found a better way for myselfIf I'm not wrong you should use ConsoleSystem.Print("some message");
Or
ConsoleSystem.LogError("some message");
To show messages called from a job in the background can be displayed
Some example here: https://github.com/salvadj1/AutoSave/blob/master/AutoSave_v101.cs#L124
Also In the same way if you need to send commands to the console .... ConsoleSystem.Run("save.all");
Example here: https://github.com/salvadj1/AutoSave/blob/master/AutoSave_v101.cs#L127
Try use it and tell me if work
Regards!!
[DllImport("dc4_lib.dll")]
public static extern string Debug_log(string text);
NetworkManager.Debug_log(((IPEndPoint)Client.Client.RemoteEndPoint).Address + " disconnected");
Because Unity requires It.Why does not output to the console work in a new thread?
Can anyone encountered - not how to not send a message to the server console from a new thread