block_join_reasons cleanup (#3290)
This commit is contained in:
parent
4589b87553
commit
10d0e72285
@ -2,28 +2,132 @@
|
||||
|
||||
namespace big
|
||||
{
|
||||
inline std::unordered_map<int, const char*> block_join_reasons = {
|
||||
{1, "None"},
|
||||
{5, "Been Voted Out"}, // You have already been voted out of this game session.
|
||||
{7, "Incompatible Assets"}, // Failed to join session due to incompatible assets.
|
||||
{8, "Session Full"}, // The session you're trying to join is currently full.
|
||||
{9, "Slot Full"}, // The session you're trying to join is currently full of players.
|
||||
{10, "No Title Update"}, // Please make sure all players have the latest Title Update.
|
||||
{12, "Invites Disabled"}, // Invites are currently disabled in the session.
|
||||
{13, "Different Targeting Mode"},// The session you are trying to join is using a different targeting preference. You can change your preference in the Settings tab of the Pause Menu in Grand Theft Auto V. Joining a new GTA Online Session.
|
||||
{14, "Cheater"},// You are classed as a cheat and can only play with other cheats until you are forgiven.
|
||||
{16, "Incompatible DLC"},// Incompatible downloadable content. All players must have the latest compatibility pack.
|
||||
{17, "Crew Only"}, // You are trying to enter a Crew Members only session.
|
||||
{21, "Session No Longer Exists"},// The session you are trying to join no longer exists.
|
||||
{22, "Invite Only"},// The session you are trying to join is private. You will need to be invited to join this session.
|
||||
{26, "Friends Only"}, // The session you are trying to join is friends only.
|
||||
{23, "Different Build Type"},// The session you are trying to join is a different build type.
|
||||
{25, "Different Content"}, // The session you are trying to join is not using the same content.
|
||||
{18, "Bad Sport"},// The session you are trying to join is for people who are not Bad Sports or cheaters - you are a Bad Sport.
|
||||
{19, "Bad Sports Only"},// The session you are trying to join is for Bad Sports only.
|
||||
{20, "Cheaters Only"}, // The session you are trying to join is for cheaters only.
|
||||
{27, "Bad Reputation"}, // Unable to join this session, your account has a bad reputation.
|
||||
{28, "May Not Exist"}, // Unable to connect to session. The session may no longer exist.
|
||||
{29, "Premium Race"},// Unable to Join. The session you are trying to join is a Premium Race. Joining and accepting invites is disabled for this mode.
|
||||
enum block_join_reason_t : int32_t
|
||||
{
|
||||
UNK_0 = 0,
|
||||
|
||||
None = 1,
|
||||
|
||||
UNK_2 = 2,
|
||||
UNK_3 = 3,
|
||||
UNK_4 = 4,
|
||||
|
||||
// You have already been voted out of this game session.
|
||||
BeenVotedOut = 5,
|
||||
|
||||
UNK_6 = 6,
|
||||
|
||||
// Failed to join session due to incompatible assets.
|
||||
IncompatibleAssets = 7,
|
||||
|
||||
// The session you're trying to join is currently full.
|
||||
SessionFull = 8,
|
||||
|
||||
// The session you're trying to join is currently full of players.
|
||||
SlotFull = 9,
|
||||
|
||||
// Please make sure all players have the latest Title Update.
|
||||
NoTitleUpdate = 10,
|
||||
|
||||
UNK_11 = 11,
|
||||
|
||||
// Invites are currently disabled in the session.
|
||||
InvitesDisabled = 12,
|
||||
|
||||
// The session you are trying to join is using a different targeting preference. You can change your preference in the Settings tab of the Pause Menu in Grand Theft Auto V. Joining a new GTA Online Session.
|
||||
DifferentTargetingMode = 13,
|
||||
|
||||
// You are classed as a cheat and can only play with other cheats until you are forgiven.
|
||||
Cheater = 14,
|
||||
|
||||
UNK_15 = 15,
|
||||
|
||||
// Incompatible downloadable content. All players must have the latest compatibility pack.
|
||||
IncompatibleDLC = 16,
|
||||
|
||||
// You are trying to enter a Crew Members only session.
|
||||
CrewOnly = 17,
|
||||
|
||||
// The session you are trying to join is for people who are not Bad Sports or cheaters - you are a Bad Sport.
|
||||
BadSport = 18,
|
||||
|
||||
// The session you are trying to join is for Bad Sports only.
|
||||
BadSportOnly = 19,
|
||||
|
||||
// The session you are trying to join is for cheaters only.
|
||||
CheatersOnly = 20,
|
||||
|
||||
// The session you are trying to join no longer exists.
|
||||
SessionNoLongerExists = 21,
|
||||
|
||||
// The session you are trying to join is private. You will need to be invited to join this session.
|
||||
InviteOnly = 22,
|
||||
|
||||
// The session you are trying to join is a different build type.
|
||||
DifferentBuildType = 23,
|
||||
|
||||
UNK_24 = 24,
|
||||
|
||||
// The session you are trying to join is not using the same content.
|
||||
DifferentContent = 25,
|
||||
|
||||
// The session you are trying to join is friends only.
|
||||
FriendsOnly = 26,
|
||||
|
||||
// Unable to join this session, your account has a bad reputation.
|
||||
BadReputation = 27,
|
||||
|
||||
// Unable to connect to session. The session may no longer exist.
|
||||
MayNotExist = 28,
|
||||
|
||||
// Unable to Join. The session you are trying to join is a Premium Race. Joining and accepting invites is disabled for this mode.
|
||||
PremiumRace = 29
|
||||
};
|
||||
|
||||
inline block_join_reason_t& operator++(block_join_reason_t& reason)
|
||||
{
|
||||
reason = static_cast<block_join_reason_t>(static_cast<int32_t>(reason) + 1);
|
||||
|
||||
return reason;
|
||||
}
|
||||
|
||||
inline block_join_reason_t operator++(block_join_reason_t& reason, int32_t)
|
||||
{
|
||||
block_join_reason_t a = reason;
|
||||
++reason;
|
||||
return a;
|
||||
}
|
||||
|
||||
inline constexpr auto block_join_reasons = std::to_array({
|
||||
"", // 0
|
||||
"None", // 1
|
||||
"", // 2
|
||||
"", // 3
|
||||
"", // 4
|
||||
"Been Voted Out", // 5
|
||||
"", // 6
|
||||
"Incompatible Assets", // 7
|
||||
"Session Full", // 8
|
||||
"Slot Full", // 9
|
||||
"No Title Update", // 10
|
||||
"", // 11
|
||||
"Invites Disabled", // 12
|
||||
"Different Targeting Mode", // 13
|
||||
"Cheater", // 14
|
||||
"", // 15
|
||||
"Incompatible DLC", // 16
|
||||
"Crew Only", // 17
|
||||
"Bad Sport", // 18
|
||||
"Bad Sports Only", // 19
|
||||
"Cheaters Only", // 20
|
||||
"Session No Longer Exists", // 21
|
||||
"Invite Only", // 22
|
||||
"Different Build Type", // 23
|
||||
"", // 24
|
||||
"Different Content", // 25
|
||||
"Friends Only", // 26
|
||||
"Bad Reputation", // 27
|
||||
"May Not Exist", // 28
|
||||
"Premium Race" // 29
|
||||
});
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
#include "translation_service.hpp"
|
||||
|
||||
#include "core/data/block_join_reasons.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "file_manager.hpp"
|
||||
#include "http_client/http_client.hpp"
|
||||
@ -313,7 +314,7 @@ namespace big
|
||||
// Tweaks to make it easier for people playing in the China region
|
||||
g.session_browser.filter_multiplexed_sessions = true;
|
||||
g.reactions.chat_spam.block_joins = true;
|
||||
g.reactions.chat_spam.block_join_reason = 27;
|
||||
g.reactions.chat_spam.block_join_reason = block_join_reason_t::BadReputation;
|
||||
}
|
||||
|
||||
if (does_language_exist(preferred_lang))
|
||||
|
@ -153,18 +153,26 @@ namespace big
|
||||
|
||||
if (ImGui::BeginCombo("BLOCK_JOIN_ALERT"_T.data(), block_join_reasons[current_player->block_join_reason]))
|
||||
{
|
||||
for (const auto& reason : block_join_reasons)
|
||||
block_join_reason_t i = block_join_reason_t::None;
|
||||
for (const auto& reason_str : block_join_reasons)
|
||||
{
|
||||
if (ImGui::Selectable(reason.second, reason.first == current_player->block_join_reason))
|
||||
if (reason_str != "")
|
||||
{
|
||||
current_player->block_join_reason = reason.first;
|
||||
g_player_database_service->save();
|
||||
const bool is_selected = current_player->block_join_reason == i;
|
||||
|
||||
if (ImGui::Selectable(reason_str, is_selected))
|
||||
{
|
||||
current_player->block_join_reason = i;
|
||||
g_player_database_service->save();
|
||||
}
|
||||
|
||||
if (is_selected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
if (reason.first == current_player->block_join_reason)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
ImGui::EndCombo();
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "views/view.hpp"
|
||||
#include "core/data/block_join_reasons.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -28,14 +28,25 @@ namespace big
|
||||
if (reaction.block_joins)
|
||||
if (ImGui::BeginCombo("BLOCK_JOIN_ALERT"_T.data(), block_join_reasons[reaction.block_join_reason]))
|
||||
{
|
||||
for (const auto& [key, value] : block_join_reasons)
|
||||
block_join_reason_t i = block_join_reason_t::None;
|
||||
for (const auto& reason_str : block_join_reasons)
|
||||
{
|
||||
bool is_selected = (reaction.block_join_reason == key);
|
||||
if (reason_str != "")
|
||||
{
|
||||
const bool is_selected = reaction.block_join_reason == i;
|
||||
|
||||
if (ImGui::Selectable(value, is_selected))
|
||||
reaction.block_join_reason = key;
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
if (ImGui::Selectable(reason_str, is_selected))
|
||||
{
|
||||
reaction.block_join_reason = i;
|
||||
}
|
||||
|
||||
if (is_selected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
@ -62,14 +73,25 @@ namespace big
|
||||
if (reaction.block_joins)
|
||||
if (ImGui::BeginCombo("BLOCK_JOIN_ALERT"_T.data(), block_join_reasons[reaction.block_join_reason]))
|
||||
{
|
||||
for (const auto& [key, value] : block_join_reasons)
|
||||
block_join_reason_t i = block_join_reason_t::None;
|
||||
for (const auto& reason_str : block_join_reasons)
|
||||
{
|
||||
bool is_selected = (reaction.block_join_reason == key);
|
||||
if (reason_str != "")
|
||||
{
|
||||
const bool is_selected = reaction.block_join_reason == i;
|
||||
|
||||
if (ImGui::Selectable(value, is_selected))
|
||||
reaction.block_join_reason = key;
|
||||
if (is_selected)
|
||||
ImGui::SetItemDefaultFocus();
|
||||
if (ImGui::Selectable(reason_str, is_selected))
|
||||
{
|
||||
reaction.block_join_reason = i;
|
||||
}
|
||||
|
||||
if (is_selected)
|
||||
{
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
}
|
||||
|
Reference in New Issue
Block a user