mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 18:32:45 +00:00
Merge pull request #298 from misternebula/fix-blank-lines
Enforce IDE2000, IDE2003
This commit is contained in:
commit
9b197e1ea1
@ -37,6 +37,7 @@ namespace QNetWeaver
|
||||
Console.WriteLine("No symbols for " + inputFile);
|
||||
result = null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -48,6 +49,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (var typeReference in ResolveInheritanceHierarchy(typeRef))
|
||||
{
|
||||
if (typeReference.IsGenericInstance)
|
||||
@ -63,6 +65,7 @@ namespace QNetWeaver
|
||||
catch
|
||||
{
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -75,6 +78,7 @@ namespace QNetWeaver
|
||||
yield return Weaver.objectType;
|
||||
yield break;
|
||||
}
|
||||
|
||||
while (type != null && type.FullName != Weaver.objectType.FullName)
|
||||
{
|
||||
yield return type;
|
||||
@ -85,6 +89,7 @@ namespace QNetWeaver
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
type = typeDefinition.BaseType;
|
||||
}
|
||||
catch
|
||||
@ -92,6 +97,7 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
yield return Weaver.objectType;
|
||||
yield break;
|
||||
}
|
||||
@ -122,6 +128,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = type.Name;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -132,6 +139,7 @@ namespace QNetWeaver
|
||||
{
|
||||
assemblyResolver = new DefaultAssemblyResolver();
|
||||
}
|
||||
|
||||
var addSearchDirectoryHelper = new Helpers.AddSearchDirectoryHelper(assemblyResolver);
|
||||
addSearchDirectoryHelper.AddSearchDirectory(Path.GetDirectoryName(assemblyPath));
|
||||
addSearchDirectoryHelper.AddSearchDirectory(UnityEngineDLLDirectoryName());
|
||||
@ -144,6 +152,7 @@ namespace QNetWeaver
|
||||
addSearchDirectoryHelper.AddSearchDirectory(directory);
|
||||
}
|
||||
}
|
||||
|
||||
readerParameters.AssemblyResolver = assemblyResolver;
|
||||
readerParameters.SymbolReaderProvider = GetSymbolReaderProvider(assemblyPath);
|
||||
return readerParameters;
|
||||
@ -160,6 +169,7 @@ namespace QNetWeaver
|
||||
{
|
||||
writerParameters.SymbolWriterProvider = new MdbWriterProvider();
|
||||
}
|
||||
|
||||
return writerParameters;
|
||||
}
|
||||
|
||||
@ -169,11 +179,13 @@ namespace QNetWeaver
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
var genericInstanceType = new GenericInstanceType(self);
|
||||
foreach (var item in arguments)
|
||||
{
|
||||
genericInstanceType.GenericArguments.Add(item);
|
||||
}
|
||||
|
||||
return genericInstanceType;
|
||||
}
|
||||
|
||||
@ -189,10 +201,12 @@ namespace QNetWeaver
|
||||
{
|
||||
methodReference.Parameters.Add(new ParameterDefinition(parameterDefinition.ParameterType));
|
||||
}
|
||||
|
||||
foreach (var genericParameter in self.GenericParameters)
|
||||
{
|
||||
methodReference.GenericParameters.Add(new GenericParameter(genericParameter.Name, methodReference));
|
||||
}
|
||||
|
||||
return methodReference;
|
||||
}
|
||||
|
||||
@ -208,6 +222,7 @@ namespace QNetWeaver
|
||||
{
|
||||
throw new Exception("Assembly resolver doesn't implement AddSearchDirectory method.");
|
||||
}
|
||||
|
||||
_addSearchDirectory = (Helpers.AddSearchDirectoryHelper.AddSearchDirectoryDelegate)Delegate.CreateDelegate(typeof(Helpers.AddSearchDirectoryHelper.AddSearchDirectoryDelegate), assemblyResolver, method);
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_td.Fields.Count != 0)
|
||||
{
|
||||
foreach (var fieldDefinition in m_td.Fields)
|
||||
@ -52,6 +53,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("Serialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkWriterType)));
|
||||
var ilprocessor = methodDefinition2.Body.GetILProcessor();
|
||||
@ -74,6 +76,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fieldDefinition2.FieldType.Resolve().IsInterface)
|
||||
{
|
||||
Weaver.fail = true;
|
||||
@ -89,6 +92,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
var writeFunc = Weaver.GetWriteFunc(fieldDefinition2.FieldType);
|
||||
if (writeFunc == null)
|
||||
{
|
||||
@ -105,12 +109,14 @@ namespace QNetWeaver
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldfld, fieldDefinition2));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, writeFunc));
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Methods.Add(methodDefinition2);
|
||||
}
|
||||
@ -126,6 +132,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_td.Fields.Count != 0)
|
||||
{
|
||||
var methodDefinition2 = new MethodDefinition("Deserialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
@ -149,12 +156,14 @@ namespace QNetWeaver
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, readFunc));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Stfld, fieldDefinition));
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Methods.Add(methodDefinition2);
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (Helpers.InheritsFromSyncList(fieldDefinition.FieldType))
|
||||
{
|
||||
Log.Error(string.Format("Script {0} defines field {1} with type {2}, but it's not a NetworkBehaviour", m_td.FullName, fieldDefinition.Name, Helpers.PrettyPrintType(fieldDefinition.FieldType)));
|
||||
@ -57,6 +58,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
Weaver.fail = true;
|
||||
}
|
||||
|
||||
if (customAttribute.AttributeType.FullName == Weaver.ClientRpcType.FullName)
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -69,6 +71,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
Weaver.fail = true;
|
||||
}
|
||||
|
||||
if (customAttribute.AttributeType.FullName == Weaver.TargetRpcType.FullName)
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -81,6 +84,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
Weaver.fail = true;
|
||||
}
|
||||
|
||||
var text = customAttribute.Constructor.DeclaringType.ToString();
|
||||
if (text == "UnityEngine.Networking.ServerAttribute")
|
||||
{
|
||||
|
@ -117,12 +117,14 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
worker.Append(worker.Create(OpCodes.Ldloc_0));
|
||||
worker.Append(worker.Create(OpCodes.Ldarg, num));
|
||||
worker.Append(worker.Create(OpCodes.Call, writeFunc));
|
||||
num += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -135,6 +137,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("UNetVersion", MethodAttributes.Private, Weaver.voidType);
|
||||
var ilprocessor = methodDefinition2.Body.GetILProcessor();
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
@ -169,6 +172,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
cctorMethodDef.Body.Instructions.RemoveAt(cctorMethodDef.Body.Instructions.Count - 1);
|
||||
}
|
||||
}
|
||||
@ -191,6 +195,7 @@ namespace QNetWeaver
|
||||
ctorMethodDef.Body.Instructions.RemoveAt(ctorMethodDef.Body.Instructions.Count - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
Weaver.fail = true;
|
||||
Log.Error("No .ctor for " + m_td.Name);
|
||||
return;
|
||||
@ -266,6 +271,7 @@ namespace QNetWeaver
|
||||
GenerateCommandDelegate(ilprocessor2, Weaver.registerSyncListDelegateReference, m_SyncListInvocationFuncs[syncListIndex], field5);
|
||||
syncListIndex++;
|
||||
}
|
||||
|
||||
ilprocessor2.Append(ilprocessor2.Create(OpCodes.Ldstr, m_td.Name));
|
||||
ilprocessor2.Append(ilprocessor2.Create(OpCodes.Ldc_I4, m_QosChannel));
|
||||
ilprocessor2.Append(ilprocessor2.Create(OpCodes.Call, Weaver.RegisterBehaviourReference));
|
||||
@ -274,6 +280,7 @@ namespace QNetWeaver
|
||||
{
|
||||
m_td.Methods.Add(cctorMethodDef);
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Attributes = (m_td.Attributes & ~TypeAttributes.BeforeFieldInit);
|
||||
if (m_SyncLists.Count != 0)
|
||||
@ -288,6 +295,7 @@ namespace QNetWeaver
|
||||
flag2 = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (methodDefinition8 != null)
|
||||
{
|
||||
if (methodDefinition8.Body.Instructions.Count != 0)
|
||||
@ -299,6 +307,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
methodDefinition8.Body.Instructions.RemoveAt(methodDefinition8.Body.Instructions.Count - 1);
|
||||
}
|
||||
}
|
||||
@ -306,17 +315,20 @@ namespace QNetWeaver
|
||||
{
|
||||
methodDefinition8 = new MethodDefinition("Awake", MethodAttributes.Private, Weaver.voidType);
|
||||
}
|
||||
|
||||
var ilprocessor3 = methodDefinition8.Body.GetILProcessor();
|
||||
if (!flag2)
|
||||
{
|
||||
CheckForCustomBaseClassAwakeMethod(ilprocessor3);
|
||||
}
|
||||
|
||||
var num6 = 0;
|
||||
foreach (var fd in m_SyncLists)
|
||||
{
|
||||
GenerateSyncListInitializer(ilprocessor3, fd, num6);
|
||||
num6++;
|
||||
}
|
||||
|
||||
ilprocessor3.Append(ilprocessor3.Create(OpCodes.Ret));
|
||||
if (!flag2)
|
||||
{
|
||||
@ -339,6 +351,7 @@ namespace QNetWeaver
|
||||
awakeWorker.Append(awakeWorker.Create(OpCodes.Call, methodDefinition));
|
||||
break;
|
||||
}
|
||||
|
||||
baseType = baseType.Resolve().BaseType;
|
||||
}
|
||||
}
|
||||
@ -356,6 +369,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var method = Weaver.scriptDef.MainModule.ImportReference(Enumerable.First<MethodDefinition>(fd.FieldType.Resolve().Methods, (MethodDefinition x) => x.Name == ".ctor" && !x.HasParameters));
|
||||
ctorWorker.Append(ctorWorker.Create(OpCodes.Ldarg_0));
|
||||
ctorWorker.Append(ctorWorker.Create(OpCodes.Newobj, method));
|
||||
@ -402,6 +416,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("OnSerialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.boolType);
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkWriterType)));
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("forceAll", ParameterAttributes.None, Weaver.boolType));
|
||||
@ -440,6 +455,7 @@ namespace QNetWeaver
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Methods.Add(methodDefinition2);
|
||||
}
|
||||
@ -469,8 +485,10 @@ namespace QNetWeaver
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, writeFunc));
|
||||
}
|
||||
|
||||
Weaver.DLog(m_td, $" Finish foreach 1", new object[0]);
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldc_I4_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
@ -512,10 +530,12 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, writeFunc2));
|
||||
ilprocessor.Append(instruction2);
|
||||
num++;
|
||||
}
|
||||
|
||||
Weaver.DLog(m_td, $" Finish foreach 2", new object[0]);
|
||||
WriteDirtyCheck(ilprocessor, false);
|
||||
if (Weaver.generateLogErrors)
|
||||
@ -523,6 +543,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldstr, "Injected Serialize " + m_td.Name));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, Weaver.logErrorReference));
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
@ -533,10 +554,12 @@ namespace QNetWeaver
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Methods.Add(methodDefinition2);
|
||||
Weaver.DLog(m_td, $" Finish", new object[0]);
|
||||
}
|
||||
|
||||
Weaver.DLog(m_td, $" Finish", new object[0]);
|
||||
}
|
||||
|
||||
@ -554,6 +577,7 @@ namespace QNetWeaver
|
||||
serWorker.Append(serWorker.Create(OpCodes.Ldc_I4_1));
|
||||
serWorker.Append(serWorker.Create(OpCodes.Stloc_0));
|
||||
}
|
||||
|
||||
serWorker.Append(instruction);
|
||||
}
|
||||
|
||||
@ -574,6 +598,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -599,16 +624,19 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (methodDefinition.Parameters[0].ParameterType != syncVar.FieldType)
|
||||
{
|
||||
Log.Error("SyncVar Hook function " + text + " has wrong type signature for " + m_td.Name);
|
||||
Weaver.fail = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
foundMethod = methodDefinition;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error("SyncVar Hook function " + text + " not found for " + m_td.Name);
|
||||
Weaver.fail = true;
|
||||
return false;
|
||||
@ -616,6 +644,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -651,15 +680,18 @@ namespace QNetWeaver
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (HasMethod("GetNetworkChannel"))
|
||||
{
|
||||
Log.Error("GetNetworkChannel, is already implemented, please make sure you either use NetworkSettings or GetNetworkChannel");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
m_QosChannel = (int)customAttributeNamedArgument.Argument.Value;
|
||||
GenerateNetworkChannelSetting(m_QosChannel);
|
||||
}
|
||||
|
||||
if (customAttributeNamedArgument.Name == "sendInterval")
|
||||
{
|
||||
if (Math.Abs((float)customAttributeNamedArgument.Argument.Value - 0.1f) > 1E-05f)
|
||||
@ -670,6 +702,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
GenerateNetworkIntervalSetting((float)customAttributeNamedArgument.Argument.Value);
|
||||
}
|
||||
}
|
||||
@ -690,6 +723,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var fieldDefinition in m_SyncVars)
|
||||
{
|
||||
if (fieldDefinition.FieldType.FullName == Weaver.gameObjectType.FullName)
|
||||
@ -699,6 +733,7 @@ namespace QNetWeaver
|
||||
methodDefinition = new MethodDefinition("PreStartClient", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
ilprocessor = methodDefinition.Body.GetILProcessor();
|
||||
}
|
||||
|
||||
var field = m_SyncVarNetIds[m_NetIdFieldCounter];
|
||||
m_NetIdFieldCounter++;
|
||||
var instruction = ilprocessor.Create(OpCodes.Nop);
|
||||
@ -714,6 +749,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(instruction);
|
||||
}
|
||||
}
|
||||
|
||||
if (methodDefinition != null)
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
@ -732,6 +768,7 @@ namespace QNetWeaver
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("OnDeserialize", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkReaderType)));
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("initialState", ParameterAttributes.None, Weaver.boolType));
|
||||
@ -747,6 +784,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, methodReference));
|
||||
}
|
||||
}
|
||||
|
||||
if (m_SyncVars.Count == 0)
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
@ -794,11 +832,13 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, readFunc));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Stfld, fieldDefinition));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
ilprocessor.Append(instruction);
|
||||
methodDefinition2.Body.InitLocals = true;
|
||||
@ -839,10 +879,12 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CheckForHookFunction(fieldDefinition2, out var methodDefinition3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (methodDefinition3 == null)
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
@ -858,14 +900,17 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, methodDefinition3));
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(instruction2);
|
||||
num++;
|
||||
}
|
||||
|
||||
if (Weaver.generateLogErrors)
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldstr, "Injected Deserialize " + m_td.Name));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, Weaver.logErrorReference));
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_td.Methods.Add(methodDefinition2);
|
||||
}
|
||||
@ -894,6 +939,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
worker.Append(worker.Create(OpCodes.Ldarg_1));
|
||||
worker.Append(worker.Create(OpCodes.Call, readFunc));
|
||||
if (parameterDefinition.ParameterType.FullName == Weaver.singleType.FullName)
|
||||
@ -906,6 +952,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -929,6 +976,7 @@ namespace QNetWeaver
|
||||
AddInvokeParameters(methodDefinition.Parameters);
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -945,6 +993,7 @@ namespace QNetWeaver
|
||||
{
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition(parameterDefinition.Name, ParameterAttributes.None, parameterDefinition.ParameterType));
|
||||
}
|
||||
|
||||
var ilprocessor = methodDefinition.Body.GetILProcessor();
|
||||
var label = ilprocessor.Create(OpCodes.Nop);
|
||||
WriteSetupLocals(ilprocessor);
|
||||
@ -953,6 +1002,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldstr, "Call Command function " + md.Name));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, Weaver.logErrorReference));
|
||||
}
|
||||
|
||||
WriteClientActiveCheck(ilprocessor, md.Name, label, "Command function");
|
||||
var instruction = ilprocessor.Create(OpCodes.Nop);
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
@ -963,6 +1013,7 @@ namespace QNetWeaver
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg, i + 1));
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, md));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
ilprocessor.Append(instruction);
|
||||
@ -995,12 +1046,14 @@ namespace QNetWeaver
|
||||
value = (int)customAttributeNamedArgument.Argument.Value;
|
||||
}
|
||||
}
|
||||
|
||||
var text = md.Name;
|
||||
var num = text.IndexOf("InvokeCmd");
|
||||
if (num > -1)
|
||||
{
|
||||
text = text.Substring("InvokeCmd".Length);
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldc_I4, value));
|
||||
@ -1009,6 +1062,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1033,6 +1087,7 @@ namespace QNetWeaver
|
||||
AddInvokeParameters(methodDefinition.Parameters);
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1056,6 +1111,7 @@ namespace QNetWeaver
|
||||
AddInvokeParameters(methodDefinition.Parameters);
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1066,6 +1122,7 @@ namespace QNetWeaver
|
||||
{
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition(parameterDefinition.Name, ParameterAttributes.None, parameterDefinition.ParameterType));
|
||||
}
|
||||
|
||||
var ilprocessor = methodDefinition.Body.GetILProcessor();
|
||||
var label = ilprocessor.Create(OpCodes.Nop);
|
||||
WriteSetupLocals(ilprocessor);
|
||||
@ -1106,12 +1163,14 @@ namespace QNetWeaver
|
||||
value = (int)customAttributeNamedArgument.Argument.Value;
|
||||
}
|
||||
}
|
||||
|
||||
var text = md.Name;
|
||||
var num = text.IndexOf("InvokeTargetRpc");
|
||||
if (num > -1)
|
||||
{
|
||||
text = text.Substring("InvokeTargetRpc".Length);
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
@ -1121,6 +1180,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1131,6 +1191,7 @@ namespace QNetWeaver
|
||||
{
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition(parameterDefinition.Name, ParameterAttributes.None, parameterDefinition.ParameterType));
|
||||
}
|
||||
|
||||
var ilprocessor = methodDefinition.Body.GetILProcessor();
|
||||
var label = ilprocessor.Create(OpCodes.Nop);
|
||||
WriteSetupLocals(ilprocessor);
|
||||
@ -1163,12 +1224,14 @@ namespace QNetWeaver
|
||||
value = (int)customAttributeNamedArgument.Argument.Value;
|
||||
}
|
||||
}
|
||||
|
||||
var text = md.Name;
|
||||
var num = text.IndexOf("InvokeRpc");
|
||||
if (num > -1)
|
||||
{
|
||||
text = text.Substring("InvokeRpc".Length);
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldc_I4, value));
|
||||
@ -1177,6 +1240,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1229,6 +1293,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1320,9 +1385,11 @@ namespace QNetWeaver
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
Log.Error(string.Concat(new string[]
|
||||
{
|
||||
actionType,
|
||||
@ -1336,8 +1403,10 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1374,6 +1443,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = (ProcessMethodsValidateFunction(md, ca, "Command") && ProcessMethodsValidateParameters(md, ca, "Command"));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1441,6 +1511,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = ProcessMethodsValidateParameters(md, ca, "Target Rpc");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1477,6 +1548,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = (ProcessMethodsValidateFunction(md, ca, "Rpc") && ProcessMethodsValidateParameters(md, ca, "Rpc"));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1494,6 +1566,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hashSet.Contains(methodDefinition.Name))
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -1507,6 +1580,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
hashSet.Add(methodDefinition.Name);
|
||||
m_Cmds.Add(methodDefinition);
|
||||
var methodDefinition2 = ProcessCommandInvoke(methodDefinition);
|
||||
@ -1514,6 +1588,7 @@ namespace QNetWeaver
|
||||
{
|
||||
m_CmdInvocationFuncs.Add(methodDefinition2);
|
||||
}
|
||||
|
||||
var methodDefinition3 = ProcessCommandCall(methodDefinition, customAttribute);
|
||||
if (methodDefinition3 != null)
|
||||
{
|
||||
@ -1521,6 +1596,7 @@ namespace QNetWeaver
|
||||
Weaver.lists.replacedMethods.Add(methodDefinition);
|
||||
Weaver.lists.replacementMethods.Add(methodDefinition3);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else if (customAttribute.AttributeType.FullName == Weaver.TargetRpcType.FullName)
|
||||
@ -1529,6 +1605,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hashSet.Contains(methodDefinition.Name))
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -1542,6 +1619,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
hashSet.Add(methodDefinition.Name);
|
||||
m_TargetRpcs.Add(methodDefinition);
|
||||
var methodDefinition4 = ProcessTargetRpcInvoke(methodDefinition);
|
||||
@ -1549,6 +1627,7 @@ namespace QNetWeaver
|
||||
{
|
||||
m_TargetRpcInvocationFuncs.Add(methodDefinition4);
|
||||
}
|
||||
|
||||
var methodDefinition5 = ProcessTargetRpcCall(methodDefinition, customAttribute);
|
||||
if (methodDefinition5 != null)
|
||||
{
|
||||
@ -1556,6 +1635,7 @@ namespace QNetWeaver
|
||||
Weaver.lists.replacedMethods.Add(methodDefinition);
|
||||
Weaver.lists.replacementMethods.Add(methodDefinition5);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else if (customAttribute.AttributeType.FullName == Weaver.ClientRpcType.FullName)
|
||||
@ -1564,6 +1644,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (hashSet.Contains(methodDefinition.Name))
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -1577,6 +1658,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
hashSet.Add(methodDefinition.Name);
|
||||
m_Rpcs.Add(methodDefinition);
|
||||
var methodDefinition6 = ProcessRpcInvoke(methodDefinition);
|
||||
@ -1584,6 +1666,7 @@ namespace QNetWeaver
|
||||
{
|
||||
m_RpcInvocationFuncs.Add(methodDefinition6);
|
||||
}
|
||||
|
||||
var methodDefinition7 = ProcessRpcCall(methodDefinition, customAttribute);
|
||||
if (methodDefinition7 != null)
|
||||
{
|
||||
@ -1591,30 +1674,37 @@ namespace QNetWeaver
|
||||
Weaver.lists.replacedMethods.Add(methodDefinition);
|
||||
Weaver.lists.replacementMethods.Add(methodDefinition7);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in m_CmdInvocationFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item);
|
||||
}
|
||||
|
||||
foreach (var item2 in m_CmdCallFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item2);
|
||||
}
|
||||
|
||||
foreach (var item3 in m_RpcInvocationFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item3);
|
||||
}
|
||||
|
||||
foreach (var item4 in m_TargetRpcInvocationFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item4);
|
||||
}
|
||||
|
||||
foreach (var item5 in m_RpcCallFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item5);
|
||||
}
|
||||
|
||||
foreach (var item6 in m_TargetRpcCallFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item6);
|
||||
@ -1632,6 +1722,7 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MethodDefinition result;
|
||||
if (fieldDefinition == null)
|
||||
{
|
||||
@ -1668,6 +1759,7 @@ namespace QNetWeaver
|
||||
result = methodDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1679,6 +1771,7 @@ namespace QNetWeaver
|
||||
{
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition(parameterDefinition.Name, ParameterAttributes.None, parameterDefinition.ParameterType));
|
||||
}
|
||||
|
||||
var ilprocessor = methodDefinition.Body.GetILProcessor();
|
||||
var label = ilprocessor.Create(OpCodes.Nop);
|
||||
WriteSetupLocals(ilprocessor);
|
||||
@ -1711,6 +1804,7 @@ namespace QNetWeaver
|
||||
value = (int)customAttributeNamedArgument.Argument.Value;
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldc_I4, value));
|
||||
@ -1719,6 +1813,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1743,6 +1838,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (eventDefinition.EventType.Resolve().HasGenericParameters)
|
||||
{
|
||||
Log.Error(string.Concat(new string[]
|
||||
@ -1756,12 +1852,14 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
m_Events.Add(eventDefinition);
|
||||
var methodDefinition = ProcessEventInvoke(eventDefinition);
|
||||
if (methodDefinition == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_td.Methods.Add(methodDefinition);
|
||||
m_EventInvocationFuncs.Add(methodDefinition);
|
||||
Weaver.DLog(m_td, "ProcessEvent " + eventDefinition, new object[0]);
|
||||
@ -1852,6 +1950,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, Weaver.NetworkBehaviourClientSendUpdateVars));
|
||||
}
|
||||
|
||||
ilprocessor.Append(returnInstruction);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("value", ParameterAttributes.In, fd.FieldType));
|
||||
methodDefinition.SemanticsAttributes = MethodSemanticsAttributes.Setter;
|
||||
@ -1870,6 +1969,7 @@ namespace QNetWeaver
|
||||
m_SyncVarNetIds.Add(fieldDefinition);
|
||||
Weaver.lists.netIdFields.Add(fieldDefinition);
|
||||
}
|
||||
|
||||
var methodDefinition = ProcessSyncVarGet(fd, name);
|
||||
var methodDefinition2 = ProcessSyncVarSet(fd, name, dirtyBit, fieldDefinition);
|
||||
var item = new PropertyDefinition("Network" + name, PropertyAttributes.None, fd.FieldType)
|
||||
@ -1932,30 +2032,35 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Weaver.IsDerivedFrom(typeDefinition, Weaver.ScriptableObjectType))
|
||||
{
|
||||
Log.Error("SyncVar [" + fieldDefinition.FullName + "] cannot be derived from ScriptableObject.");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((ushort)(fieldDefinition.Attributes & FieldAttributes.Static) != 0)
|
||||
{
|
||||
Log.Error("SyncVar [" + fieldDefinition.FullName + "] cannot be static.");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeDefinition.HasGenericParameters)
|
||||
{
|
||||
Log.Error("SyncVar [" + fieldDefinition.FullName + "] cannot have generic parameters.");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeDefinition.IsInterface)
|
||||
{
|
||||
Log.Error("SyncVar [" + fieldDefinition.FullName + "] cannot be an interface.");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var name = typeDefinition.Module.Name;
|
||||
if (name != Weaver.scriptDef.MainModule.Name && name != Weaver.UnityAssemblyDefinition.MainModule.Name && name != Weaver.QNetAssemblyDefinition.MainModule.Name && name != Weaver.corLib.Name && name != "System.Runtime.dll")
|
||||
{
|
||||
@ -1963,17 +2068,20 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fieldDefinition.FieldType.IsArray)
|
||||
{
|
||||
Log.Error("SyncVar [" + fieldDefinition.FullName + "] cannot be an array. Use a SyncList instead.");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Helpers.InheritsFromSyncList(fieldDefinition.FieldType))
|
||||
{
|
||||
Log.Warning(string.Format("Script class [{0}] has [SyncVar] attribute on SyncList field {1}, SyncLists should not be marked with SyncVar.", m_td.FullName, fieldDefinition.Name));
|
||||
break;
|
||||
}
|
||||
|
||||
m_SyncVars.Add(fieldDefinition);
|
||||
ProcessSyncVar(fieldDefinition, 1 << num2);
|
||||
num2++;
|
||||
@ -1991,15 +2099,18 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fieldDefinition.FieldType.FullName.Contains("UnityEngine.Networking.SyncListStruct"))
|
||||
{
|
||||
Log.Error("SyncListStruct member variable [" + fieldDefinition.FullName + "] must use a dervied class, like \"class MySyncList : SyncListStruct<MyStruct> {}\".");
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Weaver.IsDerivedFrom(fieldDefinition.FieldType.Resolve(), Weaver.SyncListType))
|
||||
{
|
||||
if (fieldDefinition.IsStatic)
|
||||
@ -2015,6 +2126,7 @@ namespace QNetWeaver
|
||||
Weaver.fail = true;
|
||||
return;
|
||||
}
|
||||
|
||||
m_SyncVars.Add(fieldDefinition);
|
||||
m_SyncLists.Add(fieldDefinition);
|
||||
list.Add(ProcessSyncList(fieldDefinition, 1 << num2));
|
||||
@ -2035,19 +2147,23 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var fieldDefinition2 in list)
|
||||
{
|
||||
m_td.Fields.Add(fieldDefinition2);
|
||||
m_SyncListStaticFields.Add(fieldDefinition2);
|
||||
}
|
||||
|
||||
foreach (var item in m_SyncVarNetIds)
|
||||
{
|
||||
m_td.Fields.Add(item);
|
||||
}
|
||||
|
||||
foreach (var item2 in m_SyncListInvocationFuncs)
|
||||
{
|
||||
m_td.Methods.Add(item2);
|
||||
}
|
||||
|
||||
Weaver.SetNumSyncVars(m_td.FullName, num);
|
||||
}
|
||||
|
||||
@ -2068,6 +2184,7 @@ namespace QNetWeaver
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ namespace QNetWeaver
|
||||
{
|
||||
throw new Exception("dll could not be located at " + path + "!");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Path OK!");
|
||||
}
|
||||
|
||||
@ -45,6 +46,7 @@ namespace QNetWeaver
|
||||
{
|
||||
throw new Exception("Assembly " + assemblyPath + " does not exist!");
|
||||
}
|
||||
|
||||
Console.WriteLine($"Assembly Path OK!");
|
||||
}
|
||||
|
||||
@ -55,6 +57,7 @@ namespace QNetWeaver
|
||||
{
|
||||
Directory.CreateDirectory(outputDir);
|
||||
}
|
||||
|
||||
Console.WriteLine($"Output Path OK!");
|
||||
}
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkReaderType)));
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("instance", ParameterAttributes.None, m_TypeDef));
|
||||
@ -105,6 +106,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkWriterType)));
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("value", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(m_TypeDef)));
|
||||
@ -164,6 +166,7 @@ namespace QNetWeaver
|
||||
return methodDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("SerializeItem", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, Weaver.voidType);
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkWriterType)));
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("item", ParameterAttributes.None, m_ItemType));
|
||||
@ -198,6 +201,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (typeDefinition.IsInterface)
|
||||
{
|
||||
Weaver.fail = true;
|
||||
@ -213,6 +217,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
var writeFunc = Weaver.GetWriteFunc(fieldDefinition.FieldType);
|
||||
if (writeFunc == null)
|
||||
{
|
||||
@ -229,16 +234,19 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_2));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldfld, fieldReference));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, writeFunc));
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_TypeDef.Methods.Add(methodDefinition2);
|
||||
result = methodDefinition2;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -252,6 +260,7 @@ namespace QNetWeaver
|
||||
return methodDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
var methodDefinition2 = new MethodDefinition("DeserializeItem", MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Virtual | MethodAttributes.HideBySig, m_ItemType);
|
||||
methodDefinition2.Parameters.Add(new ParameterDefinition("reader", ParameterAttributes.None, Weaver.scriptDef.MainModule.ImportReference(Weaver.NetworkReaderType)));
|
||||
var ilprocessor = methodDefinition2.Body.GetILProcessor();
|
||||
@ -279,12 +288,14 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloca, 0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, readFunc));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Stfld, fieldReference));
|
||||
}
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
m_TypeDef.Methods.Add(methodDefinition2);
|
||||
|
@ -35,13 +35,17 @@ namespace QNetWeaver
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
var typeDefinition = parent.Resolve();
|
||||
result = (typeDefinition != null);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -67,6 +71,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -91,6 +96,7 @@ namespace QNetWeaver
|
||||
return methodReference;
|
||||
}
|
||||
}
|
||||
|
||||
if (variable.IsByReference)
|
||||
{
|
||||
Log.Error("GetWriteFunc variable.IsByReference error.");
|
||||
@ -107,6 +113,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
methodDefinition = GenerateArrayWriteFunc(variable, writeFunc);
|
||||
}
|
||||
else
|
||||
@ -115,8 +122,10 @@ namespace QNetWeaver
|
||||
{
|
||||
return NetworkWriterWriteInt32;
|
||||
}
|
||||
|
||||
methodDefinition = GenerateWriterFunction(variable);
|
||||
}
|
||||
|
||||
if (methodDefinition == null)
|
||||
{
|
||||
result = null;
|
||||
@ -128,6 +137,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -150,6 +160,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -163,6 +174,7 @@ namespace QNetWeaver
|
||||
return methodReference;
|
||||
}
|
||||
}
|
||||
|
||||
var typeDefinition = variable.Resolve();
|
||||
MethodReference result;
|
||||
if (typeDefinition == null)
|
||||
@ -186,6 +198,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
methodDefinition = GenerateArrayReadFunc(variable, readFunc);
|
||||
}
|
||||
else
|
||||
@ -194,8 +207,10 @@ namespace QNetWeaver
|
||||
{
|
||||
return NetworkReaderReadInt32;
|
||||
}
|
||||
|
||||
methodDefinition = GenerateReadFunction(variable);
|
||||
}
|
||||
|
||||
if (methodDefinition == null)
|
||||
{
|
||||
Log.Error("GetReadFunc unable to generate function for:" + variable.FullName);
|
||||
@ -207,6 +222,7 @@ namespace QNetWeaver
|
||||
result = methodDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -245,6 +261,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, variable);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("reader", ParameterAttributes.None, scriptDef.MainModule.ImportReference(NetworkReaderType)));
|
||||
methodDefinition.Body.Variables.Add(new VariableDefinition(int32Type));
|
||||
@ -289,6 +306,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -311,6 +329,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, voidType);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, scriptDef.MainModule.ImportReference(NetworkWriterType)));
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("value", ParameterAttributes.None, scriptDef.MainModule.ImportReference(variable)));
|
||||
@ -360,6 +379,7 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -381,6 +401,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, voidType);
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("writer", ParameterAttributes.None, scriptDef.MainModule.ImportReference(NetworkWriterType)));
|
||||
methodDefinition.Parameters.Add(new ParameterDefinition("value", ParameterAttributes.None, scriptDef.MainModule.ImportReference(variable)));
|
||||
@ -405,6 +426,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
if (fieldDefinition.FieldType.Resolve().IsInterface)
|
||||
{
|
||||
fail = true;
|
||||
@ -420,6 +442,7 @@ namespace QNetWeaver
|
||||
}));
|
||||
return null;
|
||||
}
|
||||
|
||||
var writeFunc = GetWriteFunc(fieldDefinition.FieldType);
|
||||
if (writeFunc == null)
|
||||
{
|
||||
@ -434,6 +457,7 @@ namespace QNetWeaver
|
||||
fail = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
num += 1U;
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_1));
|
||||
@ -441,13 +465,16 @@ namespace QNetWeaver
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, writeFunc));
|
||||
}
|
||||
}
|
||||
|
||||
if (num == 0U)
|
||||
{
|
||||
Log.Warning("The class / struct " + variable.Name + " has no public or non-static fields to serialize");
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -469,6 +496,7 @@ namespace QNetWeaver
|
||||
{
|
||||
text += "None";
|
||||
}
|
||||
|
||||
var methodDefinition = new MethodDefinition(text, MethodAttributes.FamANDAssem | MethodAttributes.Family | MethodAttributes.Static | MethodAttributes.HideBySig, variable);
|
||||
methodDefinition.Body.Variables.Add(new VariableDefinition(variable));
|
||||
methodDefinition.Body.InitLocals = true;
|
||||
@ -487,9 +515,11 @@ namespace QNetWeaver
|
||||
Log.Error("The class " + variable.Name + " has no default constructor or it's private, aborting.");
|
||||
return null;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Newobj, methodDefinition2));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Stloc_0));
|
||||
}
|
||||
|
||||
var num = 0U;
|
||||
foreach (var fieldDefinition in variable.Resolve().Fields)
|
||||
{
|
||||
@ -503,6 +533,7 @@ namespace QNetWeaver
|
||||
{
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc, 0));
|
||||
}
|
||||
|
||||
var readFunc = GetReadFunc(fieldDefinition.FieldType);
|
||||
if (readFunc == null)
|
||||
{
|
||||
@ -517,20 +548,24 @@ namespace QNetWeaver
|
||||
fail = true;
|
||||
return null;
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldarg_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Call, readFunc));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Stfld, fieldDefinition));
|
||||
num += 1U;
|
||||
}
|
||||
}
|
||||
|
||||
if (num == 0U)
|
||||
{
|
||||
Log.Warning("The class / struct " + variable.Name + " has no public or non-static fields to serialize");
|
||||
}
|
||||
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ldloc_0));
|
||||
ilprocessor.Append(ilprocessor.Create(OpCodes.Ret));
|
||||
result = methodDefinition;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -549,6 +584,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -632,6 +668,7 @@ namespace QNetWeaver
|
||||
ProcessInstructionMethod(moduleDef, td, md, i, methodReference, iCount);
|
||||
}
|
||||
}
|
||||
|
||||
if (i.OpCode == OpCodes.Stfld)
|
||||
{
|
||||
var fieldDefinition = i.Operand as FieldDefinition;
|
||||
@ -707,6 +744,7 @@ namespace QNetWeaver
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Ldstr, "[Server] function '" + md.FullName + "' called on client"));
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Call, logWarningReference));
|
||||
}
|
||||
|
||||
InjectGuardParameters(md, ilprocessor, instruction);
|
||||
InjectGuardReturnValue(md, ilprocessor, instruction);
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Ret));
|
||||
@ -730,6 +768,7 @@ namespace QNetWeaver
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Ldstr, "[Client] function '" + md.FullName + "' called on server"));
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Call, logWarningReference));
|
||||
}
|
||||
|
||||
InjectGuardParameters(md, ilprocessor, instruction);
|
||||
InjectGuardReturnValue(md, ilprocessor, instruction);
|
||||
ilprocessor.InsertBefore(instruction, ilprocessor.Create(OpCodes.Ret));
|
||||
@ -770,6 +809,7 @@ namespace QNetWeaver
|
||||
InjectClientGuard(moduleDef, td, md, false);
|
||||
}
|
||||
}
|
||||
|
||||
var num = 0;
|
||||
foreach (var i in md.Body.Instructions)
|
||||
{
|
||||
@ -789,6 +829,7 @@ namespace QNetWeaver
|
||||
{
|
||||
ProcessSiteMethod(moduleDef, td, md);
|
||||
}
|
||||
|
||||
foreach (var td2 in td.NestedTypes)
|
||||
{
|
||||
ProcessSiteClass(moduleDef, td2);
|
||||
@ -805,6 +846,7 @@ namespace QNetWeaver
|
||||
ProcessSiteClass(moduleDef, typeDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
if (lists.generateContainerClass != null)
|
||||
{
|
||||
moduleDef.Types.Add(lists.generateContainerClass);
|
||||
@ -813,11 +855,13 @@ namespace QNetWeaver
|
||||
{
|
||||
scriptDef.MainModule.ImportReference(method);
|
||||
}
|
||||
|
||||
foreach (var method2 in lists.generatedWriteFunctions)
|
||||
{
|
||||
scriptDef.MainModule.ImportReference(method2);
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine(string.Concat(new object[]
|
||||
{
|
||||
" ProcessSitesModule ",
|
||||
@ -859,6 +903,7 @@ namespace QNetWeaver
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
DLog(td, "Found NetworkBehaviour " + td.FullName, new object[0]);
|
||||
var networkBehaviourProcessor = new NetworkBehaviourProcessor(td);
|
||||
networkBehaviourProcessor.Process();
|
||||
@ -883,14 +928,17 @@ namespace QNetWeaver
|
||||
return scriptDef.MainModule.ImportReference(methodDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error($"ResolveMethod failed - Couldn't find {name} in {t.Name}");
|
||||
foreach (var methodDefinition2 in t.Resolve().Methods)
|
||||
{
|
||||
Log.Error("- has method " + methodDefinition2.Name);
|
||||
}
|
||||
|
||||
fail = true;
|
||||
result = null;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -909,6 +957,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error(string.Concat(new object[]
|
||||
{
|
||||
"ResolveMethodWithArg failed ",
|
||||
@ -931,6 +980,7 @@ namespace QNetWeaver
|
||||
return methodDefinition;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -955,6 +1005,7 @@ namespace QNetWeaver
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error(string.Concat(new object[]
|
||||
{
|
||||
"ResolveMethodGeneric failed ",
|
||||
@ -977,6 +1028,7 @@ namespace QNetWeaver
|
||||
return scriptDef.MainModule.ImportReference(fieldDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -989,6 +1041,7 @@ namespace QNetWeaver
|
||||
return scriptDef.MainModule.ImportReference(propertyDefinition.GetMethod);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error($"ResolveProperty failed - Couldn't find {name} in {t.Name}");
|
||||
return null;
|
||||
}
|
||||
@ -1000,6 +1053,7 @@ namespace QNetWeaver
|
||||
{
|
||||
Log.Error("Vector2Type is null!");
|
||||
}
|
||||
|
||||
vector3Type = UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Vector3");
|
||||
vector4Type = UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Vector4");
|
||||
colorType = UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Color");
|
||||
@ -1014,6 +1068,7 @@ namespace QNetWeaver
|
||||
{
|
||||
Log.Error("GameObjectType is null!");
|
||||
}
|
||||
|
||||
transformType = UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Transform");
|
||||
unityObjectType = UnityAssemblyDefinition.MainModule.GetType("UnityEngine.Object");
|
||||
|
||||
@ -1328,6 +1383,7 @@ namespace QNetWeaver
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
baseType = baseType.Resolve().BaseType;
|
||||
@ -1337,8 +1393,10 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1360,10 +1418,12 @@ namespace QNetWeaver
|
||||
{
|
||||
text = text.Substring(0, num);
|
||||
}
|
||||
|
||||
if (text == baseClass.FullName)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
baseType = baseType.Resolve().BaseType;
|
||||
@ -1373,8 +1433,10 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1400,6 +1462,7 @@ namespace QNetWeaver
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1433,6 +1496,7 @@ namespace QNetWeaver
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
list.Insert(0, typeDefinition);
|
||||
@ -1443,13 +1507,16 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var flag = false;
|
||||
foreach (var td2 in list)
|
||||
{
|
||||
flag |= ProcessNetworkBehaviourType(td2);
|
||||
}
|
||||
|
||||
result = flag;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1471,6 +1538,7 @@ namespace QNetWeaver
|
||||
flag |= ProcessMessageType(td);
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
baseType = baseType.Resolve().BaseType;
|
||||
@ -1480,12 +1548,15 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var td2 in td.NestedTypes)
|
||||
{
|
||||
flag |= CheckMessageBase(td2);
|
||||
}
|
||||
|
||||
result = flag;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1507,6 +1578,7 @@ namespace QNetWeaver
|
||||
flag |= ProcessSyncListStructType(td);
|
||||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
baseType = baseType.Resolve().BaseType;
|
||||
@ -1516,12 +1588,15 @@ namespace QNetWeaver
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var td2 in td.NestedTypes)
|
||||
{
|
||||
flag |= CheckSyncListStruct(td2);
|
||||
}
|
||||
|
||||
result = flag;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1560,19 +1635,23 @@ namespace QNetWeaver
|
||||
{
|
||||
scriptDef.MainModule.SymbolReader.Dispose();
|
||||
}
|
||||
|
||||
fail = true;
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (scriptDef.MainModule.SymbolReader != null)
|
||||
{
|
||||
scriptDef.MainModule.SymbolReader.Dispose();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
Console.WriteLine(string.Concat(new object[]
|
||||
{
|
||||
@ -1583,12 +1662,14 @@ namespace QNetWeaver
|
||||
" milliseconds"
|
||||
}));
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
foreach (var methodDefinition in lists.replacedMethods)
|
||||
{
|
||||
lists.replacementMethodNames.Add(methodDefinition.FullName);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ProcessPropertySites();
|
||||
@ -1600,16 +1681,20 @@ namespace QNetWeaver
|
||||
{
|
||||
scriptDef.MainModule.SymbolReader.Dispose();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (fail)
|
||||
{
|
||||
if (scriptDef.MainModule.SymbolReader != null)
|
||||
{
|
||||
scriptDef.MainModule.SymbolReader.Dispose();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var fileName = Helpers.DestinationFileFor(outputDir, assName);
|
||||
var writerParameters = Helpers.GetWriterParameters(readerParameters);
|
||||
if (writerParameters.SymbolWriterProvider is PdbWriterProvider)
|
||||
@ -1618,12 +1703,15 @@ namespace QNetWeaver
|
||||
var text = Path.ChangeExtension(assName, ".pdb");
|
||||
File.Delete(text);
|
||||
}
|
||||
|
||||
scriptDef.Write(fileName, writerParameters);
|
||||
}
|
||||
|
||||
if (scriptDef.MainModule.SymbolReader != null)
|
||||
{
|
||||
scriptDef.MainModule.SymbolReader.Dispose();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1650,6 +1738,7 @@ namespace QNetWeaver
|
||||
Log.Error("Exception :" + ex);
|
||||
return false;
|
||||
}
|
||||
|
||||
corLib = null;
|
||||
return true;
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ namespace QSB.Animation.NPC.Patches
|
||||
DebugLog.ToConsole($"Error - No player talking to {____dialogueTree.name}!", MessageType.Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(playerId);
|
||||
|
||||
var distance = player.Body.transform.position - __instance.transform.position;
|
||||
@ -147,6 +148,7 @@ namespace QSB.Animation.NPC.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var id = QSBWorldSync.GetIdFromTypeSubset(ownerOfThis);
|
||||
QSBEventManager.FireEvent(EventNames.QSBNpcAnimEvent, AnimationEvent.StartConversation, id);
|
||||
return true;
|
||||
@ -160,6 +162,7 @@ namespace QSB.Animation.NPC.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var id = QSBWorldSync.GetIdFromTypeSubset(ownerOfThis);
|
||||
QSBEventManager.FireEvent(EventNames.QSBNpcAnimEvent, AnimationEvent.EndConversation, id);
|
||||
return true;
|
||||
@ -175,12 +178,14 @@ namespace QSB.Animation.NPC.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var qsbObj = QSBWorldSync.GetWorldObjects<QSBCharacterAnimController>().First(x => x.GetDialogueTree() == ____dialogueTree);
|
||||
|
||||
if (!____throwingRock && !qsbObj.InConversation() && Time.time > ____nextThrowTime)
|
||||
{
|
||||
__instance.GetType().GetMethod("StartRockThrow", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, null);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ namespace QSB.Animation.NPC.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_playersInHeadZone.Add(player);
|
||||
}
|
||||
|
||||
@ -26,6 +27,7 @@ namespace QSB.Animation.NPC.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_playersInHeadZone.Remove(player);
|
||||
}
|
||||
|
||||
|
@ -64,6 +64,7 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
LoadControllers();
|
||||
}
|
||||
|
||||
NetworkAnimator.enabled = true;
|
||||
VisibleAnimator = body.GetComponent<Animator>();
|
||||
Mirror = body.gameObject.AddComponent<AnimatorMirror>();
|
||||
@ -158,11 +159,13 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (state)
|
||||
{
|
||||
SuitUp();
|
||||
return;
|
||||
}
|
||||
|
||||
SuitDown();
|
||||
}
|
||||
|
||||
@ -172,15 +175,18 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentType = type;
|
||||
if (_unsuitedAnimController == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Unsuited controller is null. ({PlayerId})", MessageType.Error);
|
||||
}
|
||||
|
||||
if (_suitedAnimController == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Suited controller is null. ({PlayerId})", MessageType.Error);
|
||||
}
|
||||
|
||||
RuntimeAnimatorController controller = default;
|
||||
switch (type)
|
||||
{
|
||||
@ -216,6 +222,7 @@ namespace QSB.Animation.Player
|
||||
controller = _riebeckController;
|
||||
break;
|
||||
}
|
||||
|
||||
InvisibleAnimator.runtimeAnimatorController = controller;
|
||||
VisibleAnimator.runtimeAnimatorController = controller;
|
||||
if (type != AnimationType.PlayerSuited && type != AnimationType.PlayerUnsuited)
|
||||
@ -229,6 +236,7 @@ namespace QSB.Animation.Player
|
||||
VisibleAnimator.SetTrigger("Grounded");
|
||||
InvisibleAnimator.SetTrigger("Grounded");
|
||||
}
|
||||
|
||||
NetworkAnimator.animator = InvisibleAnimator; // Probably not needed.
|
||||
Mirror.RebuildFloatParams();
|
||||
for (var i = 0; i < InvisibleAnimator.parameterCount; i++)
|
||||
|
@ -21,15 +21,18 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Trying to init AnimatorMirror with null \"from\".", MessageType.Error);
|
||||
}
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Trying to init AnimatorMirror with null \"to\".", MessageType.Error);
|
||||
}
|
||||
|
||||
if (to == null || from == null)
|
||||
{
|
||||
// Doing the return this way so you can see if one or both are null
|
||||
return;
|
||||
}
|
||||
|
||||
_from = from;
|
||||
_to = to;
|
||||
if (_from.runtimeAnimatorController == null)
|
||||
@ -40,6 +43,7 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
_to.runtimeAnimatorController = _from.runtimeAnimatorController;
|
||||
}
|
||||
|
||||
foreach (var param in _from.parameters.Where(p => p.type == AnimatorControllerParameterType.Float))
|
||||
{
|
||||
_floatParams.Add(param.name, new AnimFloatParam());
|
||||
@ -52,10 +56,12 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_to.runtimeAnimatorController != _from.runtimeAnimatorController)
|
||||
{
|
||||
_to.runtimeAnimatorController = _from.runtimeAnimatorController;
|
||||
}
|
||||
|
||||
SyncParams();
|
||||
SmoothFloats();
|
||||
}
|
||||
@ -73,6 +79,7 @@ namespace QSB.Animation.Player
|
||||
RebuildFloatParams();
|
||||
break;
|
||||
}
|
||||
|
||||
_floatParams[fromParam.name].Target = _from.GetFloat(fromParam.name);
|
||||
break;
|
||||
|
||||
|
@ -30,6 +30,7 @@ namespace QSB.Animation.Player
|
||||
SyncLocalCrouch();
|
||||
return;
|
||||
}
|
||||
|
||||
SyncRemoteCrouch();
|
||||
}
|
||||
|
||||
@ -39,6 +40,7 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var jumpChargeFraction = _playerController.GetJumpChargeFraction();
|
||||
_crouchValue = jumpChargeFraction;
|
||||
}
|
||||
@ -49,6 +51,7 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CrouchParam.Target = _crouchValue;
|
||||
CrouchParam.Smooth(CrouchSmoothTime);
|
||||
var jumpChargeFraction = CrouchParam.Current;
|
||||
|
@ -26,6 +26,7 @@ namespace QSB.Animation.Player.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
animationSync.VisibleAnimator.SetTrigger(message.Name);
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace QSB.Animation.Player.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QSBPlayerManager.GetPlayer(message.AboutId).AnimationSync.SetAnimationType(message.EnumValue);
|
||||
QSBPlayerManager.GetSyncObject<InstrumentsManager>(message.AboutId).CheckInstrumentProps(message.EnumValue);
|
||||
}
|
||||
|
@ -37,18 +37,22 @@ namespace QSB.Animation.Patches
|
||||
{
|
||||
movementVector = ____playerController.GetRelativeGroundVelocity();
|
||||
}
|
||||
|
||||
if (Mathf.Abs(movementVector.x) < 0.05f)
|
||||
{
|
||||
movementVector.x = 0f;
|
||||
}
|
||||
|
||||
if (Mathf.Abs(movementVector.z) < 0.05f)
|
||||
{
|
||||
movementVector.z = 0f;
|
||||
}
|
||||
|
||||
if (isFlying)
|
||||
{
|
||||
____ungroundedTime = Time.time;
|
||||
}
|
||||
|
||||
var freefallMagnitude = 0f;
|
||||
var timeInFreefall = 0f;
|
||||
var lastGroundBody = ____playerController.GetLastGroundBody();
|
||||
@ -57,6 +61,7 @@ namespace QSB.Animation.Patches
|
||||
freefallMagnitude = (____playerController.GetAttachedOWRigidbody(false).GetVelocity() - lastGroundBody.GetPointVelocity(____playerController.transform.position)).magnitude;
|
||||
timeInFreefall = Time.time - ____ungroundedTime;
|
||||
}
|
||||
|
||||
____animator.SetFloat("RunSpeedX", movementVector.x / 3f);
|
||||
____animator.SetFloat("RunSpeedY", movementVector.z / 3f);
|
||||
____animator.SetFloat("TurnSpeed", ____playerController.GetTurning());
|
||||
@ -79,6 +84,7 @@ namespace QSB.Animation.Patches
|
||||
QSBEventManager.FireEvent(EventNames.QSBAnimTrigger, playerAnimationSync.AttachedNetId, "Land");
|
||||
}
|
||||
}
|
||||
|
||||
if (isGrounded)
|
||||
{
|
||||
var leftFootLift = ____animator.GetFloat("LeftFootLift");
|
||||
@ -92,6 +98,7 @@ namespace QSB.Animation.Patches
|
||||
____leftFootGrounded = false;
|
||||
QSBWorldSync.RaiseEvent(__instance, "OnLeftFootLift");
|
||||
}
|
||||
|
||||
var rightFootLift = ____animator.GetFloat("RightFootLift");
|
||||
if (!____rightFootGrounded && rightFootLift < 0.333f)
|
||||
{
|
||||
@ -104,6 +111,7 @@ namespace QSB.Animation.Patches
|
||||
QSBWorldSync.RaiseEvent(__instance, "OnRightFootLift");
|
||||
}
|
||||
}
|
||||
|
||||
____justBecameGrounded = false;
|
||||
____justTookFallDamage = false;
|
||||
var usingTool = Locator.GetToolModeSwapper().GetToolMode() != ToolMode.None;
|
||||
|
@ -23,16 +23,19 @@ namespace QSB.Animation.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_attachedAnimator == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - _attachedAnimator is null!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (_lookBase == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - _lookBase is null!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var bone = _attachedAnimator.GetBoneTransform(HumanBodyBones.Head);
|
||||
// Get the camera's local rotation with respect to the player body
|
||||
var lookLocalRotation = Quaternion.Inverse(_attachedAnimator.transform.rotation) * _lookBase.rotation;
|
||||
|
@ -61,17 +61,20 @@ namespace QSB.Animation.Player.Thrusters
|
||||
{
|
||||
num *= _belowMaxThrustScalar;
|
||||
}
|
||||
|
||||
_currentScale = _scaleSpring.Update(_currentScale, num, Time.deltaTime);
|
||||
if (_currentScale < 0f)
|
||||
{
|
||||
_currentScale = 0f;
|
||||
_scaleSpring.ResetVelocity();
|
||||
}
|
||||
|
||||
if (_currentScale <= 0.001f)
|
||||
{
|
||||
_currentScale = 0f;
|
||||
_scaleSpring.ResetVelocity();
|
||||
}
|
||||
|
||||
transform.localScale = Vector3.one * _currentScale;
|
||||
_light.range = _baseLightRadius * _currentScale;
|
||||
_thrusterRenderer.enabled = _currentScale > 0f;
|
||||
|
@ -36,6 +36,7 @@ namespace QSB.Animation.Player.Thrusters
|
||||
DebugLog.ToConsole($"Error - DefaultParticleSystem is null!", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
_defaultMainModule = _defaultParticleSystem.main;
|
||||
_defaultEmissionModule = _defaultParticleSystem.emission;
|
||||
_baseDefaultEmissionRate = _defaultEmissionModule.rateOverTime.constant;
|
||||
@ -73,6 +74,7 @@ namespace QSB.Animation.Player.Thrusters
|
||||
{
|
||||
_defaultParticleSystem.Play();
|
||||
}
|
||||
|
||||
_defaultEmissionModule.rateOverTimeMultiplier = _baseDefaultEmissionRate * emissionThrusterScale;
|
||||
_defaultParticleSystem.transform.SetPositionAndRotation(position, rotation);
|
||||
if (_defaultMainModule.customSimulationSpace != hitInfo.transform)
|
||||
|
@ -24,6 +24,7 @@ namespace QSB.CampfireSync.Patches
|
||||
QSBEventManager.FireEvent(EventNames.QSBCampfireState, qsbCampfire.ObjectId, Campfire.State.LIT);
|
||||
Locator.GetFlashlight().TurnOff(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ namespace QSB.ConversationSync
|
||||
{
|
||||
DebugLog.ToConsole("Error - Font is null!", MessageType.Error);
|
||||
}
|
||||
|
||||
_boxPrefab.GetComponent<Text>().font = font;
|
||||
_boxPrefab.GetComponent<Text>().color = Color.white;
|
||||
}
|
||||
@ -52,6 +53,7 @@ namespace QSB.ConversationSync
|
||||
DebugLog.ToConsole("Warning - Tried to send conv. event with char id -1.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBConversation, (uint)id, text, ConversationType.Character);
|
||||
}
|
||||
|
||||
@ -68,6 +70,7 @@ namespace QSB.ConversationSync
|
||||
DebugLog.ToConsole("Warning - Tried to send conv. start/end event with char id -1.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBConversationStartEnd, charId, QSBPlayerManager.LocalPlayerId, state);
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.ConversationSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (message.EnumValue)
|
||||
{
|
||||
case ConversationType.Character:
|
||||
@ -45,6 +46,7 @@ namespace QSB.ConversationSync.Events
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
var tree = QSBWorldSync.OldDialogueTrees[message.ObjectId];
|
||||
UnityEngine.Object.Destroy(ConversationManager.Instance.BoxMappings[tree]);
|
||||
break;
|
||||
|
@ -33,6 +33,7 @@ namespace QSB.ConversationSync.Events
|
||||
{
|
||||
QSBWorldSync.SetDialogueCondition(message.ConditionName, message.ConditionState);
|
||||
}
|
||||
|
||||
DialogueConditionManager.SharedInstance.SetConditionState(message.ConditionName, message.ConditionState);
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace QSB.ConversationSync.Patches
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Index for tree {__instance.name} was -1.", MessageType.Warning);
|
||||
}
|
||||
|
||||
QSBPlayerManager.LocalPlayer.CurrentCharacterDialogueTreeId = index;
|
||||
ConversationManager.Instance.SendConvState(index, true);
|
||||
}
|
||||
@ -36,11 +37,13 @@ namespace QSB.ConversationSync.Patches
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (QSBPlayerManager.LocalPlayer.CurrentCharacterDialogueTreeId == -1)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Ending conversation with CurrentDialogueId of -1! Called from {__instance.name}", MessageType.Warning);
|
||||
return true;
|
||||
}
|
||||
|
||||
ConversationManager.Instance.SendConvState(QSBPlayerManager.LocalPlayer.CurrentCharacterDialogueTreeId, false);
|
||||
ConversationManager.Instance.CloseBoxCharacter(QSBPlayerManager.LocalPlayer.CurrentCharacterDialogueTreeId);
|
||||
QSBPlayerManager.LocalPlayer.CurrentCharacterDialogueTreeId = -1;
|
||||
|
@ -60,6 +60,7 @@ namespace QSB.DeathSync.Patches
|
||||
impact.otherCollider.attachedRigidbody.gameObject.name
|
||||
}));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -127,6 +128,7 @@ namespace QSB.DeathSync.Patches
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -159,6 +161,7 @@ namespace QSB.DeathSync.Patches
|
||||
{
|
||||
____dieNextUpdate = true;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite(string.Concat(new object[]
|
||||
{
|
||||
"HIGH SPEED IMPACT: ",
|
||||
|
@ -55,6 +55,7 @@ namespace QSB.DeathSync
|
||||
DebugLog.ToConsole($"Warning - Init() ran when ship was null?", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
_shipComponents = shipTransform.GetComponentsInChildren<ShipComponent>();
|
||||
_hatchController = shipTransform.GetComponentInChildren<HatchController>();
|
||||
_cockpitController = shipTransform.GetComponentInChildren<ShipCockpitController>();
|
||||
@ -172,6 +173,7 @@ namespace QSB.DeathSync
|
||||
DebugLog.ToConsole($"Warning - _spawnList was null for player spawner!", MessageType.Warning);
|
||||
return null;
|
||||
}
|
||||
|
||||
return spawnList.FirstOrDefault(spawnPoint =>
|
||||
spawnPoint.GetSpawnLocation() == SpawnLocation.TimberHearth
|
||||
&& spawnPoint.IsShipSpawn() == isShip);
|
||||
|
@ -21,6 +21,7 @@ namespace QSB.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_eventHandler = new MessageHandler<T>(Type);
|
||||
_eventHandler.OnClientReceiveMessage += message => OnReceive(false, message);
|
||||
_eventHandler.OnServerReceiveMessage += message => OnReceive(true, message);
|
||||
|
@ -109,6 +109,7 @@ namespace QSB.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger.FireEvent(eventName);
|
||||
}
|
||||
|
||||
@ -119,6 +120,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T>.FireEvent(eventName, arg);
|
||||
}
|
||||
|
||||
@ -129,6 +131,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T, U>.FireEvent(eventName, arg1, arg2);
|
||||
}
|
||||
|
||||
@ -139,6 +142,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T, U, V>.FireEvent(eventName, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
@ -149,6 +153,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T, U, V, W>.FireEvent(eventName, arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
@ -159,6 +164,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T, U, V, W, X>.FireEvent(eventName, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
|
||||
@ -169,6 +175,7 @@ namespace QSB.Events
|
||||
DebugLog.ToConsole($"Warning - Tried to send event {eventName} while not connected to/hosting server.", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalMessenger<T, U, V, W, X, Y>.FireEvent(eventName, arg1, arg2, arg3, arg4, arg5, arg6);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ namespace QSB.GeyserSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var geyser = QSBWorldSync.GetWorldFromId<QSBGeyser>(message.ObjectId);
|
||||
geyser?.SetState(message.State);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ namespace QSB.GeyserSync.WorldObjects
|
||||
AttachedObject?.ActivateGeyser();
|
||||
return;
|
||||
}
|
||||
|
||||
AttachedObject?.DeactivateGeyser();
|
||||
}
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ namespace QSB.Instruments
|
||||
// TODO : fix for instrument release
|
||||
mr.sharedMaterial = null;
|
||||
}
|
||||
|
||||
drum.transform.parent = _rootObj;
|
||||
drum.transform.rotation = _rootObj.rotation;
|
||||
drum.transform.localPosition = Vector3.zero;
|
||||
@ -94,10 +95,12 @@ namespace QSB.Instruments
|
||||
DebugLog.ToConsole("Error - Tried to start instrument on non-local player!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Player.PlayingInstrument || !Locator.GetPlayerController().IsGrounded())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_savedType = Player.AnimationSync.CurrentType;
|
||||
CameraManager.Instance.SwitchTo3rdPerson();
|
||||
SwitchToType(type);
|
||||
@ -109,6 +112,7 @@ namespace QSB.Instruments
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CameraManager.Instance.SwitchTo1stPerson();
|
||||
SwitchToType(_savedType);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ namespace QSB.Instruments.QSBCamera
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UpdatePosition();
|
||||
UpdateInput();
|
||||
UpdateRotation();
|
||||
@ -43,6 +44,7 @@ namespace QSB.Instruments.QSBCamera
|
||||
// Raycast didn't hit collider, get target from camera direction
|
||||
localTargetPoint = RayLength * PercentToMove * localDirection;
|
||||
}
|
||||
|
||||
var targetDistance = Vector3.Distance(origin, transform.TransformPoint(localTargetPoint));
|
||||
var currentDistance = Vector3.Distance(origin, CameraObject.transform.position);
|
||||
var movement = targetDistance < currentDistance
|
||||
|
@ -10,7 +10,6 @@ namespace QSB.Instruments.QSBCamera
|
||||
{
|
||||
public static CameraManager Instance;
|
||||
|
||||
|
||||
public bool IsSetUp { get; private set; }
|
||||
public CameraMode Mode { get; private set; }
|
||||
|
||||
@ -71,16 +70,19 @@ namespace QSB.Instruments.QSBCamera
|
||||
Mode = CameraMode.ThirdPerson;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Mode == CameraMode.ThirdPerson)
|
||||
{
|
||||
DebugLog.ToConsole("Warning - Already in 3rd person!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (OWInput.GetInputMode() != InputMode.Character)
|
||||
{
|
||||
DebugLog.ToConsole("Warning - Cannot change to 3rd person while not in Character inputmode!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
OWInput.ChangeInputMode(InputMode.None);
|
||||
QSBEventManager.FireEvent("SwitchActiveCamera", _owCamera);
|
||||
Locator.GetPlayerCamera().mainCamera.enabled = false;
|
||||
@ -89,6 +91,7 @@ namespace QSB.Instruments.QSBCamera
|
||||
var postProcessing = _cameraObj.AddComponent<PostProcessingBehaviour>();
|
||||
postProcessing.profile = Locator.GetPlayerCamera().gameObject.GetComponent<PostProcessingBehaviour>().profile;
|
||||
}
|
||||
|
||||
_camera.enabled = true;
|
||||
Mode = CameraMode.ThirdPerson;
|
||||
}
|
||||
@ -102,11 +105,13 @@ namespace QSB.Instruments.QSBCamera
|
||||
Mode = CameraMode.FirstPerson;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Mode == CameraMode.FirstPerson)
|
||||
{
|
||||
DebugLog.ToConsole("Warning - Already in 1st person!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
OWInput.ChangeInputMode(InputMode.Character);
|
||||
QSBEventManager.FireEvent("SwitchActiveCamera", Locator.GetPlayerCamera());
|
||||
Locator.GetActiveCamera().mainCamera.enabled = true;
|
||||
|
@ -50,6 +50,7 @@ namespace QSB.ItemSync.Events
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
itemObject.PickUpItem(itemSocket, message.AboutId);
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ namespace QSB.ItemSync.Events
|
||||
DebugLog.ToConsole($"Warning - Trying to start unsocket on socket that is unoccupied! Socket:{(socketWorldObject as IWorldObject).Name}");
|
||||
return;
|
||||
}
|
||||
|
||||
socketWorldObject.RemoveFromSocket();
|
||||
return;
|
||||
case SocketEventType.CompleteUnsocket:
|
||||
|
@ -27,6 +27,7 @@ namespace QSB.ItemSync
|
||||
DebugLog.ToConsole($"Error - Trying to run GetObject (Item) with null unity object!", MessageType.Error);
|
||||
return default;
|
||||
}
|
||||
|
||||
IQSBOWItem worldObj = null;
|
||||
if (unityObject.GetType() == typeof(ScrollItem))
|
||||
{
|
||||
@ -48,6 +49,7 @@ namespace QSB.ItemSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - couldn't work out type of OWItem {unityObject.name}.", MessageType.Warning);
|
||||
}
|
||||
|
||||
return worldObj;
|
||||
}
|
||||
|
||||
@ -58,6 +60,7 @@ namespace QSB.ItemSync
|
||||
DebugLog.ToConsole($"Error - Trying to run GetObject (Socket) with null unity object!", MessageType.Error);
|
||||
return default;
|
||||
}
|
||||
|
||||
IQSBOWItemSocket worldObj = null;
|
||||
if (unityObject.GetType() == typeof(ScrollSocket))
|
||||
{
|
||||
@ -79,6 +82,7 @@ namespace QSB.ItemSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - couldn't work out type of OWItemSocket {unityObject.name}.", MessageType.Warning);
|
||||
}
|
||||
|
||||
return worldObj;
|
||||
}
|
||||
}
|
||||
|
@ -61,10 +61,12 @@ namespace QSB.ItemSync.Patches
|
||||
gameObject2 = gameObject2.transform.parent.gameObject;
|
||||
sectorGroup = gameObject2.GetComponent<ISectorGroup>();
|
||||
}
|
||||
|
||||
if (sectorGroup != null)
|
||||
{
|
||||
sector = sectorGroup.GetSector();
|
||||
}
|
||||
|
||||
var parent = (detachableFragment != null)
|
||||
? detachableFragment.transform
|
||||
: targetRigidbody.transform;
|
||||
@ -79,6 +81,7 @@ namespace QSB.ItemSync.Patches
|
||||
QSBEventManager.FireEvent(EventNames.QSBDropItem, objectId, localPos, hit.normal, parentSector);
|
||||
return false;
|
||||
}
|
||||
|
||||
DebugLog.ToConsole($"Error - No sector found for rigidbody {targetRigidbody.name}!.", MessageType.Error);
|
||||
return false;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ namespace QSB.ItemSync.WorldObjects
|
||||
var qsbObj = ItemManager.GetObject(InitialParent.GetComponent<OWItemSocket>());
|
||||
InitialSocket = qsbObj;
|
||||
}
|
||||
|
||||
QSBPlayerManager.OnRemovePlayer += OnPlayerLeave;
|
||||
}
|
||||
|
||||
@ -38,11 +39,13 @@ namespace QSB.ItemSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (InitialSocket != null)
|
||||
{
|
||||
InitialSocket.PlaceIntoSocket(this);
|
||||
return;
|
||||
}
|
||||
|
||||
AttachedObject.transform.parent = InitialParent;
|
||||
AttachedObject.transform.localPosition = InitialPosition;
|
||||
AttachedObject.transform.localRotation = InitialRotation;
|
||||
@ -63,7 +66,6 @@ namespace QSB.ItemSync.WorldObjects
|
||||
HoldingPlayer = 0;
|
||||
}
|
||||
|
||||
|
||||
public virtual void PickUpItem(Transform holdTransform, uint playerId)
|
||||
{
|
||||
AttachedObject.PickUpItem(holdTransform);
|
||||
|
@ -34,10 +34,12 @@ namespace QSB.LogSync.Events
|
||||
{
|
||||
QSBWorldSync.AddFactReveal(message.FactId, message.SaveGame, message.ShowNotification);
|
||||
}
|
||||
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Locator.GetShipLogManager().RevealFact(message.FactId, message.SaveGame, message.ShowNotification);
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ namespace QSB.LogSync.Patches
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBRevealFact, id, saveGame, showNotification);
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@ namespace QSB.Messaging
|
||||
QNetworkServer.handlers.Remove(_eventType);
|
||||
QNetworkManager.singleton.client.handlers.Remove(_eventType);
|
||||
}
|
||||
|
||||
QNetworkServer.RegisterHandler(_eventType, OnServerReceiveMessageHandler);
|
||||
QNetworkManager.singleton.client.RegisterHandler(_eventType, OnClientReceiveMessageHandler);
|
||||
}
|
||||
@ -45,6 +46,7 @@ namespace QSB.Messaging
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QNetworkServer.SendToAll(_eventType, message);
|
||||
}
|
||||
|
||||
@ -54,6 +56,7 @@ namespace QSB.Messaging
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QNetworkManager.singleton.client.Send(_eventType, message);
|
||||
}
|
||||
|
||||
|
@ -57,15 +57,18 @@ namespace QSB.OrbSync.Events
|
||||
DebugLog.ToConsole($"Error - OrbTransformSyncs is empty or null. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (QSBWorldSync.OldOrbList == null || QSBWorldSync.OldOrbList.Count == 0)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - OldOrbList is empty or null. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fromPlayer == null)
|
||||
{
|
||||
DebugLog.ToConsole("Error - FromPlayer is null!", MessageType.Error);
|
||||
}
|
||||
|
||||
var orbSync = NomaiOrbTransformSync.OrbTransformSyncs
|
||||
.FirstOrDefault(x => x.AttachedObject == QSBWorldSync.OldOrbList[message.ObjectId].gameObject);
|
||||
if (orbSync == null)
|
||||
@ -73,16 +76,19 @@ namespace QSB.OrbSync.Events
|
||||
DebugLog.ToConsole($"Error - No orb found for user event. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var orbIdentity = orbSync.GetComponent<QNetworkIdentity>();
|
||||
if (orbIdentity == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Orb identity is null. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (orbIdentity.ClientAuthorityOwner != null && orbIdentity.ClientAuthorityOwner != fromPlayer)
|
||||
{
|
||||
orbIdentity.RemoveClientAuthority(orbIdentity.ClientAuthorityOwner);
|
||||
}
|
||||
|
||||
orbIdentity.AssignClientAuthority(fromPlayer);
|
||||
orbSync.enabled = true;
|
||||
}
|
||||
@ -94,16 +100,19 @@ namespace QSB.OrbSync.Events
|
||||
DebugLog.ToConsole($"Error - OrbTransformSyncs is empty or null. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (QSBWorldSync.OldOrbList == null || QSBWorldSync.OldOrbList.Count == 0)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - OldOrbList is empty or null. (ID {message.ObjectId})", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!NomaiOrbTransformSync.OrbTransformSyncs.Any(x => x.AttachedObject == QSBWorldSync.OldOrbList[message.ObjectId].gameObject))
|
||||
{
|
||||
DebugLog.ToConsole($"Error - No NomaiOrbTransformSync has AttachedOrb with objectId {message.ObjectId}!");
|
||||
return;
|
||||
}
|
||||
|
||||
var orb = NomaiOrbTransformSync.OrbTransformSyncs
|
||||
.First(x => x.AttachedObject == QSBWorldSync.OldOrbList[message.ObjectId].gameObject);
|
||||
orb.enabled = true;
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.OrbSync
|
||||
NomaiOrbTransformSync.OrbTransformSyncs.Clear();
|
||||
QSBWorldSync.OldOrbList.ForEach(x => QNetworkServer.Spawn(Instantiate(QSBNetworkManager.Instance.OrbPrefab)));
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"Finished orb build with {QSBWorldSync.OldOrbList.Count} orbs.", MessageType.Success);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ namespace QSB.OrbSync.Patches
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
var orbDistance = Vector3.Distance(orb.transform.position, __instance.transform.position);
|
||||
var triggerRadius = orb.IsBeingDragged() ? ____exitRadius : ____radius;
|
||||
if (____occupyingOrb == null && orbDistance < ____radius)
|
||||
@ -35,14 +36,17 @@ namespace QSB.OrbSync.Patches
|
||||
QSBWorldSync.HandleSlotStateChange(__instance, orb, true);
|
||||
QSBWorldSync.RaiseEvent(__instance, "OnSlotActivated", __instance);
|
||||
}
|
||||
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (____occupyingOrb == null || ____occupyingOrb != orb)
|
||||
{
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (orbDistance > triggerRadius)
|
||||
{
|
||||
QSBWorldSync.HandleSlotStateChange(__instance, orb, false);
|
||||
@ -51,6 +55,7 @@ namespace QSB.OrbSync.Patches
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
@ -33,16 +33,19 @@ namespace QSB.OrbSync.TransformSync
|
||||
DebugLog.ToConsole($"Error - Index cannot be found.", OWML.Common.MessageType.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (QSBWorldSync.OldOrbList == null || QSBWorldSync.OldOrbList.Count <= _index)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - OldOrbList is null or does not contain index {_index}.", OWML.Common.MessageType.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (QSBWorldSync.OldOrbList[_index] == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - OldOrbList index {_index} is null.", OWML.Common.MessageType.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
return QSBWorldSync.OldOrbList[_index].gameObject;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ namespace QSB.OrbSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBOrbSlot, ObjectId, orbId, state);
|
||||
}
|
||||
|
||||
@ -32,6 +33,7 @@ namespace QSB.OrbSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var occOrb = state ? QSBWorldSync.OldOrbList[orbId] : null;
|
||||
AttachedObject.SetValue("_occupyingOrb", occOrb);
|
||||
var ev = state ? "OnSlotActivated" : "OnSlotDeactivated";
|
||||
|
@ -22,6 +22,7 @@ namespace QSB.Patches
|
||||
DebugLog.DebugWrite($"[Unpatch] {item.DeclaringType}.{item.Name}", MessageType.Info);
|
||||
instance.Unpatch(item, HarmonyPatchType.All);
|
||||
}
|
||||
|
||||
_patchedMethods.Clear();
|
||||
}
|
||||
|
||||
@ -54,6 +55,7 @@ namespace QSB.Patches
|
||||
{
|
||||
QSBCore.Helper.HarmonyHelper.AddPostfix(method, GetType(), patchName);
|
||||
}
|
||||
|
||||
_patchedMethods.Add(method);
|
||||
}
|
||||
|
||||
@ -94,6 +96,7 @@ namespace QSB.Patches
|
||||
return assemblyTypes[j];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.Player.Events
|
||||
player.EntangledObject = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var quantumObject = QSBWorldSync.GetWorldFromId<IQSBQuantumObject>(message.ObjectId);
|
||||
player.EntangledObject = quantumObject;
|
||||
}
|
||||
@ -40,6 +41,7 @@ namespace QSB.Player.Events
|
||||
player.EntangledObject = null;
|
||||
return;
|
||||
}
|
||||
|
||||
var quantumObject = QSBWorldSync.GetWorldFromId<IQSBQuantumObject>(message.ObjectId);
|
||||
player.EntangledObject = quantumObject;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.Player.Events
|
||||
QSBEventManager.FireEvent(EventNames.QSBPlayerKick, message.AboutId, KickReason.VersionNotMatching);
|
||||
return;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(message.AboutId);
|
||||
player.Name = message.PlayerName;
|
||||
DebugLog.ToAll($"{player.Name} joined!", MessageType.Info);
|
||||
|
@ -27,6 +27,7 @@ namespace QSB.Player.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QSBCore.UnityEvents.FireInNUpdates(() => KickPlayer(message.AboutId), 10);
|
||||
}
|
||||
|
||||
@ -42,9 +43,11 @@ namespace QSB.Player.Events
|
||||
DebugLog.ToAll($"{QSBPlayerManager.GetPlayer(message.AboutId).Name} was kicked.");
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.ToAll($"Player id:{message.AboutId} was kicked.");
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.ToAll($"Kicked from server. Reason : {message.EnumValue}");
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,13 @@ namespace QSB.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var controller = Locator.GetPlayerController();
|
||||
if (controller == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var collidingQuantumObject = controller.GetValue<QuantumObject>("_collidingQuantumObject");
|
||||
if (_previousCollidingQuantumObject != collidingQuantumObject)
|
||||
{
|
||||
|
@ -38,6 +38,7 @@ namespace QSB.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_markerLabel = _player.Name.ToUpper();
|
||||
_isReady = false;
|
||||
|
||||
@ -51,10 +52,12 @@ namespace QSB.Player
|
||||
{
|
||||
_canvasMarker.DestroyMarker();
|
||||
}
|
||||
|
||||
if (_markerTarget != null)
|
||||
{
|
||||
Destroy(_markerTarget.gameObject);
|
||||
}
|
||||
|
||||
Destroy(this);
|
||||
}
|
||||
}
|
||||
|
@ -67,6 +67,7 @@ namespace QSB.Player
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
FlashLight?.UpdateState(PlayerStates.FlashlightActive);
|
||||
Translator?.ChangeEquipState(PlayerStates.TranslatorEquipped);
|
||||
ProbeLauncher?.ChangeEquipState(PlayerStates.ProbeLauncherEquipped);
|
||||
|
@ -41,6 +41,7 @@ namespace QSB.Player
|
||||
{
|
||||
markerManager.RegisterMarker(_canvasMarker, transform);
|
||||
}
|
||||
|
||||
_canvasMarker.SetLabel(PlayerName.ToUpper());
|
||||
_canvasMarker.SetColor(Color.white);
|
||||
_canvasMarker.SetVisibility(false);
|
||||
@ -56,6 +57,7 @@ namespace QSB.Player
|
||||
{
|
||||
InitMarker();
|
||||
}
|
||||
|
||||
var a = Locator.GetActiveCamera().WorldToScreenPoint(transform.position);
|
||||
var b = Locator.GetActiveCamera().WorldToScreenPoint(_playerTransform.position);
|
||||
var vector = a - b;
|
||||
|
@ -25,11 +25,13 @@ namespace QSB.Player
|
||||
$"{Environment.NewLine} Called from {method.DeclaringType.Name}.{method.Name} ", MessageType.Error);
|
||||
return uint.MaxValue;
|
||||
}
|
||||
|
||||
if (localInstance.NetIdentity == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Trying to get LocalPlayerId when the local PlayerTransformSync instance's QNetworkIdentity is null.", MessageType.Error);
|
||||
return uint.MaxValue;
|
||||
}
|
||||
|
||||
return localInstance.NetIdentity.NetId.Value;
|
||||
}
|
||||
}
|
||||
@ -54,11 +56,13 @@ namespace QSB.Player
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
var player = PlayerList.FirstOrDefault(x => x.PlayerId == id);
|
||||
if (player != null)
|
||||
{
|
||||
return player;
|
||||
}
|
||||
|
||||
var trace = new StackTrace().GetFrame(1).GetMethod();
|
||||
DebugLog.DebugWrite($"Create Player : id<{id}> (Called from {trace.DeclaringType.Name}.{trace.Name})", MessageType.Info);
|
||||
player = new PlayerInfo(id);
|
||||
@ -112,6 +116,7 @@ namespace QSB.Player
|
||||
{
|
||||
cameraList.Add(LocalPlayer);
|
||||
}
|
||||
|
||||
return cameraList;
|
||||
}
|
||||
|
||||
@ -132,6 +137,7 @@ namespace QSB.Player
|
||||
DebugLog.ToConsole($"Warning - Player {playerId} has a null player model!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var renderer in player.Body.GetComponentsInChildren<Renderer>())
|
||||
{
|
||||
renderer.enabled = visible;
|
||||
@ -152,6 +158,7 @@ namespace QSB.Player
|
||||
DebugLog.DebugWrite($"Error - Cannot get closest player from empty player list.", MessageType.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
return playerList.Where(x => x.PlayerStates.IsReady).OrderBy(x => Vector3.Distance(x.Body.transform.position, worldPoint)).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ namespace QSB.PoolSync
|
||||
s_propID_Ripple2Position = Shader.PropertyToID("_Ripple2Position");
|
||||
s_propID_Ripple2Params = Shader.PropertyToID("_Ripple2Params");
|
||||
}
|
||||
|
||||
_socket = GetComponentInChildren<SharedStoneSocket>();
|
||||
if (_socket != null)
|
||||
{
|
||||
@ -88,6 +89,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
Debug.LogWarning("SharedStoneSocket not found!", this);
|
||||
}
|
||||
|
||||
UpdatePoolRenderer();
|
||||
_hologramGroup.SetActive(false);
|
||||
UpdateRendererFade();
|
||||
@ -101,6 +103,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
CustomPlatformList = new List<CustomNomaiRemoteCameraPlatform>(32);
|
||||
}
|
||||
|
||||
CustomPlatformList.Add(this);
|
||||
_playerCamera = Locator.GetPlayerCamera();
|
||||
if (_socket != null)
|
||||
@ -108,6 +111,7 @@ namespace QSB.PoolSync
|
||||
_socket.OnSocketableRemoved += OnSocketableRemoved;
|
||||
_socket.OnSocketableDonePlacing += OnSocketableDonePlacing;
|
||||
}
|
||||
|
||||
enabled = false;
|
||||
QSBPlayerManager.OnRemovePlayer += OnRemovePlayer;
|
||||
}
|
||||
@ -119,15 +123,18 @@ namespace QSB.PoolSync
|
||||
_socket.OnSocketableRemoved -= OnSocketableRemoved;
|
||||
_socket.OnSocketableDonePlacing -= OnSocketableDonePlacing;
|
||||
}
|
||||
|
||||
if (CustomPlatformList != null)
|
||||
{
|
||||
CustomPlatformList.Remove(this);
|
||||
}
|
||||
|
||||
if (_cameraState == CameraState.Connected || _cameraState == CameraState.Connecting_FadeIn || _cameraState == CameraState.Connecting_FadeOut)
|
||||
{
|
||||
DisconnectCamera();
|
||||
SwitchToPlayerCamera();
|
||||
}
|
||||
|
||||
QSBPlayerManager.OnRemovePlayer -= OnRemovePlayer;
|
||||
}
|
||||
|
||||
@ -159,6 +166,7 @@ namespace QSB.PoolSync
|
||||
UpdateHologramTransforms();
|
||||
}
|
||||
}
|
||||
|
||||
if (_platformActive)
|
||||
{
|
||||
UpdatePools(1f, _poolFillLength);
|
||||
@ -167,6 +175,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
UpdatePools(0f, _poolEmptyLength);
|
||||
}
|
||||
|
||||
switch (_cameraState)
|
||||
{
|
||||
case CameraState.WaitingForPedestalContact:
|
||||
@ -175,6 +184,7 @@ namespace QSB.PoolSync
|
||||
_cameraState = CameraState.Disconnected;
|
||||
ConnectCamera();
|
||||
}
|
||||
|
||||
break;
|
||||
case CameraState.Connecting_FadeIn:
|
||||
_transitionFade = Mathf.MoveTowards(_transitionFade, 1f, Time.deltaTime / _fadeInLength);
|
||||
@ -195,6 +205,7 @@ namespace QSB.PoolSync
|
||||
Locator.GetAudioMixer().MixRemoteCameraPlatform(_fadeInLength);
|
||||
_cameraState = CameraState.Connecting_FadeOut;
|
||||
}
|
||||
|
||||
break;
|
||||
case CameraState.Connecting_FadeOut:
|
||||
_slavePlatform._transitionFade = Mathf.MoveTowards(_slavePlatform._transitionFade, 0f, Time.deltaTime / _fadeInLength);
|
||||
@ -205,6 +216,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_cameraState = CameraState.Connected;
|
||||
}
|
||||
|
||||
break;
|
||||
case CameraState.Connected:
|
||||
VerifySectorOccupancy();
|
||||
@ -231,6 +243,7 @@ namespace QSB.PoolSync
|
||||
_hologramGroup.SetActive(false);
|
||||
_cameraState = CameraState.Disconnecting_FadeOut;
|
||||
}
|
||||
|
||||
break;
|
||||
case CameraState.Disconnecting_FadeOut:
|
||||
_transitionFade = Mathf.MoveTowards(_transitionFade, 0f, Time.deltaTime / _fadeOutLength);
|
||||
@ -239,8 +252,10 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_cameraState = CameraState.Disconnected;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if (_cameraState == CameraState.Disconnected && !_platformActive && _poolT == 0f)
|
||||
{
|
||||
enabled = false;
|
||||
@ -256,8 +271,10 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_slavePlatform = null;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
UpdatePoolRenderer();
|
||||
_slavePlatform._poolT = _poolT;
|
||||
_slavePlatform.UpdatePoolRenderer();
|
||||
@ -276,16 +293,17 @@ namespace QSB.PoolSync
|
||||
{
|
||||
parentSector.AddOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
|
||||
parentSector = parentSector.GetParentSector();
|
||||
}
|
||||
}
|
||||
|
||||
if (_slavePlatform._visualSector2 != null && !_slavePlatform._visualSector2.ContainsOccupant(DynamicOccupant.Player))
|
||||
{
|
||||
_slavePlatform._visualSector2.AddOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void UpdatePoolRenderer()
|
||||
{
|
||||
_poolRenderer.transform.localPosition = new Vector3(0f, _poolHeightCurve.Evaluate(_poolT), 0f);
|
||||
@ -302,6 +320,7 @@ namespace QSB.PoolSync
|
||||
ripplePosition.y = playerPosition.z;
|
||||
rippleParams.x = 0.5f;
|
||||
}
|
||||
|
||||
_poolRenderer.material.SetVector(s_propID_Ripple2Position, ripplePosition);
|
||||
_poolRenderer.material.SetVector(s_propID_Ripple2Params, rippleParams);
|
||||
}
|
||||
@ -321,6 +340,7 @@ namespace QSB.PoolSync
|
||||
_transitionRenderers[i].enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
_ownedCamera.SetImageEffectFade(1f - _transitionFade);
|
||||
}
|
||||
|
||||
@ -339,6 +359,7 @@ namespace QSB.PoolSync
|
||||
DebugLog.ToConsole($"Error - Gameobject for {item.Key.PlayerId} in _playerToHologram is null!", MessageType.Error);
|
||||
continue;
|
||||
}
|
||||
|
||||
var hologram = item.Value.transform.GetChild(0);
|
||||
hologram.position = TransformPoint(item.Key.Body.transform.position, this, _slavePlatform);
|
||||
hologram.rotation = TransformRotation(item.Key.Body.transform.rotation, this, _slavePlatform);
|
||||
@ -362,10 +383,12 @@ namespace QSB.PoolSync
|
||||
{
|
||||
QSBEventManager.FireEvent(EventNames.QSBExitPlatform, CustomPlatformList.IndexOf(this));
|
||||
}
|
||||
|
||||
if (_slavePlatform == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DisconnectCamera();
|
||||
_transitionStone.SetActive(false);
|
||||
_slavePlatform._transitionStone.SetActive(false);
|
||||
@ -374,14 +397,17 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_transitionPedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
if (_slavePlatform._pedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._pedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
if (_slavePlatform._transitionPedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._transitionPedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
_sharedStone = null;
|
||||
_platformActive = false;
|
||||
_wasLocalInBounds = false;
|
||||
@ -395,17 +421,20 @@ namespace QSB.PoolSync
|
||||
{
|
||||
Debug.LogError("Placed an empty item or a non SharedStone in a NomaiRemoteCameraPlatform");
|
||||
}
|
||||
|
||||
_slavePlatform = GetPlatform(_sharedStone.GetRemoteCameraID());
|
||||
if (_slavePlatform == null)
|
||||
{
|
||||
Debug.LogError("Shared stone with Remote Camera ID: " + _sharedStone.GetRemoteCameraID() + " has no registered camera platform!");
|
||||
}
|
||||
|
||||
if (_slavePlatform == this || !_slavePlatform.gameObject.activeSelf)
|
||||
{
|
||||
_sharedStone = null;
|
||||
_slavePlatform = null;
|
||||
return;
|
||||
}
|
||||
|
||||
_transitionStone.SetActive(true);
|
||||
_slavePlatform._transitionStone.SetActive(true);
|
||||
_socket.GetPedestalAnimator().PlayClose();
|
||||
@ -413,14 +442,17 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_transitionPedestalAnimator.PlayClose();
|
||||
}
|
||||
|
||||
if (_slavePlatform._pedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._pedestalAnimator.PlayClose();
|
||||
}
|
||||
|
||||
if (_slavePlatform._transitionPedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._transitionPedestalAnimator.PlayClose();
|
||||
}
|
||||
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
@ -438,6 +470,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_alreadyOccupiedSectors.Add(_visualSector);
|
||||
}
|
||||
|
||||
_slavePlatform._visualSector.AddOccupant(Locator.GetPlayerSectorDetector());
|
||||
var parentSector = _slavePlatform._visualSector.GetParentSector();
|
||||
while (parentSector != null)
|
||||
@ -446,14 +479,17 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_alreadyOccupiedSectors.Add(parentSector);
|
||||
}
|
||||
|
||||
parentSector.AddOccupant(Locator.GetPlayerSectorDetector());
|
||||
parentSector = parentSector.GetParentSector();
|
||||
}
|
||||
}
|
||||
|
||||
if (_slavePlatform._visualSector2 != null)
|
||||
{
|
||||
_slavePlatform._visualSector2.AddOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
|
||||
if (_slavePlatform._darkZone != null)
|
||||
{
|
||||
_slavePlatform._darkZone.AddPlayerToZone(true);
|
||||
@ -468,6 +504,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_slavePlatform._visualSector.RemoveOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
|
||||
var parentSector = _slavePlatform._visualSector.GetParentSector();
|
||||
while (parentSector != null)
|
||||
{
|
||||
@ -475,17 +512,21 @@ namespace QSB.PoolSync
|
||||
{
|
||||
parentSector.RemoveOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
|
||||
parentSector = parentSector.GetParentSector();
|
||||
}
|
||||
}
|
||||
|
||||
if (_slavePlatform._visualSector2 != null)
|
||||
{
|
||||
_slavePlatform._visualSector2.RemoveOccupant(Locator.GetPlayerSectorDetector());
|
||||
}
|
||||
|
||||
if (_slavePlatform._darkZone != null)
|
||||
{
|
||||
_slavePlatform._darkZone.RemovePlayerFromZone(true);
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBExitPlatform, CustomPlatformList.IndexOf(this));
|
||||
GlobalMessenger.FireEvent("ExitNomaiRemoteCamera");
|
||||
_slavePlatform._ownedCamera.Deactivate();
|
||||
@ -506,6 +547,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var cameraState = _cameraState;
|
||||
if (cameraState != CameraState.Disconnected && cameraState != CameraState.Disconnecting_FadeOut)
|
||||
{
|
||||
@ -518,6 +560,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
_cameraState = CameraState.Connecting_FadeIn;
|
||||
}
|
||||
|
||||
_oneShotAudioSource.PlayOneShot(AudioType.NomaiRemoteCameraEntry, 1f);
|
||||
enabled = true;
|
||||
}
|
||||
@ -528,6 +571,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var cameraState = _cameraState;
|
||||
if (cameraState != CameraState.Connected && cameraState != CameraState.Connecting_FadeOut)
|
||||
{
|
||||
@ -551,6 +595,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_pedestalAnimator.HasMadeContact())
|
||||
{
|
||||
ConnectCamera();
|
||||
@ -569,21 +614,25 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_platformActive = false;
|
||||
if (_pedestalAnimator != null)
|
||||
{
|
||||
_pedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
if (_transitionPedestalAnimator != null)
|
||||
{
|
||||
_transitionPedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
if (_slavePlatform != null)
|
||||
{
|
||||
if (_slavePlatform._pedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._pedestalAnimator.PlayOpen();
|
||||
}
|
||||
|
||||
if (_slavePlatform._transitionPedestalAnimator != null)
|
||||
{
|
||||
_slavePlatform._transitionPedestalAnimator.PlayOpen();
|
||||
@ -615,6 +664,7 @@ namespace QSB.PoolSync
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -628,16 +678,19 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(id);
|
||||
if (!_playerToHologram.Any(x => x.Key == player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var hologram = _playerToHologram.First(x => x.Key == player).Value;
|
||||
if (hologram.activeSelf)
|
||||
{
|
||||
OnRemotePlayerExit(id);
|
||||
}
|
||||
|
||||
_playerToHologram.Remove(player);
|
||||
}
|
||||
|
||||
@ -656,6 +709,7 @@ namespace QSB.PoolSync
|
||||
_playerToHologram[player].SetActive(true);
|
||||
return;
|
||||
}
|
||||
|
||||
var hologramCopy = Instantiate(_playerHologram);
|
||||
hologramCopy.parent = _playerHologram.parent;
|
||||
Destroy(hologramCopy.GetChild(0).GetComponent<PlayerAnimController>());
|
||||
@ -673,6 +727,7 @@ namespace QSB.PoolSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - {playerId}'s VisibleAnimator is null!", MessageType.Error);
|
||||
}
|
||||
|
||||
mirror.Init(player.AnimationSync.VisibleAnimator, hologramCopy.GetChild(0).gameObject.GetComponent<Animator>());
|
||||
|
||||
_playerToHologram.Add(player, hologramCopy.gameObject);
|
||||
@ -686,11 +741,13 @@ namespace QSB.PoolSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(playerId);
|
||||
if (!_playerToHologram.ContainsKey(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_playerToHologram[player].SetActive(false);
|
||||
|
||||
if (!_platformActive)
|
||||
|
@ -11,10 +11,12 @@ namespace QSB.PoolSync
|
||||
{
|
||||
streaming.gameObject.AddComponent<CustomNomaiRemoteCameraStreaming>();
|
||||
}
|
||||
|
||||
foreach (var camera in Resources.FindObjectsOfTypeAll<NomaiRemoteCamera>())
|
||||
{
|
||||
camera.gameObject.AddComponent<CustomNomaiRemoteCamera>();
|
||||
}
|
||||
|
||||
foreach (var platform in Resources.FindObjectsOfTypeAll<NomaiRemoteCameraPlatform>())
|
||||
{
|
||||
platform.gameObject.AddComponent<CustomNomaiRemoteCameraPlatform>();
|
||||
|
@ -13,6 +13,7 @@ namespace QSB.ProbeSync
|
||||
gameObject.Show();
|
||||
return;
|
||||
}
|
||||
|
||||
gameObject.Hide();
|
||||
}
|
||||
}
|
||||
|
@ -169,7 +169,6 @@ namespace QSB
|
||||
offset3 += _debugLineSpacing;
|
||||
}
|
||||
|
||||
|
||||
GUI.Label(new Rect(420, offset3, 200f, 20f), $"Current Flyer : {ShipManager.Instance.CurrentFlyer}");
|
||||
offset3 += _debugLineSpacing;
|
||||
var ship = ShipTransformSync.LocalInstance;
|
||||
@ -197,6 +196,7 @@ namespace QSB
|
||||
GUI.Label(new Rect(420, offset3, 400f, 20f), $"Ship velocity mag. : {ship.GetVelocityChangeMagnitude()}");
|
||||
offset3 += _debugLineSpacing;
|
||||
}
|
||||
|
||||
GUI.Label(new Rect(420, offset3, 200f, 20f), $"Ship sectors :");
|
||||
offset3 += _debugLineSpacing;
|
||||
foreach (var sector in ship.SectorSync.SectorList)
|
||||
@ -241,6 +241,7 @@ namespace QSB
|
||||
{
|
||||
QSBNetworkManager.Instance.networkPort = Port;
|
||||
}
|
||||
|
||||
DebugMode = config.GetSettingsValue<bool>("debugMode");
|
||||
ShowLinesInDebug = config.GetSettingsValue<bool>("showLinesInDebug");
|
||||
}
|
||||
|
@ -112,6 +112,7 @@ namespace QSB
|
||||
child.Target = item.target;
|
||||
Destroy(item);
|
||||
}
|
||||
|
||||
Destroy(go.GetComponent<NetworkTransform>());
|
||||
Destroy(go.GetComponent<NetworkIdentity>());
|
||||
}
|
||||
@ -252,10 +253,12 @@ namespace QSB
|
||||
{
|
||||
Destroy(platform);
|
||||
}
|
||||
|
||||
foreach (var camera in Resources.FindObjectsOfTypeAll<CustomNomaiRemoteCamera>())
|
||||
{
|
||||
Destroy(camera);
|
||||
}
|
||||
|
||||
foreach (var streaming in Resources.FindObjectsOfTypeAll<CustomNomaiRemoteCameraStreaming>())
|
||||
{
|
||||
Destroy(streaming);
|
||||
|
@ -29,6 +29,7 @@ namespace QSB
|
||||
// So objects have time to be deleted, made, whatever
|
||||
QSBCore.UnityEvents.FireOnNextUpdate(() => WorldObjectManager.Rebuild(newScene));
|
||||
}
|
||||
|
||||
OnSceneLoaded?.SafeInvoke(newScene, universe);
|
||||
if (universe)
|
||||
{
|
||||
|
@ -29,6 +29,7 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var moon = Locator.GetQuantumMoon();
|
||||
var wasPlayerEntangled = moon.IsPlayerEntangled();
|
||||
var location = new RelativeLocationData(Locator.GetPlayerTransform().GetComponent<OWRigidbody>(), moon.transform);
|
||||
@ -44,6 +45,7 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
Physics.SyncTransforms();
|
||||
}
|
||||
|
||||
constantFoceDetector.AddConstantVolume(owRigidbody.GetAttachedGravityVolume(), true, true);
|
||||
moonBody.SetVelocity(OWPhysics.CalculateOrbitVelocity(owRigidbody, moonBody, message.OrbitAngle) + owRigidbody.GetVelocity());
|
||||
moon.SetValue("_stateIndex", message.StateIndex);
|
||||
@ -57,12 +59,14 @@ namespace QSB.QuantumSync.Events
|
||||
moon.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(moon, new object[] { -1 });
|
||||
moon.GetValue<AudioSignal>("_quantumSignal").SetSignalActivation(message.StateIndex != 5, 2f);
|
||||
}
|
||||
|
||||
moon.GetValue<ReferenceFrameVolume>("_referenceFrameVolume").gameObject.SetActive(message.StateIndex != 5);
|
||||
moonBody.SetIsTargetable(message.StateIndex != 5);
|
||||
foreach (var obj in moon.GetValue<GameObject[]>("_deactivateAtEye"))
|
||||
{
|
||||
obj.SetActive(message.StateIndex != 5);
|
||||
}
|
||||
|
||||
GlobalMessenger<OWRigidbody>.FireEvent("QuantumMoonChangeState", moonBody);
|
||||
|
||||
if (wasPlayerEntangled)
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var qsbObj = QSBWorldSync.GetWorldFromId<QSBMultiStateQuantumObject>(message.ObjectId);
|
||||
qsbObj.DebugBoxText.text = message.StateIndex.ToString();
|
||||
}
|
||||
@ -38,12 +39,14 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var qsbObj = QSBWorldSync.GetWorldFromId<QSBMultiStateQuantumObject>(message.ObjectId);
|
||||
if (qsbObj.ControllingPlayer != message.FromId)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Got MultiStateChangeEvent for {qsbObj.Name} from {message.FromId}, but it's currently controlled by {qsbObj.ControllingPlayer}!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
qsbObj.ChangeState(message.StateIndex);
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = QSBWorldSync.GetWorldFromId<QSBQuantumShuffleObject>(message.ObjectId);
|
||||
obj.ShuffleObjects(message.IndexArray);
|
||||
}
|
||||
|
@ -30,12 +30,14 @@ namespace QSB.QuantumSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var obj = QSBWorldSync.GetWorldFromId<QSBSocketedQuantumObject>(message.ObjectId);
|
||||
if (obj.ControllingPlayer != message.FromId)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Got SocketStateChangeEvent for {obj.Name} from {message.FromId}, but it's currently controlled by {obj.ControllingPlayer}!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
obj.MoveToSocket(message);
|
||||
}
|
||||
}
|
||||
|
@ -106,6 +106,7 @@ namespace QSB.QuantumSync.Patches
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool socketNotSuitable;
|
||||
var isSocketIlluminated = (bool)__instance.GetType().GetMethod("CheckIllumination", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, null);
|
||||
|
||||
@ -135,12 +136,14 @@ namespace QSB.QuantumSync.Patches
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
list.RemoveAt(index);
|
||||
if (list.Count == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
__instance.GetType().GetMethod("MoveToSocket", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { occupiedSocket });
|
||||
__result = false;
|
||||
return false;
|
||||
@ -158,6 +161,7 @@ namespace QSB.QuantumSync.Patches
|
||||
DebugLog.ToConsole($"Error - Trying to move {__instance.name} to a null socket!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var objectWorldObject = QSBWorldSync.GetWorldFromUnity<QSBSocketedQuantumObject, SocketedQuantumObject>(__instance);
|
||||
var socketWorldObject = QSBWorldSync.GetWorldFromUnity<QSBQuantumSocket, QuantumSocket>(socket);
|
||||
|
||||
@ -206,7 +210,6 @@ namespace QSB.QuantumSync.Patches
|
||||
____indexList[random] = temp;
|
||||
}
|
||||
|
||||
|
||||
for (var j = 0; j < ____shuffledObjects.Length; j++)
|
||||
{
|
||||
____shuffledObjects[j].localPosition = ____localPositions[____indexList[j]];
|
||||
@ -249,6 +252,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
__instance.GetType().GetMethod("CheckEnabled", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, null);
|
||||
}
|
||||
|
||||
if (____collapseOnStart)
|
||||
{
|
||||
__instance.GetType().GetMethod("Collapse", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { true });
|
||||
@ -269,6 +273,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var isInControl = qsbObj.ControllingPlayer == QSBPlayerManager.LocalPlayerId;
|
||||
return isInControl;
|
||||
}
|
||||
@ -284,6 +289,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var allMultiStates = QSBWorldSync.GetWorldObjects<QSBMultiStateQuantumObject>();
|
||||
var stateObject = QSBWorldSync.GetWorldFromUnity<QSBQuantumState, QuantumState>(__instance);
|
||||
var owner = allMultiStates.First(x => x.QuantumStates.Contains(stateObject));
|
||||
@ -291,6 +297,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var stateIndex = owner.QuantumStates.IndexOf(stateObject);
|
||||
QSBEventManager.FireEvent(
|
||||
EventNames.QSBMultiStateChange,
|
||||
@ -369,6 +376,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
____isProbeInside = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -390,6 +398,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
____isProbeInside = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -445,6 +454,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
__instance.GetType().GetMethod("Collapse", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { true });
|
||||
}
|
||||
|
||||
__instance.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { -1 });
|
||||
QSBEventManager.FireEvent("PlayerExitQuantumMoon");
|
||||
}
|
||||
@ -458,6 +468,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
Physics.SyncTransforms();
|
||||
}
|
||||
|
||||
var component = Locator.GetPlayerCamera().GetComponent<PlayerCameraController>();
|
||||
component.SetDegreesY(component.GetMinDegreesY());
|
||||
____vortexAudio.SetLocalVolume(0f);
|
||||
@ -466,6 +477,7 @@ namespace QSB.QuantumSync.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
____playerFogBubble.SetFogAlpha(fogAlpha);
|
||||
____shipLandingCamFogBubble.SetFogAlpha(fogAlpha);
|
||||
return false;
|
||||
|
@ -63,6 +63,7 @@ namespace QSB.QuantumSync.Patches
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
var point = __instance.transform.TransformPoint(____localIlluminationOffset);
|
||||
var tupleFlashlights = QSBPlayerManager.GetPlayerFlashlights();
|
||||
var localFlashlight = tupleFlashlights.First;
|
||||
@ -107,6 +108,7 @@ namespace QSB.QuantumSync.Patches
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ namespace QSB.QuantumSync.Patches
|
||||
DebugLog.ToConsole($"Warning - QuantumManager.Shrine is null.", MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
var shrineLit = QuantumManager.Shrine.IsPlayerInDarkness();
|
||||
|
||||
// If any of the players in the moon are not in the shrine
|
||||
@ -98,16 +99,19 @@ namespace QSB.QuantumSync.Patches
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Time.time - ____playerWarpTime < 1f)
|
||||
{
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (____stateIndex == 5 && ____isPlayerInside && !__instance.IsPlayerEntangled())
|
||||
{
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < 10; i++)
|
||||
{
|
||||
var stateIndex = (____collapseToIndex == -1) ? (int)__instance.GetType().GetMethod("GetRandomStateIndex", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, null) : ____collapseToIndex;
|
||||
@ -120,10 +124,12 @@ namespace QSB.QuantumSync.Patches
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (orbitIndex == -1)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - QM failed to find orbit for state {stateIndex}", MessageType.Error);
|
||||
}
|
||||
|
||||
var orbitRadius = (orbitIndex == -1) ? 10000f : ____orbits[orbitIndex].GetOrbitRadius();
|
||||
var owRigidbody = (orbitIndex == -1) ? Locator.GetAstroObject(AstroObject.Name.Sun).GetOWRigidbody() : ____orbits[orbitIndex].GetAttachedOWRigidbody();
|
||||
var onUnitSphere = UnityEngine.Random.onUnitSphere;
|
||||
@ -132,6 +138,7 @@ namespace QSB.QuantumSync.Patches
|
||||
onUnitSphere.y = 0f;
|
||||
onUnitSphere.Normalize();
|
||||
}
|
||||
|
||||
var position = (onUnitSphere * orbitRadius) + owRigidbody.GetWorldCenterOfMass();
|
||||
if (!Physics.CheckSphere(position, ____sphereCheckRadius, OWLayerMask.physicalMask) || ____collapseToIndex != -1)
|
||||
{
|
||||
@ -140,6 +147,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
Physics.SyncTransforms();
|
||||
}
|
||||
|
||||
if (__instance.IsPlayerEntangled() || !QuantumManager.IsVisibleUsingCameraFrustum((ShapeVisibilityTracker)____visibilityTracker, skipInstantVisibilityCheck).First)
|
||||
{
|
||||
____moonBody.transform.position = position;
|
||||
@ -147,6 +155,7 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
Physics.SyncTransforms();
|
||||
}
|
||||
|
||||
____visibilityTracker.transform.localPosition = Vector3.zero;
|
||||
____constantForceDetector.AddConstantVolume(owRigidbody.GetAttachedGravityVolume(), true, true);
|
||||
var velocity = owRigidbody.GetVelocity();
|
||||
@ -156,6 +165,7 @@ namespace QSB.QuantumSync.Patches
|
||||
velocity = (initialMotion == null) ? Vector3.zero : initialMotion.GetInitVelocity();
|
||||
____useInitialMotion = false;
|
||||
}
|
||||
|
||||
var orbitAngle = UnityEngine.Random.Range(0, 360);
|
||||
____moonBody.SetVelocity(OWPhysics.CalculateOrbitVelocity(owRigidbody, ____moonBody, orbitAngle) + velocity);
|
||||
____lastStateIndex = ____stateIndex;
|
||||
@ -166,9 +176,11 @@ namespace QSB.QuantumSync.Patches
|
||||
{
|
||||
____stateSkipCounts[k] = (k != ____stateIndex) ? (____stateSkipCounts[k] + 1) : 0;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBMoonStateChange, stateIndex, onUnitSphere, orbitAngle);
|
||||
break;
|
||||
}
|
||||
|
||||
____visibilityTracker.transform.localPosition = Vector3.zero;
|
||||
}
|
||||
else
|
||||
@ -176,6 +188,7 @@ namespace QSB.QuantumSync.Patches
|
||||
DebugLog.ToConsole("Warning - Quantum moon orbit position occupied! Aborting collapse.", MessageType.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
{
|
||||
if (____isPlayerInside)
|
||||
@ -187,16 +200,19 @@ namespace QSB.QuantumSync.Patches
|
||||
__instance.GetType().GetMethod("SetSurfaceState", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { -1 });
|
||||
____quantumSignal.SetSignalActivation(____stateIndex != 5, 2f);
|
||||
}
|
||||
|
||||
____referenceFrameVolume.gameObject.SetActive(____stateIndex != 5);
|
||||
____moonBody.SetIsTargetable(____stateIndex != 5);
|
||||
for (var l = 0; l < ____deactivateAtEye.Length; l++)
|
||||
{
|
||||
____deactivateAtEye[l].SetActive(____stateIndex != 5);
|
||||
}
|
||||
|
||||
GlobalMessenger<OWRigidbody>.FireEvent("QuantumMoonChangeState", ____moonBody);
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ namespace QSB.QuantumSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var quantumObjects = QSBWorldSync.GetWorldObjects<IQSBQuantumObject>().ToList();
|
||||
for (var i = 0; i < quantumObjects.Count; i++)
|
||||
{
|
||||
@ -84,10 +85,12 @@ namespace QSB.QuantumSync
|
||||
DebugLog.ToConsole($"Warning - Trying to run IsVisibleUsingCameraFrustum when there are no players!", MessageType.Warning);
|
||||
return new Tuple<bool, List<PlayerInfo>>(false, null);
|
||||
}
|
||||
|
||||
if (!tracker.gameObject.activeInHierarchy)
|
||||
{
|
||||
return new Tuple<bool, List<PlayerInfo>>(false, null);
|
||||
}
|
||||
|
||||
var frustumMethod = tracker.GetType().GetMethod("IsInFrustum", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
var playersWhoCanSee = new List<PlayerInfo>();
|
||||
@ -99,6 +102,7 @@ namespace QSB.QuantumSync
|
||||
DebugLog.ToConsole($"Warning - Camera is null for id:{player.PlayerId}!", MessageType.Warning);
|
||||
continue;
|
||||
}
|
||||
|
||||
var isInFrustum = (bool)frustumMethod.Invoke(tracker, new object[] { player.Camera.GetFrustumPlanes() });
|
||||
if (isInFrustum)
|
||||
{
|
||||
@ -124,6 +128,7 @@ namespace QSB.QuantumSync
|
||||
{
|
||||
return Enumerable.Empty<PlayerInfo>();
|
||||
}
|
||||
|
||||
var worldObj = GetObject(obj);
|
||||
return QSBPlayerManager.PlayerList.Where(x => x.EntangledObject == worldObj);
|
||||
}
|
||||
@ -155,6 +160,7 @@ namespace QSB.QuantumSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - couldn't work out type of QuantumObject {unityObject.name}.", MessageType.Warning);
|
||||
}
|
||||
|
||||
return worldObj;
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
{
|
||||
DebugBoxText = DebugBoxManager.CreateBox(AttachedObject.transform, 0, CurrentState.ToString()).GetComponent<Text>();
|
||||
}
|
||||
|
||||
base.Init(attachedObject, id);
|
||||
}
|
||||
|
||||
@ -40,6 +41,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
{
|
||||
QuantumStates[CurrentState].SetVisible(false);
|
||||
}
|
||||
|
||||
QuantumStates[newStateIndex].SetVisible(true);
|
||||
AttachedObject.SetValue("_stateIndex", newStateIndex);
|
||||
if (QSBCore.DebugMode)
|
||||
|
@ -43,6 +43,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
shape.OnShapeDeactivated += (Shape s)
|
||||
=> QSBCore.UnityEvents.FireOnNextUpdate(() => OnDisable(s));
|
||||
}
|
||||
|
||||
if (GetAttachedShapes().Any(x => !x.enabled || !x.active))
|
||||
{
|
||||
ControllingPlayer = 0u;
|
||||
@ -60,22 +61,26 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
{
|
||||
return new List<Shape>();
|
||||
}
|
||||
|
||||
var visibilityTrackers = AttachedObject.GetValue<VisibilityTracker[]>("_visibilityTrackers");
|
||||
if (visibilityTrackers == null || visibilityTrackers.Length == 0)
|
||||
{
|
||||
return new List<Shape>();
|
||||
}
|
||||
|
||||
if (visibilityTrackers.Any(x => x.GetType() == typeof(RendererVisibilityTracker)))
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - {AttachedObject.name} has a RendererVisibilityTracker!", MessageType.Warning);
|
||||
return new List<Shape>();
|
||||
}
|
||||
|
||||
var totalShapes = new List<Shape>();
|
||||
foreach (var tracker in visibilityTrackers)
|
||||
{
|
||||
var shapes = tracker.GetValue<Shape[]>("_shapes");
|
||||
totalShapes.AddRange(shapes);
|
||||
}
|
||||
|
||||
return totalShapes;
|
||||
}
|
||||
|
||||
@ -86,11 +91,13 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControllingPlayer != 0)
|
||||
{
|
||||
// controlled by another player, dont care that we activate it
|
||||
return;
|
||||
}
|
||||
|
||||
var id = QSBWorldSync.GetIdFromTypeSubset<IQSBQuantumObject>(this);
|
||||
// no one is controlling this object right now, request authority
|
||||
QSBEventManager.FireEvent(EventNames.QSBQuantumAuthority, id, QSBPlayerManager.LocalPlayerId);
|
||||
@ -102,20 +109,24 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetAttachedShapes().Any(x => x.isActiveAndEnabled))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
IsEnabled = false;
|
||||
if (!QSBCore.WorldObjectsReady && !QSBCore.IsServer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (ControllingPlayer != QSBPlayerManager.LocalPlayerId)
|
||||
{
|
||||
// not being controlled by us, don't care if we leave area
|
||||
return;
|
||||
}
|
||||
|
||||
var id = QSBWorldSync.GetIdFromTypeSubset<IQSBQuantumObject>(this);
|
||||
// send event to other players that we're releasing authority
|
||||
QSBEventManager.FireEvent(EventNames.QSBQuantumAuthority, id, 0u);
|
||||
|
@ -41,6 +41,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
DebugLog.ToConsole($"Couldn't find socket id {message.SocketId}", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var socket = qsbSocket.AttachedObject;
|
||||
if (socket == null)
|
||||
{
|
||||
|
@ -30,6 +30,7 @@ namespace QSB.RoastingSync.Events
|
||||
SendEvent(CreateMessage(-1, roasting));
|
||||
return;
|
||||
}
|
||||
|
||||
var qsbObj = QSBWorldSync.GetWorldFromUnity<QSBCampfire, Campfire>(campfire);
|
||||
SendEvent(CreateMessage(qsbObj.ObjectId, roasting));
|
||||
}
|
||||
@ -47,11 +48,13 @@ namespace QSB.RoastingSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.State && message.ObjectId == -1)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Null campfire supplied for start roasting event!", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(message.AboutId);
|
||||
player.RoastingStick.SetActive(message.State);
|
||||
if (message.State)
|
||||
|
@ -29,12 +29,14 @@ namespace QSB.RoastingSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var marshmallow = QSBPlayerManager.GetPlayer(message.AboutId).Marshmallow;
|
||||
if (marshmallow == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Marshmallow is null for player {message.AboutId}.", OWML.Common.MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (message.EnumValue)
|
||||
{
|
||||
case MarshmallowEventType.Burn:
|
||||
@ -73,6 +75,7 @@ namespace QSB.RoastingSync.Events
|
||||
DebugLog.DebugWrite($"Error - Campfire for {playerId} is null.", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
rigidbody.SetVelocity(player.Campfire.AttachedObject.GetAttachedOWRigidbody(false).GetPointVelocity(stickTip.position) + (stickTip.forward * 3f));
|
||||
rigidbody.SetAngularVelocity(stickTip.right * 10f);
|
||||
if (player.Marshmallow == null)
|
||||
@ -80,6 +83,7 @@ namespace QSB.RoastingSync.Events
|
||||
DebugLog.DebugWrite($"Error - Marshmallow for {playerId} is null.", OWML.Common.MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
tossedMallow.GetComponentInChildren<MeshRenderer>().material.color = player.Marshmallow._burntColor;
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ namespace QSB.RoastingSync.Patches
|
||||
____audioController.PlayMarshmallowCatchFire();
|
||||
QSBEventManager.FireEvent(EventNames.QSBMarshmallowEvent, MarshmallowEventType.Burn);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -52,6 +53,7 @@ namespace QSB.RoastingSync.Patches
|
||||
____mallowState = Marshmallow.MallowState.Shriveling;
|
||||
QSBEventManager.FireEvent(EventNames.QSBMarshmallowEvent, MarshmallowEventType.Shrivel);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -107,6 +109,7 @@ namespace QSB.RoastingSync.Patches
|
||||
QSBEventManager.FireEvent(EventNames.QSBMarshmallowEvent, MarshmallowEventType.Toss);
|
||||
}
|
||||
}
|
||||
|
||||
if (OWInput.IsNewlyPressed(InputLibrary.interact, InputMode.Roasting) && ____marshmallow.IsEdible())
|
||||
{
|
||||
____marshmallow.Eat();
|
||||
|
@ -83,9 +83,11 @@ namespace QSB.RoastingSync
|
||||
{
|
||||
_fireRenderer.enabled = false;
|
||||
}
|
||||
|
||||
transform.localScale = Vector3.one * (1f - shrivelFraction);
|
||||
}
|
||||
}
|
||||
|
||||
_heatPerSecond = 0f;
|
||||
}
|
||||
|
||||
@ -105,6 +107,7 @@ namespace QSB.RoastingSync
|
||||
{
|
||||
_smokeParticles.Play();
|
||||
}
|
||||
|
||||
var smokeColor = new Color(1f, 1f, 1f, num);
|
||||
_smokeParticlesSettings.startColor = smokeColor;
|
||||
}
|
||||
@ -112,6 +115,7 @@ namespace QSB.RoastingSync
|
||||
{
|
||||
_smokeParticles.Stop();
|
||||
}
|
||||
|
||||
Color newColor;
|
||||
if (_toastedFraction < PERFECT_TOASTED_FRACTION)
|
||||
{
|
||||
@ -123,6 +127,7 @@ namespace QSB.RoastingSync
|
||||
var fractionTowardsBurnt = (_toastedFraction - PERFECT_TOASTED_FRACTION) / 0.3f;
|
||||
newColor = Color.Lerp(_toastedColor, _burntColor, fractionTowardsBurnt);
|
||||
}
|
||||
|
||||
_mallowRenderer.material.color = Color.Lerp(_mallowRenderer.material.color, newColor, RAW_TOASTED_FRACTION);
|
||||
_smokeParticles.transform.forward = Locator.GetPlayerTransform().up;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ namespace QSB.SectorSync
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sync as QNetworkBehaviour).HasAuthority
|
||||
&& sync.AttachedObject.gameObject.activeInHierarchy
|
||||
&& sync.IsReady)
|
||||
@ -44,6 +45,7 @@ namespace QSB.SectorSync
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sync as QNetworkBehaviour).HasAuthority
|
||||
&& sync.AttachedObject.gameObject.activeInHierarchy
|
||||
&& sync.IsReady)
|
||||
@ -78,6 +80,7 @@ namespace QSB.SectorSync
|
||||
DebugLog.ToConsole($"Error - TimeLoopRing_Body not found!", MessageType.Error);
|
||||
}
|
||||
}
|
||||
|
||||
QSBWorldSync.Init<QSBSector, Sector>();
|
||||
IsReady = QSBWorldSync.GetWorldObjects<QSBSector>().Any();
|
||||
}
|
||||
@ -91,10 +94,12 @@ namespace QSB.SectorSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (closestSector == transformSync.ReferenceSector)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
transformSync.SetReferenceSector(closestSector);
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ namespace QSB.SectorSync
|
||||
_sectorDetector.OnEnterSector -= AddSector;
|
||||
_sectorDetector.OnExitSector -= RemoveSector;
|
||||
}
|
||||
|
||||
_sectorDetector = detector;
|
||||
_sectorDetector.OnEnterSector += AddSector;
|
||||
_sectorDetector.OnExitSector += RemoveSector;
|
||||
@ -54,11 +55,13 @@ namespace QSB.SectorSync
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Can't find QSBSector for sector {sector.name}!", MessageType.Error);
|
||||
}
|
||||
|
||||
if (SectorList.Contains(worldObject))
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Trying to add {sector.name} for {gameObject.name}, but is already in list", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
SectorList.Add(worldObject);
|
||||
}
|
||||
|
||||
@ -70,11 +73,13 @@ namespace QSB.SectorSync
|
||||
DebugLog.ToConsole($"Error - Can't find QSBSector for sector {sector.name}!", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!SectorList.Contains(worldObject))
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Trying to remove {sector.name} for {gameObject.name}, but is not in list!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
SectorList.Remove(worldObject);
|
||||
}
|
||||
|
||||
@ -98,6 +103,7 @@ namespace QSB.SectorSync
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
var ordered = activeNotNullNotBlacklisted
|
||||
.OrderBy(sector => CalculateSectorScore(sector, trans, _attachedOWRigidbody));
|
||||
|
||||
@ -140,6 +146,7 @@ namespace QSB.SectorSync
|
||||
return trigger.GetShape().CalcWorldBounds().radius;
|
||||
}
|
||||
}
|
||||
|
||||
return 0f;
|
||||
}
|
||||
|
||||
@ -152,6 +159,7 @@ namespace QSB.SectorSync
|
||||
var relativeVelocityMagnitude = relativeVelocity.sqrMagnitude; // Remember this is squared for efficiency!
|
||||
return relativeVelocityMagnitude;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ namespace QSB.SectorSync.WorldObjects
|
||||
DebugLog.ToConsole($"Warning - Expected to find a NomaiShuttleController for {AttachedObject.name}!", MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!shuttleController.IsPlayerInside())
|
||||
{
|
||||
return false;
|
||||
@ -73,12 +74,14 @@ namespace QSB.SectorSync.WorldObjects
|
||||
DebugLog.ToConsole($"Warning - Expected to find a EyeShuttleController for {AttachedObject.name}!", MessageType.Warning);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!shuttleController.GetValue<bool>("_isPlayerInside"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ namespace QSB.ShipSync.Events
|
||||
{
|
||||
shipNetId.RemoveClientAuthority(shipNetId.ClientAuthorityOwner);
|
||||
}
|
||||
|
||||
shipNetId.AssignClientAuthority(newAuthority);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ namespace QSB.ShipSync.Patches
|
||||
ShipManager.Instance.ShipTractorBeam.ActivateTractorBeam();
|
||||
QSBEventManager.FireEvent(EventNames.QSBEnableFunnel);
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(EventNames.QSBHatchState, true);
|
||||
return true;
|
||||
}
|
||||
@ -35,6 +36,7 @@ namespace QSB.ShipSync.Patches
|
||||
{
|
||||
QSBEventManager.FireEvent(EventNames.QSBHatchState, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -46,6 +48,7 @@ namespace QSB.ShipSync.Patches
|
||||
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
|
||||
QSBEventManager.FireEvent(EventNames.QSBHatchState, false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ namespace QSB.ShipSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Trying to set current flyer while someone is still flying? Current:{_currentFlyer}, New:{value}", MessageType.Warning);
|
||||
}
|
||||
|
||||
_currentFlyer = value;
|
||||
}
|
||||
}
|
||||
@ -55,6 +56,7 @@ namespace QSB.ShipSync
|
||||
{
|
||||
QNetworkServer.Destroy(ShipTransformSync.LocalInstance.gameObject);
|
||||
}
|
||||
|
||||
QNetworkServer.Spawn(Instantiate(QSBNetworkManager.Instance.ShipPrefab));
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,12 @@ namespace QSB.StatueSync.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!____waitForPlayerGrounded || !Locator.GetPlayerController().IsGrounded())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var playerBody = Locator.GetPlayerBody().transform;
|
||||
var timberHearth = Locator.GetAstroObject(AstroObject.Name.TimberHearth).transform;
|
||||
QSBEventManager.FireEvent(
|
||||
|
@ -69,6 +69,7 @@ namespace QSB.Syncs
|
||||
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
SetRotation(_referenceTransform.InverseTransformRotation(worldRotation));
|
||||
}
|
||||
|
||||
@ -94,6 +95,7 @@ namespace QSB.Syncs
|
||||
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
return _referenceTransform.TransformPoint(GetPosition());
|
||||
}
|
||||
|
||||
@ -107,6 +109,7 @@ namespace QSB.Syncs
|
||||
DebugLog.DebugWrite($"Error - _referenceTransform has not been set for {_attachedTransform.name}", MessageType.Error);
|
||||
return Quaternion.identity;
|
||||
}
|
||||
|
||||
return _referenceTransform.TransformRotation(GetRotation());
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var closestSector = SectorSync.GetClosestSector(AttachedObject.transform);
|
||||
if (closestSector != null)
|
||||
{
|
||||
@ -48,6 +49,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
{
|
||||
_intermediaryTransform = new IntermediaryTransform(transform);
|
||||
}
|
||||
|
||||
if (ReferenceSector != null)
|
||||
{
|
||||
writer.Write(ReferenceSector.ObjectId);
|
||||
@ -56,6 +58,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
{
|
||||
writer.Write(-1);
|
||||
}
|
||||
|
||||
base.SerializeTransform(writer);
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
{
|
||||
DebugLog.ToConsole($"Error - {_logName} is being init-ed when not in the universe!", MessageType.Error);
|
||||
}
|
||||
|
||||
AttachedObject = GetRigidbody();
|
||||
_isInitialized = true;
|
||||
}
|
||||
@ -223,6 +224,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
}
|
||||
@ -237,6 +239,7 @@ namespace QSB.Syncs.RigidbodySync
|
||||
_previousDistance = distance;
|
||||
return targetPosition;
|
||||
}
|
||||
|
||||
_previousDistance = distance;
|
||||
return Vector3.SmoothDamp(currentPosition, targetPosition, ref _positionSmoothVelocity, SmoothTime);
|
||||
}
|
||||
@ -281,17 +284,20 @@ namespace QSB.Syncs.RigidbodySync
|
||||
DebugLog.ToConsole($"Error - Trying to get relative velocity when AttachedObject is null.", MessageType.Error);
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
if (ReferenceTransform == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - Trying to get relative velocity when ReferenceTransform is null. ({AttachedObject.name})", MessageType.Error);
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
var attachedRigid = ReferenceTransform.GetAttachedOWRigidbody();
|
||||
if (attachedRigid == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Error - ReferenceTransform ({ReferenceTransform.name}) on {AttachedObject.name} has no attached OWRigidBody.", MessageType.Error);
|
||||
return Vector3.zero;
|
||||
}
|
||||
|
||||
var pointVelocity = attachedRigid.GetPointVelocity(AttachedObject.transform.position);
|
||||
return AttachedObject.GetVelocity() - pointVelocity;
|
||||
}
|
||||
|
@ -83,6 +83,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
Destroy(AttachedObject.gameObject);
|
||||
}
|
||||
|
||||
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
@ -95,10 +96,12 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
DebugLog.ToConsole($"Error - {_logName} is being init-ed when not in the universe!", MessageType.Error);
|
||||
}
|
||||
|
||||
if (!HasAuthority && AttachedObject != null)
|
||||
{
|
||||
Destroy(AttachedObject.gameObject);
|
||||
}
|
||||
|
||||
AttachedObject = HasAuthority ? InitLocalTransform() : InitRemoteTransform();
|
||||
_isInitialized = true;
|
||||
}
|
||||
@ -195,6 +198,7 @@ namespace QSB.Syncs.TransformSync
|
||||
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||
return;
|
||||
}
|
||||
|
||||
var targetPos = _intermediaryTransform.GetTargetPosition_ParentedToReference();
|
||||
var targetRot = _intermediaryTransform.GetTargetRotation_ParentedToReference();
|
||||
if (targetPos != Vector3.zero && _intermediaryTransform.GetTargetPosition_Unparented() != Vector3.zero)
|
||||
@ -225,6 +229,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
if (AttachedObject == null)
|
||||
@ -235,6 +240,7 @@ namespace QSB.Syncs.TransformSync
|
||||
() => ReparentAttachedObject(transform));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!HasAuthority)
|
||||
{
|
||||
ReparentAttachedObject(transform);
|
||||
@ -247,6 +253,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Trying to reparent AttachedObject {AttachedObject.name} which wasnt attached to sector!", MessageType.Warning);
|
||||
}
|
||||
|
||||
AttachedObject.transform.SetParent(sectorTransform, true);
|
||||
AttachedObject.transform.localScale = GetType() == typeof(PlayerTransformSync)
|
||||
? Vector3.one / 10
|
||||
@ -261,6 +268,7 @@ namespace QSB.Syncs.TransformSync
|
||||
_previousDistance = distance;
|
||||
return targetPosition;
|
||||
}
|
||||
|
||||
_previousDistance = distance;
|
||||
return Vector3.SmoothDamp(currentPosition, targetPosition, ref _positionSmoothVelocity, SmoothTime);
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var closestSector = SectorSync.GetClosestSector(AttachedObject.transform);
|
||||
if (closestSector != null)
|
||||
{
|
||||
@ -49,6 +50,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
_intermediaryTransform = new IntermediaryTransform(transform);
|
||||
}
|
||||
|
||||
if (ReferenceSector != null)
|
||||
{
|
||||
writer.Write(ReferenceSector.ObjectId);
|
||||
@ -57,6 +59,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
writer.Write(-1);
|
||||
}
|
||||
|
||||
base.SerializeTransform(writer);
|
||||
}
|
||||
|
||||
|
@ -77,6 +77,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
Destroy(AttachedObject.gameObject);
|
||||
}
|
||||
|
||||
QSBSceneManager.OnSceneLoaded -= OnSceneLoaded;
|
||||
}
|
||||
|
||||
@ -176,6 +177,7 @@ namespace QSB.Syncs.TransformSync
|
||||
_intermediaryTransform.EncodeRotation(AttachedObject.transform.rotation);
|
||||
return;
|
||||
}
|
||||
|
||||
var targetPos = _intermediaryTransform.GetTargetPosition_Unparented();
|
||||
var targetRot = _intermediaryTransform.GetTargetRotation_Unparented();
|
||||
if (targetPos != Vector3.zero && _intermediaryTransform.GetTargetPosition_ParentedToReference() != Vector3.zero)
|
||||
@ -206,6 +208,7 @@ namespace QSB.Syncs.TransformSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ReferenceTransform = transform;
|
||||
_intermediaryTransform.SetReferenceTransform(transform);
|
||||
}
|
||||
@ -220,6 +223,7 @@ namespace QSB.Syncs.TransformSync
|
||||
_previousDistance = distance;
|
||||
return targetPosition;
|
||||
}
|
||||
|
||||
_previousDistance = distance;
|
||||
return Vector3.SmoothDamp(currentPosition, targetPosition, ref _positionSmoothVelocity, SmoothTime);
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var totalSeconds = Mathf.Max(TargetTime - Time.timeSinceLevelLoad, 0f);
|
||||
var minutes = Mathf.FloorToInt(totalSeconds / 60f);
|
||||
var seconds = Mathf.FloorToInt(totalSeconds) % 60;
|
||||
@ -92,6 +93,7 @@ namespace QSB.TimeSync
|
||||
text = "Waiting for server...";
|
||||
break;
|
||||
}
|
||||
|
||||
_text.text = text;
|
||||
}
|
||||
}
|
||||
|
@ -45,6 +45,7 @@ namespace QSB.TimeSync
|
||||
_isFirstFastForward = false;
|
||||
Init();
|
||||
}
|
||||
|
||||
QSBSceneManager.OnSceneLoaded += OnSceneLoaded;
|
||||
|
||||
GlobalMessenger.AddListener(EventNames.WakeUp, OnWakeUp);
|
||||
@ -63,6 +64,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
RespawnOnDeath.Instance.Init();
|
||||
}
|
||||
|
||||
_hasWokenUp = true;
|
||||
}
|
||||
|
||||
@ -81,6 +83,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
_hasWokenUp = true;
|
||||
}
|
||||
|
||||
Init();
|
||||
}
|
||||
else
|
||||
@ -148,6 +151,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"START WAITING FOR SERVER LOOP", MessageType.Info);
|
||||
OWTime.SetTimeScale(0f);
|
||||
_state = State.WaitingForServerToDie;
|
||||
@ -161,6 +165,7 @@ namespace QSB.TimeSync
|
||||
TimeSyncUI.TargetTime = _serverTime;
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"START FASTFORWARD (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
|
||||
if (Locator.GetActiveCamera() != null)
|
||||
{
|
||||
@ -183,6 +188,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
DebugLog.DebugWrite($"START PAUSING (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
|
||||
Locator.GetActiveCamera().enabled = false;
|
||||
|
||||
@ -265,6 +271,7 @@ namespace QSB.TimeSync
|
||||
{
|
||||
Locator.GetPlayerCamera().enabled = false;
|
||||
}
|
||||
|
||||
var diff = _serverTime - Time.timeSinceLevelLoad;
|
||||
OWTime.SetTimeScale(Mathf.SmoothStep(MinFastForwardSpeed, MaxFastForwardSpeed, Mathf.Abs(diff) / MaxFastForwardDiff));
|
||||
|
||||
@ -308,11 +315,13 @@ namespace QSB.TimeSync
|
||||
DebugLog.ToConsole($"Warning - CheckTimeDifference() returned over 100 - should have switched into fast-forward!", MessageType.Warning);
|
||||
mappedTimescale = 0f;
|
||||
}
|
||||
|
||||
if (mappedTimescale < 0)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - CheckTimeDifference() returned below 0 - should have switched into pausing!", MessageType.Warning);
|
||||
mappedTimescale = 0f;
|
||||
}
|
||||
|
||||
OWTime.SetTimeScale(mappedTimescale);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ namespace QSB.Tools
|
||||
light.GetLight().enabled = false;
|
||||
light.GetLight().shadows = LightShadows.Soft;
|
||||
}
|
||||
|
||||
FlashlightOn = false;
|
||||
}
|
||||
|
||||
@ -54,10 +55,12 @@ namespace QSB.Tools
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var light in _lights)
|
||||
{
|
||||
light.GetLight().enabled = true;
|
||||
}
|
||||
|
||||
FlashlightOn = true;
|
||||
var rotation = _root.rotation;
|
||||
_basePivot.rotation = rotation;
|
||||
@ -71,10 +74,12 @@ namespace QSB.Tools
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var light in _lights)
|
||||
{
|
||||
light.GetLight().enabled = false;
|
||||
}
|
||||
|
||||
FlashlightOn = false;
|
||||
}
|
||||
|
||||
@ -99,6 +104,7 @@ namespace QSB.Tools
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var light = _lights[1].GetLight();
|
||||
if (light.enabled)
|
||||
{
|
||||
|
@ -41,6 +41,7 @@ namespace QSB.Tools
|
||||
EquipTool();
|
||||
return;
|
||||
}
|
||||
|
||||
UnequipTool();
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ namespace QSB.TranslationSync.Events
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.EnumValue == NomaiTextType.WallText)
|
||||
{
|
||||
var obj = QSBWorldSync.GetWorldFromId<QSBWallText>(message.ObjectId);
|
||||
|
@ -22,6 +22,7 @@ namespace QSB.TranslationSync.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(
|
||||
EventNames.QSBTextTranslated,
|
||||
NomaiTextType.WallText,
|
||||
@ -36,6 +37,7 @@ namespace QSB.TranslationSync.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(
|
||||
EventNames.QSBTextTranslated,
|
||||
NomaiTextType.Computer,
|
||||
@ -50,6 +52,7 @@ namespace QSB.TranslationSync.Patches
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
QSBEventManager.FireEvent(
|
||||
EventNames.QSBTextTranslated,
|
||||
NomaiTextType.VesselComputer,
|
||||
|
@ -18,6 +18,7 @@ namespace QSB.TranslationSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AttachedObject.SetAsTranslated(id);
|
||||
}
|
||||
|
||||
@ -31,6 +32,7 @@ namespace QSB.TranslationSync.WorldObjects
|
||||
yield return item.GetEntryID();
|
||||
}
|
||||
}
|
||||
|
||||
var inactiveList = AttachedObject.GetValue<List<NomaiComputerRing>>("_inactiveRingList");
|
||||
foreach (var item in inactiveList)
|
||||
{
|
||||
|
@ -19,6 +19,7 @@ namespace QSB.TranslationSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AttachedObject.SetAsTranslated(id);
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ namespace QSB.TranslationSync.WorldObjects
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AttachedObject.SetAsTranslated(id);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,7 @@ namespace QSB.Utility
|
||||
DebugLog.ToConsole($"Warning - Awake() ran when _isReady is false!", OWML.Common.MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
_particleSystem = GetComponent<ParticleSystem>();
|
||||
if (_particleSystem == null)
|
||||
{
|
||||
@ -31,6 +32,7 @@ namespace QSB.Utility
|
||||
_isReady = false;
|
||||
return;
|
||||
}
|
||||
|
||||
_rotation = transform.rotation;
|
||||
_mainModule = _particleSystem.main;
|
||||
_mainModule.simulationSpace = ParticleSystemSimulationSpace.Custom;
|
||||
|
@ -30,14 +30,17 @@ namespace QSB.Utility
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Keypad7))
|
||||
{
|
||||
GoToVessel();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Keypad8))
|
||||
{
|
||||
InsertWarpCore();
|
||||
}
|
||||
|
||||
if (Input.GetKeyDown(KeyCode.Keypad9))
|
||||
{
|
||||
LoadManager.LoadSceneAsync(OWScene.EyeOfTheUniverse, true, LoadManager.FadeType.ToWhite);
|
||||
|
@ -17,6 +17,7 @@ namespace QSB.Utility
|
||||
{
|
||||
DebugLog.ToConsole("Error - Font is null!", MessageType.Error);
|
||||
}
|
||||
|
||||
_boxPrefab.GetComponent<Text>().font = font;
|
||||
_boxPrefab.GetComponent<Text>().color = Color.white;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user