Fix NullReferenceException on start.

This commit is contained in:
Sardelka
2022-06-04 12:04:02 +08:00
parent 546f4b16f4
commit d061b5ecbe
5 changed files with 24 additions and 7 deletions

View File

@ -44,6 +44,7 @@ namespace RageCoop.Client
/// </summary>
public Main()
{
Settings = Util.ReadSettings();
Logger=new Core.Logging.Logger()
{
LogPath="Scripts\\RageCoop\\RageCoop.Client.log",
@ -74,7 +75,6 @@ namespace RageCoop.Client
}*/
SyncedPedsGroup=World.AddRelationshipGroup("SYNCPED");
Game.Player.Character.RelationshipGroup.SetRelationshipBetweenGroups(SyncedPedsGroup, Relationship.Neutral, true);
Settings = Util.ReadSettings();
Networking.Start();
#if !NON_INTERACTIVE
#endif

View File

@ -11,9 +11,7 @@ namespace RageCoop.Client.Scripting
{
internal class Engine : Core.Scripting.ScriptingEngine
{
public Engine() : base(typeof(ClientScript), Main.Logger)
{
public Engine() : base(typeof(ClientScript), Main.Logger) { }
}
}
}

View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RageCoop.Core.Scripting;
namespace RageCoop.Server.Scripting
{
internal class Engine:ScriptingEngine
{
public Engine() : base(typeof(ServerScript), Program.Logger)
{
}
public static void Load()
{
}
}
}

View File

@ -72,8 +72,8 @@ namespace RageCoop.Server
}
else
{
Program.Logger.Error("Port forwarding failed! Your router may not support UPnP.");
Program.Logger.Warning("If you and your friends can join this server, please ignore this error or set UPnP in Settings.xml to false!");
Program.Logger.Warning("Port forwarding failed! Your router may not support UPnP.");
Program.Logger.Info("If you and your friends can join this server, please ignore this error or set UPnP in Settings.xml to false!");
}
}
@ -203,7 +203,6 @@ namespace RageCoop.Server
Program.Logger.Error(e.InnerException.Message);
}
}
Program.Logger.Info("Searching for client-side files...");
DownloadManager.CheckForDirectoryAndFiles();