11#include " ../scripting.h"
22
3+ std::map<std::string, bool > BlockedCS2GuidelinesFields = {
4+ {" m_bIsValveDS" , true },
5+ {" m_bIsQuestEligible" , true },
6+ {" m_iEntityLevel" , true },
7+ {" m_iItemIDHigh" , true },
8+ {" m_iItemIDLow" , true },
9+ {" m_iAccountID" , true },
10+ {" m_iEntityQuality" , true },
11+ {" m_bInitialized" , true },
12+ {" m_szCustomName" , true },
13+ {" m_iAttributeDefinitionIndex" , true },
14+ {" m_iRawValue32" , true },
15+ {" m_iRawInitialValue32" , true },
16+ {" m_flValue" , true },
17+ {" m_flInitialValue" , true },
18+ {" m_bSetBonus" , true },
19+ {" m_nRefundableCurrency" , true },
20+ {" m_OriginalOwnerXuidLow" , true },
21+ {" m_OriginalOwnerXuidHigh" , true },
22+ {" m_nFallbackPaintKit" , true },
23+ {" m_nFallbackSeed" , true },
24+ {" m_flFallbackWear" , true },
25+ {" m_nFallbackStatTrak" , true },
26+ {" m_iCompetitiveWins" , true },
27+ {" m_iCompetitiveRanking" , true },
28+ {" m_iCompetitiveRankType" , true },
29+ {" m_iCompetitiveRankingPredicted_Win" , true },
30+ {" m_iCompetitiveRankingPredicted_Loss" , true },
31+ {" m_iCompetitiveRankingPredicted_Tie" , true },
32+ {" m_nActiveCoinRank" , true },
33+ {" m_nMusicID" , true },
34+ };
35+
336void WriteSchemaPtrValue (void *ptr, const char *className, const char *fieldName, bool isStruct, byte *value, int size)
437{
38+ if (BlockedCS2GuidelinesFields.find (fieldName) != BlockedCS2GuidelinesFields.end () && g_Config->FetchValue <bool >(" core.FollowCS2ServerGuidelines" ))
39+ {
40+ PRINTF (" Getting or setting %s::%s is not permitted due to CS2 Server Guidelines violation.\n " , className, fieldName);
41+ PRINT (" To get or set this value, switch to false the \" core.FollowCS2ServerGuidelines\" field.\n " );
42+ PRINT (" Note: Using non-compliant field values can result in a GSLT ban.\n " );
43+ PRINT (" Note: We are not providing any kind of support for people which are using these fields.\n " );
44+ return ;
45+ }
46+
547 auto datatable_hash = hash_32_fnv1a_const (className);
648 auto prop_hash = hash_32_fnv1a_const (fieldName);
749 const auto m_key = sch::GetOffset (className, datatable_hash, fieldName, prop_hash);
@@ -13,6 +55,15 @@ void WriteSchemaPtrValue(void *ptr, const char *className, const char *fieldName
1355
1456void *GetSchemaPtr (void *ptr, const char *className, const char *fieldName)
1557{
58+ if (BlockedCS2GuidelinesFields.find (fieldName) != BlockedCS2GuidelinesFields.end () && g_Config->FetchValue <bool >(" core.FollowCS2ServerGuidelines" ))
59+ {
60+ PRINTF (" Getting or setting %s::%s is not permitted due to CS2 Server Guidelines violation.\n " , className, fieldName);
61+ PRINT (" To get or set this value, switch to false the \" core.FollowCS2ServerGuidelines\" field.\n " );
62+ PRINT (" Note: Using non-compliant field values can result in a GSLT ban.\n " );
63+ PRINT (" Note: We are not providing any kind of support for people which are using these fields.\n " );
64+ return 0 ;
65+ }
66+
1667 auto datatable_hash = hash_32_fnv1a_const (className);
1768 auto prop_hash = hash_32_fnv1a_const (fieldName);
1869 auto m_key = sch::GetOffset (className, datatable_hash, fieldName, prop_hash);
0 commit comments