@@ -3092,18 +3092,14 @@ const std::string& CStaticFunctionDefinitions::GetPlayerSerial(CPlayer* pPlayer,
3092
3092
return pPlayer->GetSerial (uiIndex);
3093
3093
}
3094
3094
3095
- const std::string& CStaticFunctionDefinitions::GetPlayerUserName (CPlayer* pPlayer)
3095
+ std::string CStaticFunctionDefinitions::GetPlayerUserName (CPlayer* pPlayer)
3096
3096
{
3097
- assert (pPlayer);
3098
-
3099
- return pPlayer->GetSerialUser ();
3097
+ return " " ;
3100
3098
}
3101
3099
3102
- const std::string& CStaticFunctionDefinitions::GetPlayerCommunityID (CPlayer* pPlayer)
3100
+ std::string CStaticFunctionDefinitions::GetPlayerCommunityID (CPlayer* pPlayer)
3103
3101
{
3104
- assert (pPlayer);
3105
-
3106
- return pPlayer->GetCommunityID ();
3102
+ return " " ;
3107
3103
}
3108
3104
3109
3105
bool CStaticFunctionDefinitions::GetPlayerBlurLevel (CPlayer* pPlayer, unsigned char & ucLevel)
@@ -5498,7 +5494,7 @@ bool CStaticFunctionDefinitions::BlowVehicle(CElement* pElement, std::optional<b
5498
5494
5499
5495
CBitStream BitStream;
5500
5496
BitStream.pBitStream ->Write (vehicle->GenerateSyncTimeContext ());
5501
- BitStream.pBitStream ->WriteBit (createExplosion); // only consumed by clients with at least eBitStreamVersion::VehicleBlowStateSupport
5497
+ BitStream.pBitStream ->WriteBit (createExplosion);
5502
5498
m_pPlayerManager->BroadcastOnlyJoined (CElementRPCPacket (vehicle, BLOW_VEHICLE, *BitStream.pBitStream ));
5503
5499
return true ;
5504
5500
}
@@ -10941,12 +10937,8 @@ bool CStaticFunctionDefinitions::SendSyncIntervals(CPlayer* pPlayer)
10941
10937
BitStream.pBitStream ->Write (g_TickRateSettings.iObjectSync );
10942
10938
BitStream.pBitStream ->Write (g_TickRateSettings.iKeySyncRotation );
10943
10939
BitStream.pBitStream ->Write (g_TickRateSettings.iKeySyncAnalogMove );
10944
-
10945
- if (pPlayer->CanBitStream (eBitStreamVersion::FixSyncerDistance))
10946
- {
10947
- BitStream.pBitStream ->Write (g_TickRateSettings.iPedSyncerDistance );
10948
- BitStream.pBitStream ->Write (g_TickRateSettings.iUnoccupiedVehicleSyncerDistance );
10949
- }
10940
+ BitStream.pBitStream ->Write (g_TickRateSettings.iPedSyncerDistance );
10941
+ BitStream.pBitStream ->Write (g_TickRateSettings.iUnoccupiedVehicleSyncerDistance );
10950
10942
10951
10943
pPlayer->Send (CLuaPacket (SET_SYNC_INTERVALS, *BitStream.pBitStream ));
10952
10944
};
@@ -11810,19 +11802,18 @@ CBan* CStaticFunctionDefinitions::BanPlayer(CPlayer* pTargetPlayer, bool bIP, bo
11810
11802
// Ban the player
11811
11803
if (bIP)
11812
11804
pBan = m_pBanManager->AddBan (pTargetPlayer, strResponsible, strReason, tUnban);
11813
- else if (bUsername || bSerial)
11805
+ else if (bSerial)
11814
11806
pBan = m_pBanManager->AddBan (strResponsible, strReason, tUnban);
11815
11807
11816
11808
// If the ban was successful
11817
11809
if (pBan)
11818
11810
{
11819
- // Set the data if banned by either username or serial
11820
- if (bUsername)
11821
- pBan->SetAccount (pTargetPlayer->GetSerialUser ());
11811
+ // Set the data if banned by serial
11822
11812
if (bSerial)
11813
+ {
11823
11814
pBan->SetSerial (pTargetPlayer->GetSerial ());
11824
- if (bUsername || bSerial)
11825
11815
pBan->SetNick (pTargetPlayer->GetNick ());
11816
+ }
11826
11817
11827
11818
// Check if we passed a responsible player
11828
11819
if (pResponsible)
@@ -11865,13 +11856,6 @@ CBan* CStaticFunctionDefinitions::BanPlayer(CPlayer* pTargetPlayer, bool bIP, bo
11865
11856
bBan = (pBan->GetIP () == pPlayer->GetSourceIP ());
11866
11857
}
11867
11858
11868
- // Check if the player's username matches the specified one, if specified, and he wasn't banned over IP yet
11869
- if (!bBan && bUsername && pBan->GetAccount ().length () > 0 )
11870
- {
11871
- const std::string& strPlayerUsername = pPlayer->GetSerialUser ();
11872
- bBan = stricmp (strPlayerUsername.c_str (), pBan->GetAccount ().c_str ()) == 0 ;
11873
- }
11874
-
11875
11859
// Check if the player's serial matches the specified one, if specified, and he wasn't banned over IP or username yet
11876
11860
if (!bBan && bSerial)
11877
11861
{
@@ -11956,10 +11940,6 @@ CBan* CStaticFunctionDefinitions::AddBan(SString strIP, SString strUsername, SSt
11956
11940
{
11957
11941
pBan = m_pBanManager->AddBan (strResponsible, strReason, tUnban);
11958
11942
}
11959
- else if (bUsernameSpecified && !m_pBanManager->IsAccountBanned (strUsername))
11960
- {
11961
- pBan = m_pBanManager->AddBan (strResponsible, strReason, tUnban);
11962
- }
11963
11943
11964
11944
// If the ban was added
11965
11945
if (pBan)
@@ -11995,8 +11975,6 @@ CBan* CStaticFunctionDefinitions::AddBan(SString strIP, SString strUsername, SSt
11995
11975
strMessage = strMessage.substr (0 , 255 );
11996
11976
11997
11977
// Set the account or serial if either one is set to be banned
11998
- if (bUsernameSpecified)
11999
- pBan->SetAccount (strUsername);
12000
11978
if (bSerialSpecified)
12001
11979
pBan->SetSerial (strSerial);
12002
11980
@@ -12046,13 +12024,6 @@ CBan* CStaticFunctionDefinitions::AddBan(SString strIP, SString strUsername, SSt
12046
12024
bBan = (strIP == pPlayer->GetSourceIP ());
12047
12025
}
12048
12026
12049
- // Check if the player's username matches the specified one, if specified, and he wasn't banned over IP yet
12050
- if (!bBan && bUsernameSpecified && strUsername.length () > 0 )
12051
- {
12052
- const std::string& strPlayerUsername = pPlayer->GetSerialUser ();
12053
- bBan = stricmp (strPlayerUsername.c_str (), strUsername.c_str ()) == 0 ;
12054
- }
12055
-
12056
12027
// Check if the player's serial matches the specified one, if specified, and he wasn't banned over IP or username yet
12057
12028
if (!bBan && bSerialSpecified)
12058
12029
{
@@ -12168,11 +12139,6 @@ bool CStaticFunctionDefinitions::GetBanSerial(CBan* pBan, SString& strOutSerial)
12168
12139
12169
12140
bool CStaticFunctionDefinitions::GetBanUsername (CBan* pBan, SString& strOutUsername)
12170
12141
{
12171
- if (!pBan->GetAccount ().empty ())
12172
- {
12173
- strOutUsername = pBan->GetAccount ();
12174
- return true ;
12175
- }
12176
12142
return false ;
12177
12143
}
12178
12144
0 commit comments