Example #1
0
        public override void _Ready()
        {
            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Trace));
            this.RegisterCommandAttributes();

            CheckArgsForConnectionInfo();
        }
Example #2
0
        public override void _Ready()
        {
            base._Ready();

            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));

            MouseFilter = MouseFilterEnum.Ignore;

            CreateControls();
        }
 public MDGameSynchPeerInfo(MDGameSynchronizer GameSynchronizer, int PeerId)
 {
     MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
     MDLog.Info(LOG_CAT, $"Creating MDGameSynchPeerInfo for Peer [ID: {PeerId}]");
     this.GameSynchronizer         = GameSynchronizer;
     this.PeerId                   = PeerId;
     this.SettingAveragePingToKeep = GameSynchronizer.GetPingsToKeepForAverage();
     this.CompletedNodeSynch       = false;
     this.CompletedSynch           = false;
     StartMSecCycle();
 }
 // Called when the node enters the scene tree for the first time.
 public override void _Ready()
 {
     MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
     GameSession = GameInstance.GetGameSession();
     GameSession.OnPlayerJoinedEvent      += OnPlayerJoinedEvent;
     GameSession.OnPlayerInitializedEvent += OnPlayerInitializedEvent;
     GameSession.OnPlayerLeftEvent        += OnPlayerLeftEvent;
     GameSession.OnNetworkNodeAdded       += OnNetworkNodeAdded;
     GameSession.OnNetworkNodeRemoved     += OnNetworkNodeRemoved;
     GameSession.OnSessionStartedEvent    += OnSessionStartedEvent;
     SynchronizationState = SynchronizationStates.SYNCHRONIZING_IN_PROGRESS;
 }
Example #5
0
        /// <summary>
        /// Load our configuration
        /// </summary>
        public void LoadConfiguration()
        {
            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
            // Load internal config first
            #if DEBUG
            LoadConfiguration(FRAMEWORK_DEBUG_CONFIG);
            LoadConfiguration(PROJECT_DEBUG_CONFIG);
            #else
            LoadConfiguration(FRAMEWORK_EXPORT_CONFIG);
            LoadConfiguration(PROJECT_EXPORT_CONFIG);
            #endif

            IsLoaded = true;
        }
Example #6
0
        public void Initialize()
        {
            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
            MDOnScreenDebug.AddOnScreenDebugInfo("KeyToMemberMap Size", () => KeyToMemberMap.Count.ToString());
            MDOnScreenDebug.AddOnScreenDebugInfo("NetworkIDToKeyMap Size", () => NetworkIdKeyMap.GetCount().ToString());
            this.GetGameSession().OnSessionEndedEvent += OnSessionEnded;
            this.GetGameSession().OnPlayerJoinedEvent += OnPlayerJoined;
            PauseMode   = PauseModeEnum.Process;
            RpcSenderId = -1;

            GroupManager    = new MDReplicatorGroupManager(GetReplicationFrameInterval());
            NetworkIdKeyMap = new MDReplicatorNetworkKeyIdMap(ShouldShowBufferSize());

            GameClock = this.GetGameClock();
        }
Example #7
0
        public override void _Ready()
        {
            base._Ready();

            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));

            MouseFilter = MouseFilterEnum.Ignore;

            CreateControls();

            if (this.GetGameInstance().IsOnScreenDebugAddBasicInformation() && !AddedBasicInfo)
            {
                AddedBasicInfo = true;
                AddBasicInfo();
            }
        }
        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();
        }
Example #9
0
        // Called when the node enters the scene tree for the first time.
        public override void _Ready()
        {
            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
            LoadConfig();
            GameSynchronizer                           = this.GetGameSynchronizer();
            CurrentRemoteTickOffset                    = MinimumOffset;
            CurrentRemoteTickOffsetTarget              = MinimumOffset;
            LastRemoteTickOffset                       = MinimumOffset;
            GameSynchronizer.OnPlayerPingUpdatedEvent += OnPlayerPingUpdatedEvent;

            // TODO: Remove this, only here for debug
            MDOnScreenDebug.AddOnScreenDebugInfo("GameClock Current Tick", () => CurrentTick.ToString());
            MDOnScreenDebug.AddOnScreenDebugInfo("OS GetTickMsec", () => OS.GetTicksMsec().ToString());
            MDOnScreenDebug.AddOnScreenDebugInfo("GameClock Remote Offset",
                                                 () =>
                                                 $"{CurrentRemoteTickOffset} ({(int) (CurrentRemoteTickOffset * TICK_INTERVAL_MILLISECONDS)} Msec)");
            MDOnScreenDebug.AddOnScreenDebugInfo("GameClock Remote Target Offset",
                                                 () =>
                                                 $"{CurrentRemoteTickOffsetTarget} ({(int) (CurrentRemoteTickOffsetTarget * TICK_INTERVAL_MILLISECONDS)} Msec)");
        }
Example #10
0
        /// <summary>
        /// Load our configuration
        /// </summary>
        public void LoadConfiguration()
        {
            MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
            // Load internal config first
            #if DEBUG
            LoadConfiguration(FRAMEWORK_DEBUG_CONFIG);
            LoadConfiguration(PROJECT_DEBUG_CONFIG);
            #else
            LoadConfiguration(FRAMEWORK_EXPORT_CONFIG);
            LoadConfiguration(PROJECT_EXPORT_CONFIG);
            #endif

            if (Configuration.Count > 0)
            {
                IsLoaded = true;
            }
            else
            {
                string message = "Failed to load configuration for MDFramework. Did you remember to add *.ini files to your export?";
                Console.WriteLine(message);
                Godot.GD.PrintErr(message);
            }
        }
Example #11
0
 public override void _Ready()
 {
     MDLog.AddLogCategoryProperties(LOG_CAT, new MDLogProperties(MDLogLevel.Info));
 }