v0.2.2: updated Lidgren, railgun shells can be bought, autorestart server, netstats, tutorial moloch spawning in a wall fix, misc error checks

This commit is contained in:
Regalis
2015-10-18 22:44:30 +03:00
parent aa3882a815
commit 0e5e86e363
85 changed files with 2763 additions and 1866 deletions
+7 -7
View File
@@ -1,4 +1,4 @@
/* Copyright (c) 2010 Michael Lidgren
/* Copyright (c) 2010 Michael Lidgren
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without
@@ -37,7 +37,8 @@ namespace Lidgren.Network
public void ReadAllFields(object target, BindingFlags flags)
{
if (target == null)
return;
throw new ArgumentNullException("target");
Type tp = target.GetType();
FieldInfo[] fields = tp.GetFields(flags);
@@ -76,8 +77,6 @@ namespace Lidgren.Network
if (target == null)
throw new ArgumentNullException("target");
if (target == null)
return;
Type tp = target.GetType();
PropertyInfo[] fields = tp.GetProperties(flags);
@@ -94,10 +93,11 @@ namespace Lidgren.Network
value = readMethod.Invoke(this, null);
// set the value
MethodInfo setMethod = fi.GetSetMethod((flags & BindingFlags.NonPublic) == BindingFlags.NonPublic);
setMethod.Invoke(target, new object[] { value });
var setMethod = fi.GetSetMethod();
if (setMethod != null)
setMethod.Invoke(target, new object[] { value });
}
}
}
}
}
}