Remember to set the master server ip and port before calling this function. This method will also set the values for, Register this game server on the master server. Then way you can be sure that the next list returned is up to date. You can clear the current host list with. Returns the latest host list received from the MasterServer. Usage introduction see the section Master Server in the manual.Ĭlear the host list which was received from the stand alone master server. Which is hosted separately without the need of the Unity editor.įor an overview of the Master Server as well as Methods here are used to communicate with the Master Server itself Hosts or fetch host lists for your specific game type using this class. Server can be used as a listing server (lobby) for game servers. Use methods in this class to communicate with a stand alone uLink Master Server. Set the level to Debug for the category = delegate(uLink.NetworkLogFlags flags, object args) This code replaces the default debugWriter with a new delegate Public class CustomFileLog : MonoBehaviour This example code shows how to send log messages to a file. In your own implementation you can choose another destination for log messages. Implement one or several new delegates if there is a need to replace the default Writers in this class. Gets the lowest detailed log level configured for any of the log categories (flags), where Gets the highest detailed log level configured for any of the log categories (flags), where If the categories (flags) is set to a lower log level than then overrules the detailed log level when logging. Sets a detailed logging level for the specified categories (flags). Returns true if the the categories (flags) are set by either or. (, "The server received an illegal Fire RPCs from player ", playerName) (, "The server has now received ", numberOfFireRPCs, " Fire RPCs from player ", playerName) Įxample code for writing a message like "The server received an illegal Fire RPCs from player Paul55". Is turned off, and that is a waste of CPU resources. The concatenation would be executed even if the logging Instead send the arguments individually just like the example code provided here. Please note that it is important NOT to use string concatenation with + to compose a nice log message. (, "The server has now received ", numberOfFireRPCs, " Fire RPCs from player ", playerName) The objects that are to be concatenated to a log message if the info log level for the flags is set Turned off, and that is a waste of CPU resources. The concatenation would be executed even if the log level for the flags are Instead send the objects individually just like the example code provided here. Please note that it is important to NOT use string concatenation with + to compose the log message. The objects that are to be concatenated to a log message if the debug log level for the flags is setĮxample code for writing a message like "The server has now received 88 Fire RPCs from player Paul55". The categories this log message belongs to Sends a log message to the delegate if the log level for the specifed categories (flags) are set by either or. This can be overruled by setting a detailed log level for an individual category to a higher log level via. The minimum level for all logging categories. Default implementation send output to the Editor console / output_log.txt file. Look at for code example replacing the default Writer. (CHEAT_ATTEMPTS, "Detected cheat attempt nr ", i, " in the demo code.") Set the log level for cheat attempts to the highest = Debug Public const uLink.NetworkLogFlags LEVEL_LOAD_EVENT = 3 Public const uLink.NetworkLogFlags TRADE_EVENT = 2 Public const uLink.NetworkLogFlags CHEAT_ATTEMPTS = 1 Define your own log categories like this This example shows how to create and use your own log categories: Screen or file(s) or database or whatever you like.įinally, it is possible to add your own logging categories like “Trading”, “Cheating attempts” or “Level loding”Īnd set the log level individually for these categories. With your own implementations it is possible to log events to Replace the 4 public Writers with your own faster implementations: Use this class to go one step further and control the log settings in your own code. There it is possbile to configure logging level per category and use the generated output to debug most problems.īy default the log messages are written to the Unity console window in the editor or the log file output_log.txt when The best way to get started with logging in uLink is to use the Editor menu: uLink - Edit Settings.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |