Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static PvpSession StartPVPSession()
- {
- Debug.Log("Start pvp session...");
- if (SystemMessageManager.ShowConnectionIssueAlertIfNeeded())
- {
- <<<<<<< HEAD
- return null;
- }
- if (PVPSession != null)
- {
- var msg = "Pvpsession is already in progress";
- Debug.LogError(msg);
- ShowAlert(msg);
- return null;
- }
- // if (!instance.UDPConnection.IsActive())
- // {
- // Debug.LogWarning("udp is not active");
- // ShowAlert("udp_connection_is_not_active");
- // return null;
- // }
- //
- // if (!instance.UDPConnection.UpingManager.WasSuccessfulUpingInLast(milliseconds: 5000)) // @TODO this 5000 should depend on normal delay between sending, or will fail often
- // {
- // Debug.LogWarning("Don't have a successfull uping lately");
- // ShowAlert("no_successful_uping_lately");
- // return null;
- // }
- if (Application.isEditor)
- {
- var prefs = ConfigsSourceResolver.GetPreferences();
- if (prefs != null && prefs.LocalConfigs)
- {
- ShowAlert("To play PVP you must disable 'Use Local Configs' on ShadowFight3/Preferences");
- return null;
- }
- }
- if (Application.isEditor)
- {
- Debug.LogFormat("Git last commit valid: {0}, sha: '{1}' \n{2}",
- GitInfo.IsRepositoryValid(), GitInfo.GetLastCommitSha(), GitInfo.GetStatus());
- if (!GitInfo.IsRepositoryValid())
- {
- ShowAlert("Git repository isn't valid! Can't play pvp!");
- return null;
- }
- }
- using (var networkInfo = new NetworkInfo())
- {
- if (!networkInfo.IsWifiConnected() &&
- !networkInfo.IsFasterOrEqual(MobileNetworkTypes.Class.Class4G))
- {
- Debug.LogWarning("Network bandwidth is too low! Use wi-fi or 4G.");
- ShowAlert("network_bandwidth_is_too_low_use_wifi_or_4g");
- return null;
- }
- }
- =======
- if (forbidReason != null)
- {
- ShowAlert(forbidReason);
- }
- return null;
- }
- >>>>>>> version/1.17.2
- return new PvpSession(FrameSkipController.instance);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement