I have a slightly different question, but related to the Unity headless server itself, so I'm posting here.
I was able to setup a server and run it from smartfox by following the steps provided in the blog. However, I am not able to see any logs from the Unity headless server anywhere. I have tried both Unity's Debug.Log syntax as well as C#'s Console.WriteLine syntax. Is there any way we can see these logs in smartfox? Or should I try to view them somewhere else?
If possible, I would also like to know what is the best way to do this type of development so that I can debug and resolve issues during development as well as after it is goes to production.
"Unity and Smartfox Best Of Both Worlds" How to integrate scores and currency?
-
- Posts: 3
- Joined: 25 Jul 2022, 18:09
Re: "Unity and Smartfox Best Of Both Worlds" How to integrate scores and currency?
@sanathkukkillaya
Since the Unity headless server runs in a separate process there's no direct way to pass its internal logs to SmartFox, unless you'd use a persistent connection towards SFS and send the log data through that channel and then log it via the standard logging in SFS.
Other than that you could simply write log messages to the local file system.
Here's a video that shows a way to implement it --> https://www.youtube.com/watch?v=A12GhwUxTrY
Cheers
Since the Unity headless server runs in a separate process there's no direct way to pass its internal logs to SmartFox, unless you'd use a persistent connection towards SFS and send the log data through that channel and then log it via the standard logging in SFS.
Other than that you could simply write log messages to the local file system.
Here's a video that shows a way to implement it --> https://www.youtube.com/watch?v=A12GhwUxTrY
Cheers
-
- Posts: 3
- Joined: 25 Jul 2022, 18:09
Re: "Unity and Smartfox Best Of Both Worlds" How to integrate scores and currency?
@Lapo, thanks for that quick reply. The tutorial on saving logs looks super helpful. However, I also have managed to establish a connection to the SFS server. But I was not clear regarding the standard logging via SFS.
I tried using Logger class in Unity, but that seems to be printing it to the Unity console rather than the smartfox logs. I tried EnablingEventDispatch to true, but still there was no logging on SFS. Should I send the log string as a SFS packet, and then log from the extension using trace?
I tried using Logger class in Unity, but that seems to be printing it to the Unity console rather than the smartfox logs. I tried EnablingEventDispatch to true, but still there was no logging on SFS. Should I send the log string as a SFS packet, and then log from the extension using trace?
Re: "Unity and Smartfox Best Of Both Worlds" How to integrate scores and currency?
The client is not supposed to generate log messages on the server, simply because you need to keep the two sides separated. They are two different contexts.
I understand your use case, but even in that case mixing the SFS2X logs with those of the headless Unity server would make consulting the logs way more complicated.
Generating separate logs is the way to go.
Cheers
I understand your use case, but even in that case mixing the SFS2X logs with those of the headless Unity server would make consulting the logs way more complicated.
Generating separate logs is the way to go.
Cheers
-
- Posts: 3
- Joined: 25 Jul 2022, 18:09
Re: "Unity and Smartfox Best Of Both Worlds" How to integrate scores and currency?
What you say does make sense. Thanks for the clarifications.
Who is online
Users browsing this forum: Stevenor and 84 guests