public MDReplicatedCommandReplicator(MemberInfo Member, bool Reliable, MDReplicatedType ReplicatedType, WeakRef NodeRef, MDReplicatedSetting[] Settings) : base(Member, true, ReplicatedType, NodeRef, Settings) { GameSession = MDStatics.GetGameSession(); Replicator = GameSession.Replicator; GameClock = GameSession.GetGameClock(); Node node = NodeRef.GetRef() as Node; IMDCommandReplicator CommandReplicator = InitializeCommandReplicator(Member, node); CommandReplicator.MDSetSettings(Settings); }
public MDReplicatedMember(MemberInfo Member, bool Reliable, MDReplicatedType ReplicatedType, WeakRef NodeRef, MDReplicatedSetting[] Settings) { MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info)); GameSession = MDStatics.GetGameSession(); Replicator = GameSession.Replicator; GameClock = GameSession.GetGameClock(); GameSynchronizer = GameSession.GetGameSynchronizer(); this.Member = Member; this.Reliable = Reliable; this.ReplicatedType = ReplicatedType; this.NodeRef = NodeRef; ParseSettings(MDReplicator.ParseParameters(typeof(Settings), Settings)); CheckIfShouldReplicate(); }
public bool IsReadyForReplication() { MDGameInstance GameInstance = MDStatics.GetGameSession().GetGameInstance(); if (GameInstance.GetGameSynchronizer().IsDelayReplicatorUntilAllNodesAreSynched()) { // If synch is active check if peer has completed node synch if (GameInstance.GetGameSynchronizer().HasPeerCompletedNodeSynch(PeerId)) { return(true); } } // If synch is not active then we use a delay else if (JoinTime + MDReplicator.JIPWaitTime < OS.GetTicksMsec()) { return(true); } return(false); }