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; } }
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)); }
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; }
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) { }
void IUdpNetworkHandler.HandleNewClientConnect( PlayerConnectionInfo clientConnectionInfo) { this.HandleNewClientConnect(clientConnectionInfo); }
protected virtual void HandleNewClientConnect(PlayerConnectionInfo clientConnectionInfo) { }