예제 #1
0
        private void InitServer()
        {
            _isServerRegistered = true;
            ServerLogger.Init(ServerLogFileName, ServerLoggingLevel, false, MyAPIGateway.Session.IsSinglePlayerOffline() ? 0 : 5); // comment this out if logging is not required for the Server.
            ServerLogger.WriteInfo($"{ModName} Server Log Started");
            ServerLogger.WriteInfo($"{ModName} Server Version {ModCommunicationVersion}");
            //if (ServerLogger.IsActive) //if (ClientLogger.IsActive) // TODO: determine is this is needed any more?
            TextLogger.WriteGameLog($"##Mod## {ModName} Server Logging File: {ServerLogger.LogFile}");

            ServerLogger.WriteStart("RegisterMessageHandler");
            MyAPIGateway.Multiplayer.RegisterMessageHandler(ServerConnectionId, _serverMessageHandler);

            ServerLogger.Flush();
        }