public static int getVTObjectiveHash(VTObjective VTobj) { string hashStr = VTobj.objectiveName + VTobj.objectiveInfo + VTobj.required; int hashCode = hashStr.GetHashCode(); return(hashCode); }
static void Postfix(VTObjective __instance) { Debug.Log("A VTObjective got begin we need to send it"); Message_ObjectiveSync objOutMessage = new Message_ObjectiveSync(PlayerManager.localUID, __instance.objectiveID, ObjSyncType.EVTBegin); if (Networker.isHost) { Debug.Log("Host sent VTObjective begin " + __instance.objectiveID); ObjectiveNetworker_Reciever.ObjectiveHistory.Add(objOutMessage); NetworkSenderThread.Instance.SendPacketAsHostToAllClients(objOutMessage, Steamworks.EP2PSend.k_EP2PSendReliable); } else { bool shouldComplete = ObjectiveNetworker_Reciever.completeNextBegin; Debug.Log($"Should complete is {shouldComplete}."); ObjectiveNetworker_Reciever.completeNextBegin = false; //return shouldComplete;// clients should not send kill obj packets or have them complete //NetworkSenderThread.Instance.SendPacketToSpecificPlayer(Networker.hostID, objOutMessage, Steamworks.EP2PSend.k_EP2PSendUnreliable); } // return true; }