Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. private static PvpSession StartPVPSession()
  2. {
  3. Debug.Log("Start pvp session...");
  4.  
  5. if (SystemMessageManager.ShowConnectionIssueAlertIfNeeded())
  6. {
  7. <<<<<<< HEAD
  8. return null;
  9. }
  10.  
  11. if (PVPSession != null)
  12. {
  13. var msg = "Pvpsession is already in progress";
  14. Debug.LogError(msg);
  15. ShowAlert(msg);
  16. return null;
  17. }
  18.  
  19. // if (!instance.UDPConnection.IsActive())
  20. // {
  21. // Debug.LogWarning("udp is not active");
  22. // ShowAlert("udp_connection_is_not_active");
  23. // return null;
  24. // }
  25. //
  26. // if (!instance.UDPConnection.UpingManager.WasSuccessfulUpingInLast(milliseconds: 5000)) // @TODO this 5000 should depend on normal delay between sending, or will fail often
  27. // {
  28. // Debug.LogWarning("Don't have a successfull uping lately");
  29. // ShowAlert("no_successful_uping_lately");
  30. // return null;
  31. // }
  32.  
  33. if (Application.isEditor)
  34. {
  35. var prefs = ConfigsSourceResolver.GetPreferences();
  36. if (prefs != null && prefs.LocalConfigs)
  37. {
  38. ShowAlert("To play PVP you must disable 'Use Local Configs' on ShadowFight3/Preferences");
  39. return null;
  40. }
  41. }
  42.  
  43. if (Application.isEditor)
  44. {
  45. Debug.LogFormat("Git last commit valid: {0}, sha: '{1}' \n{2}",
  46. GitInfo.IsRepositoryValid(), GitInfo.GetLastCommitSha(), GitInfo.GetStatus());
  47. if (!GitInfo.IsRepositoryValid())
  48. {
  49. ShowAlert("Git repository isn't valid! Can't play pvp!");
  50. return null;
  51. }
  52. }
  53.  
  54. using (var networkInfo = new NetworkInfo())
  55. {
  56. if (!networkInfo.IsWifiConnected() &&
  57. !networkInfo.IsFasterOrEqual(MobileNetworkTypes.Class.Class4G))
  58. {
  59. Debug.LogWarning("Network bandwidth is too low! Use wi-fi or 4G.");
  60. ShowAlert("network_bandwidth_is_too_low_use_wifi_or_4g");
  61. return null;
  62. }
  63. }
  64. =======
  65. if (forbidReason != null)
  66. {
  67. ShowAlert(forbidReason);
  68. }
  69. return null;
  70. }
  71. >>>>>>> version/1.17.2
  72.  
  73. return new PvpSession(FrameSkipController.instance);
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement