Small changes and bug fixes
This commit is contained in:
parent
d244cd393a
commit
3bcda302fe
@ -539,7 +539,7 @@ namespace CoopClient
|
||||
}
|
||||
else
|
||||
{
|
||||
GTA.UI.Notification.Show("[DecodeNativeCall][" + packet.Hash + "]: Type of argument not found!");
|
||||
GTA.UI.Notification.Show("[DecodeNativeResponse][" + packet.Hash + "]: Type of argument not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -84,12 +84,14 @@ namespace CoopServer
|
||||
NetConnection userConnection = Server.MainNetServer.Connections.Find(x => x.RemoteUniqueIdentifier == ID);
|
||||
if (userConnection == null)
|
||||
{
|
||||
Logging.Error($"[Client->SendNativeCall(ulong hash, params object[] args)]: Connection \"{ID}\" not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
List<NativeArgument> arguments = Util.ParseNativeArguments(args);
|
||||
if (arguments == null)
|
||||
if (arguments == null || args.Length == 0)
|
||||
{
|
||||
Logging.Error($"[Client->SendNativeCall(ulong hash, params object[] args)]: Missing arguments!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -116,6 +118,7 @@ namespace CoopServer
|
||||
NetConnection userConnection = Server.MainNetServer.Connections.Find(x => x.RemoteUniqueIdentifier == ID);
|
||||
if (userConnection == null)
|
||||
{
|
||||
Logging.Error($"[Client->SendNativeResponse(Action<object> callback, ulong hash, Type type, params object[] args)]: Connection \"{ID}\" not found!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -143,12 +146,14 @@ namespace CoopServer
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Error($"[Client->SendNativeResponse(Action<object> callback, ulong hash, Type type, params object[] args)]: Argument does not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
List<NativeArgument> arguments = Util.ParseNativeArguments(args);
|
||||
if (arguments == null)
|
||||
{
|
||||
Logging.Error($"[Client->SendNativeResponse(Action<object> callback, ulong hash, Type type, params object[] args)]: One or more arguments do not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyVersion>1.4.6.0001</AssemblyVersion>
|
||||
<AssemblyVersion>1.4.7.0001</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<RepositoryUrl>https://github.com/GTACOOP-R/GTACoop-R</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
@ -193,6 +193,7 @@ namespace CoopServer
|
||||
private void Listen()
|
||||
{
|
||||
Logging.Info("Listening for clients");
|
||||
Logging.Info("Please use CTRL + C if you want to stop the server!");
|
||||
|
||||
while (!Program.ReadyToStop)
|
||||
{
|
||||
|
@ -238,9 +238,10 @@ namespace CoopServer
|
||||
return;
|
||||
}
|
||||
|
||||
List<NativeArgument> arguments;
|
||||
if ((arguments = Util.ParseNativeArguments(args)) == null)
|
||||
List<NativeArgument> arguments = Util.ParseNativeArguments(args);
|
||||
if (arguments == null)
|
||||
{
|
||||
Logging.Error($"[ServerScript->SendNativeCallToAll(ulong hash, params object[] args)]: One or more arguments do not exist!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,11 @@ namespace CoopServer
|
||||
{
|
||||
public static List<NativeArgument> ParseNativeArguments(params object[] args)
|
||||
{
|
||||
List<NativeArgument> result = new();
|
||||
List<NativeArgument> result = null;
|
||||
|
||||
if (args != null && args.Length > 0)
|
||||
{
|
||||
result = new();
|
||||
|
||||
foreach (object arg in args)
|
||||
{
|
||||
@ -40,10 +44,10 @@ namespace CoopServer
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Error("[Util->ParseNativeArguments(params object[] args)]: Type of argument not found!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user