Esempio n. 1
0
        public void Populate(Fighter fighter, PlayerConnectionInfo info)
        {
            transform.position = fighter.position;
            model.rotation     = Quaternion.Euler(0, 0, fighter.heading);
            string status   = "";
            int    progress = -1;

            switch (info.state)
            {
            case PlayerConnectState.Connecting:
                status = (info.type == GGPOPlayerType.GGPO_PLAYERTYPE_LOCAL) ? "Local Player" : "Connecting...";
                break;

            case PlayerConnectState.Synchronizing:
                progress = info.connect_progress;
                status   = (info.type == GGPOPlayerType.GGPO_PLAYERTYPE_LOCAL) ? "Local Player" : "Synchronizing...";
                break;

            case PlayerConnectState.Disconnected:
                status = "Disconnected";
                break;

            case PlayerConnectState.Disconnecting:
                status   = "Waiting for player...";
                progress = (Utils.TimeGetTime() - info.disconnect_start) * 100 / info.disconnect_timeout;
                break;
            }
        }
Esempio n. 2
0
            static void SetupProfilerDriver()
            {
                ProfilerDriver.profileEditor = ProfilerUserSettings.defaultTargetMode == Profiling.ProfilerEditorTargetMode.Editmode;
                var playerConnectionInfo = new PlayerConnectionInfo
                {
                    recording     = ProfilerDriver.enabled,
                    profileEditor = ProfilerDriver.profileEditor
                };

                EventService.Request(5000L, nameof(EventType.UmpProfilerOpenPlayerConnection), HandlePlayerConnectionOpened, JsonUtility.ToJson(playerConnectionInfo));
            }
Esempio n. 3
0
            static object OnOpenPlayerConnectionRequested(string eventType, object[] args)
            {
                var playerConnectionInfo = new PlayerConnectionInfo
                {
                    connectionId = ProcessService.EnableProfileConnection(Application.dataPath),
                    recording    = ProfilerDriver.enabled,
                    isPlaying    = EditorApplication.isPlaying
                };

                if (EditorApplication.isPlaying)
                {
                    // Start profiling right away if we are in play mode
                    playerConnectionInfo.recording = true;
                }
                return(JsonUtility.ToJson(playerConnectionInfo));
            }
            static void SetupProfilerDriver()
            {
                if (s_ProfilerDriverSetup)
                {
                    return;
                }

                ProfilerDriver.profileEditor = ProfilerUserSettings.defaultTargetMode == ProfilerEditorTargetMode.Editmode;
                var playerConnectionInfo = new PlayerConnectionInfo
                {
                    recording     = ProfilerDriver.enabled,
                    profileEditor = ProfilerDriver.profileEditor
                };

                EventService.Request(nameof(EventType.UmpProfilerOpenPlayerConnection), HandlePlayerConnectionOpened, playerConnectionInfo, 5000L);
                s_ProfilerDriverSetup = true;
            }
Esempio n. 5
0
            static void SetupProfilerDriver()
            {
                EditorApplication.update -= SetupProfilerDriver;

                if (s_ProfilerDriverSetup)
                    return;

                ProfilerDriver.profileEditor = ProfilerUserSettings.defaultTargetMode == ProfilerEditorTargetMode.Editmode;
                var playerConnectionInfo = new PlayerConnectionInfo
                {
                    recording = ProfilerDriver.enabled,
                    profileEditor = ProfilerDriver.profileEditor
                };
                if (!SessionState.GetBool("OOPP.PlayerConnectionOpened", false))
                    EventService.Request(nameof(EventType.UmpProfilerOpenPlayerConnection), HandlePlayerConnectionOpened, playerConnectionInfo, 5000L);
                s_ProfilerDriverSetup = true;

                ModeService.RefreshMenus();
            }
 public virtual void HandleNewClientConnect(PlayerConnectionInfo clientConnectionInfo)
 {
 }
Esempio n. 7
0
 void IUdpNetworkHandler.HandleNewClientConnect(
     PlayerConnectionInfo clientConnectionInfo)
 {
     this.HandleNewClientConnect(clientConnectionInfo);
 }
Esempio n. 8
0
 protected virtual void HandleNewClientConnect(PlayerConnectionInfo clientConnectionInfo)
 {
 }