private static bool JoinGameTest(Lobby lobby) { if (!lobby.IsValid) { return(false); } if (lobby.GetLobbyType() == LobbyTypeEnum.FriendsOnly && !MySteam.API.Friends.HasFriend(lobby.GetOwner())) { MyGuiSandbox.Show(MySpaceTexts.OnlyFriendsCanJoinThisGame); return(false); } if (!MyMultiplayerLobby.IsLobbyCorrectVersion(lobby)) { var formatString = MyTexts.GetString(MySpaceTexts.MultiplayerError_IncorrectVersion); var myVersion = MyBuildNumbers.ConvertBuildNumberFromIntToString(MyFinalBuildConstants.APP_VERSION); var serverVersion = MyBuildNumbers.ConvertBuildNumberFromIntToString(MyMultiplayerLobby.GetLobbyAppVersion(lobby)); MyGuiSandbox.Show(new StringBuilder(String.Format(formatString, myVersion, serverVersion))); return(false); } if (MyFakes.ENABLE_MP_DATA_HASHES && !MyMultiplayerLobby.HasSameData(lobby)) { MyGuiSandbox.Show(MySpaceTexts.MultiplayerError_DifferentData); MySandboxGame.Log.WriteLine("Different game data when connecting to server. Local hash: " + MyDataIntegrityChecker.GetHashBase64() + ", server hash: " + MyMultiplayerLobby.GetDataHash(lobby)); return(false); } return(true); }
private static void SendGameStartInternal() { ReportDesignInternal("Game:Start:Version", value: (float)MyBuildNumbers.GetBuildNumberWithoutMajor(MyFinalBuildConstants.APP_VERSION)); ReportDesignInternal("Game:Start:Branch:" + BranchName); ReportDesignInternal("Game:Start:OS:" + Environment.OSVersion.Version.Major + "." + Environment.OSVersion.Version.Minor); UserEventData user; user.platform = string.Format("{0} ({1})", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "x64" : "x86"); user.os_major = Environment.OSVersion.Version.Major.ToString(); user.os_minor = Environment.OSVersion.Version.Minor.ToString(); user.device = "PC"; ReportUserInternal(user); }