Skip to content

Commit 85b176b

Browse files
committed
Added option to allow locally modified player models
Conflicts: MTA10/version.h MTA10_Server/version.h
1 parent e747d57 commit 85b176b

File tree

8 files changed

+28
-36
lines changed

8 files changed

+28
-36
lines changed

MTA10/sdk/net/CNet.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class CNet
6262
STATS_OUTGOING_TRAFFIC = 1
6363
};
6464

65-
virtual void ResetNetwork ( void ) = 0;
6665
virtual bool StartNetwork ( const char* szServerHost, unsigned short usServerPort, bool bPacketTag = false ) = 0;
6766
virtual void StopNetwork ( void ) = 0;
6867

MTA10/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@
7575

7676
#define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR)
7777
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
78-
#define _CLIENT_NET_MODULE_VERSION 0x08C // (0x000 - 0xfff) Lvl9 wizards only
78+
#define _CLIENT_NET_MODULE_VERSION 0x08D // (0x000 - 0xfff) Lvl9 wizards only
7979
#define _NETCODE_VERSION 0x1D8 // (0x000 - 0xfff) Increment when net messages change (pre-release)
80-
#define MTA_DM_BITSTREAM_VERSION 0x05F // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
80+
#define MTA_DM_BITSTREAM_VERSION 0x060 // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
8181

8282
// To avoid user confusion, make sure the ASE version matches only if communication is possible
8383
#if defined(MTA_DM_CONNECT_TO_PUBLIC)

MTA10_Server/mods/deathmatch/logic/CMainConfig.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,9 @@ bool CMainConfig::Load ( void )
283283
}
284284
while ( pNode );
285285

286+
// allow_gta3_img_mods
287+
SString strImgMods;
288+
GetString ( m_pRootNode, "allow_gta3_img_mods", strImgMods );
286289

287290
// hideac
288291
int iHideAC = 0;
@@ -347,7 +350,7 @@ bool CMainConfig::Load ( void )
347350
argMap.Set ( *it, "" );
348351
SString strEnableSDMap = argMap.ToString ();
349352

350-
g_pNetServer->SetChecks ( strDisableComboACMap, strDisableACMap, strEnableSDMap, m_iEnableClientChecks, iHideAC != 0 );
353+
g_pNetServer->SetChecks ( strDisableComboACMap, strDisableACMap, strEnableSDMap, m_iEnableClientChecks, iHideAC != 0, strImgMods );
351354
}
352355

353356
{

MTA10_Server/mods/deathmatch/logic/net/CNetBuffer.cpp

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -218,20 +218,6 @@ void CNetServerBuffer::StopNetwork ( void )
218218
}
219219

220220

221-
///////////////////////////////////////////////////////////////////////////
222-
//
223-
// CNetServerBuffer::ResetNetwork
224-
//
225-
// BLOCKING
226-
//
227-
///////////////////////////////////////////////////////////////////////////
228-
void CNetServerBuffer::ResetNetwork ( void )
229-
{
230-
SResetNetworkArgs* pArgs = new SResetNetworkArgs ();
231-
AddCommandAndWait ( pArgs );
232-
}
233-
234-
235221
///////////////////////////////////////////////////////////////////////////
236222
//
237223
// CNetServerBuffer::DoPulse
@@ -638,9 +624,9 @@ void CNetServerBuffer::ClearClientBitStreamVersion ( const NetServerPlayerID &Pl
638624
// (To make non blocking, strings will have to be stored in SSetChecksArgs)
639625
//
640626
///////////////////////////////////////////////////////////////////////////
641-
void CNetServerBuffer::SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC )
627+
void CNetServerBuffer::SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC, const char* szImgMods )
642628
{
643-
SSetChecksArgs* pArgs = new SSetChecksArgs ( szDisableComboACMap, szDisableACMap, szEnableSDMap, iEnableClientChecks, bHideAC );
629+
SSetChecksArgs* pArgs = new SSetChecksArgs ( szDisableComboACMap, szDisableACMap, szEnableSDMap, iEnableClientChecks, bHideAC, szImgMods );
644630
AddCommandAndWait ( pArgs );
645631
}
646632

@@ -1140,6 +1126,7 @@ void CNetServerBuffer::ProcessCommand ( CNetJobData* pJobData )
11401126
#define CALLREALNET3(func,t1,n1,t2,n2,t3,n3) CALLPRE(func) m_pRealNetServer->func ( a.n1, a.n2, a.n3 ); CALLPOST
11411127
#define CALLREALNET4(func,t1,n1,t2,n2,t3,n3,t4,n4) CALLPRE(func) m_pRealNetServer->func ( a.n1, a.n2, a.n3, a.n4 ); CALLPOST
11421128
#define CALLREALNET5(func,t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) CALLPRE(func) m_pRealNetServer->func ( a.n1, a.n2, a.n3, a.n4, a.n5 ); CALLPOST
1129+
#define CALLREALNET6(func,t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) CALLPRE(func) m_pRealNetServer->func ( a.n1, a.n2, a.n3, a.n4, a.n5, a.n6 ); CALLPOST
11431130

11441131
#define CALLREALNET0R(ret,func) CALLPRE(func) a.result = m_pRealNetServer->func (); CALLPOST
11451132
#define CALLREALNET1R(ret,func,t1,n1) CALLPRE(func) a.result = m_pRealNetServer->func ( a.n1 ); CALLPOST
@@ -1157,7 +1144,6 @@ void CNetServerBuffer::ProcessCommand ( CNetJobData* pJobData )
11571144
{
11581145
CALLREALNET4R( bool, StartNetwork , const char*, szIP, unsigned short, usServerPort, unsigned int, uiAllowedPlayers, const char*, szServerName )
11591146
CALLREALNET0 ( StopNetwork )
1160-
CALLREALNET0 ( ResetNetwork )
11611147
CALLREALNET0 ( DoPulse )
11621148
CALLREALNET1 ( RegisterPacketHandler , PPACKETHANDLER, pfnPacketHandler )
11631149
CALLREALNET2R( bool, GetNetworkStatistics , NetStatistics*, pDest, NetServerPlayerID&, PlayerID )
@@ -1173,7 +1159,7 @@ void CNetServerBuffer::ProcessCommand ( CNetJobData* pJobData )
11731159
CALLREALNET1 ( SetMaximumIncomingConnections , unsigned short, numberAllowed )
11741160
CALLREALNET2 ( SetClientBitStreamVersion , const NetServerPlayerID &,PlayerID, unsigned short, usBitStreamVersion )
11751161
CALLREALNET1 ( ClearClientBitStreamVersion , const NetServerPlayerID &,PlayerID )
1176-
CALLREALNET5 ( SetChecks , const char*, szDisableComboACMap, const char*, szDisableACMap, const char*, szEnableSDMap, int, iEnableClientChecks, bool, bHideAC );
1162+
CALLREALNET6 ( SetChecks , const char*, szDisableComboACMap, const char*, szDisableACMap, const char*, szEnableSDMap, int, iEnableClientChecks, bool, bHideAC, const char*, szImgMods );
11771163
CALLREALNET0R( unsigned int, GetPendingPacketCount )
11781164
CALLREALNET1 ( GetNetRoute , SFixedString < 32 >*, pstrRoute )
11791165
CALLREALNET1R( bool, InitServerId , const char*, szPath )

MTA10_Server/mods/deathmatch/logic/net/CNetBuffer.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class CNetServerBuffer : public CNetServer
6464
// CNetServer interface
6565
virtual bool StartNetwork ( const char* szIP, unsigned short usServerPort, unsigned int uiAllowedPlayers, const char* szServerName );
6666
virtual void StopNetwork ( void );
67-
virtual void ResetNetwork ( void );
6867

6968
virtual void DoPulse ( void );
7069

@@ -94,7 +93,7 @@ class CNetServerBuffer : public CNetServer
9493
virtual void SetClientBitStreamVersion ( const NetServerPlayerID &PlayerID, unsigned short usBitStreamVersion );
9594
virtual void ClearClientBitStreamVersion ( const NetServerPlayerID &PlayerID );
9695

97-
virtual void SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC );
96+
virtual void SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC, const char* szImgMods );
9897

9998
virtual unsigned int GetPendingPacketCount ( void );
10099
virtual void GetNetRoute ( SFixedString < 32 >* pstrRoute );
@@ -112,12 +111,13 @@ class CNetServerBuffer : public CNetServer
112111
#define DOTYPE(func) const static int TYPE_##func = __COUNTER__;
113112
#define SETTYPE(func) type=TYPE_##func;
114113

115-
#define DECLARE_FUNC_ARGS0(func) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( ) {SETTYPE(func)} };
116-
#define DECLARE_FUNC_ARGS1(func,t1,n1) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1 ) : n1(n1) {SETTYPE(func)} t1 n1; };
117-
#define DECLARE_FUNC_ARGS2(func,t1,n1,t2,n2) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2 ) : n1(n1), n2(n2) {SETTYPE(func)} t1 n1; t2 n2; };
118-
#define DECLARE_FUNC_ARGS3(func,t1,n1,t2,n2,t3,n3) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3 ) : n1(n1), n2(n2), n3(n3) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; };
119-
#define DECLARE_FUNC_ARGS4(func,t1,n1,t2,n2,t3,n3,t4,n4) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3,t4 n4 ) : n1(n1), n2(n2), n3(n3), n4(n4) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; t4 n4; };
120-
#define DECLARE_FUNC_ARGS5(func,t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3,t4 n4,t5 n5 ) : n1(n1), n2(n2), n3(n3), n4(n4), n5(n5) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; };
114+
#define DECLARE_FUNC_ARGS0(func) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( ) {SETTYPE(func)} };
115+
#define DECLARE_FUNC_ARGS1(func,t1,n1) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1 ) : n1(n1) {SETTYPE(func)} t1 n1; };
116+
#define DECLARE_FUNC_ARGS2(func,t1,n1,t2,n2) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2 ) : n1(n1), n2(n2) {SETTYPE(func)} t1 n1; t2 n2; };
117+
#define DECLARE_FUNC_ARGS3(func,t1,n1,t2,n2,t3,n3) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3 ) : n1(n1), n2(n2), n3(n3) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; };
118+
#define DECLARE_FUNC_ARGS4(func,t1,n1,t2,n2,t3,n3,t4,n4) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3,t4 n4 ) : n1(n1), n2(n2), n3(n3), n4(n4) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; t4 n4; };
119+
#define DECLARE_FUNC_ARGS5(func,t1,n1,t2,n2,t3,n3,t4,n4,t5,n5) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3,t4 n4,t5 n5 ) : n1(n1), n2(n2), n3(n3), n4(n4), n5(n5) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; };
120+
#define DECLARE_FUNC_ARGS6(func,t1,n1,t2,n2,t3,n3,t4,n4,t5,n5,t6,n6) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1,t2 n2,t3 n3,t4 n4,t5 n5,t6 n6 ) : n1(n1), n2(n2), n3(n3), n4(n4), n5(n5), n6(n6) {SETTYPE(func)} t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; };
121121

122122
#define DECLARE_FUNC_ARGS0R(ret,func) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( ) {SETTYPE(func)} ret result; };
123123
#define DECLARE_FUNC_ARGS1R(ret,func,t1,n1) DOTYPE(func) struct S##func##Args : SArgs { S##func##Args ( t1 n1 ) : n1(n1) {SETTYPE(func)} t1 n1; ret result; };
@@ -130,7 +130,6 @@ class CNetServerBuffer : public CNetServer
130130

131131
DECLARE_FUNC_ARGS4R( bool, StartNetwork , const char*, szIP, unsigned short, usServerPort, unsigned int, uiAllowedPlayers, const char*, szServerName );
132132
DECLARE_FUNC_ARGS0 ( StopNetwork );
133-
DECLARE_FUNC_ARGS0 ( ResetNetwork );
134133
DECLARE_FUNC_ARGS0 ( DoPulse );
135134
DECLARE_FUNC_ARGS1 ( RegisterPacketHandler , PPACKETHANDLER, pfnPacketHandler );
136135
DECLARE_FUNC_ARGS2R( bool, GetNetworkStatistics , NetStatistics*, pDest, const NetServerPlayerIDRef, PlayerID );
@@ -146,7 +145,7 @@ class CNetServerBuffer : public CNetServer
146145
DECLARE_FUNC_ARGS1 ( SetMaximumIncomingConnections , unsigned short, numberAllowed );
147146
DECLARE_FUNC_ARGS2 ( SetClientBitStreamVersion , const NetServerPlayerIDRef, PlayerID, unsigned short, usBitStreamVersion );
148147
DECLARE_FUNC_ARGS1 ( ClearClientBitStreamVersion , const NetServerPlayerIDRef, PlayerID );
149-
DECLARE_FUNC_ARGS5 ( SetChecks , const char*, szDisableComboACMap, const char*, szDisableACMap, const char*, szEnableSDMap, int, iEnableClientChecks, bool, bHideAC );
148+
DECLARE_FUNC_ARGS6 ( SetChecks , const char*, szDisableComboACMap, const char*, szDisableACMap, const char*, szEnableSDMap, int, iEnableClientChecks, bool, bHideAC, const char*, szImgMods );
150149
DECLARE_FUNC_ARGS0R( unsigned int, GetPendingPacketCount );
151150
DECLARE_FUNC_ARGS1 ( GetNetRoute , SFixedString < 32 >*, pstrRoute );
152151
DECLARE_FUNC_ARGS1R( bool, InitServerId , const char*, szPath );

MTA10_Server/mods/deathmatch/mtaserver.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@
4848
e.g. 88.11.22.33,101.2.3.4 -->
4949
<http_dos_exclude></http_dos_exclude>
5050

51+
<!-- By default, the server will block the use of locally customized gta3.img player skins.
52+
This setting can be used to allow such mods. Not recommended for competitive servers.
53+
Values: none or peds ; default value: none -->
54+
<allow_gta3_img_mods>none</allow_gta3_img_mods>
55+
5156
<!-- By default, the server will block the use of customized GTA:SA data files. -->
5257
<!-- To allow specific client files, add one or more of the following: -->
5358
<!-- <client_file name="data/carmods.dat" verify="0"/> -->
@@ -249,4 +254,5 @@
249254
<!-- play is the default freeroam gamemode. Remove the following line to prevent it from starting. -->
250255
<resource src="play" startup="1" protected="0"/>
251256

257+
252258
</config>

MTA10_Server/sdk/net/CNetServer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class CNetServer
100100
// szIP can be NULL if autochoosing is wanted.
101101
virtual bool StartNetwork ( const char* szIP, unsigned short usServerPort, unsigned int uiAllowedPlayers, const char* szServerName ) = 0;
102102
virtual void StopNetwork ( void ) = 0;
103-
virtual void ResetNetwork ( void ) = 0;
104103

105104
virtual void DoPulse ( void ) = 0;
106105

@@ -130,7 +129,7 @@ class CNetServer
130129
virtual void SetClientBitStreamVersion ( const NetServerPlayerID &PlayerID, unsigned short usBitStreamVersion ) = 0;
131130
virtual void ClearClientBitStreamVersion ( const NetServerPlayerID &PlayerID ) = 0;
132131

133-
virtual void SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC ) = 0;
132+
virtual void SetChecks ( const char* szDisableComboACMap, const char* szDisableACMap, const char* szEnableSDMap, int iEnableClientChecks, bool bHideAC, const char* szImgMods ) = 0;
134133

135134
virtual unsigned int GetPendingPacketCount ( void ) = 0;
136135
virtual void GetNetRoute ( SFixedString < 32 >* pstrRoute ) = 0;

MTA10_Server/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878

7979
#define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR)
8080
#define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk)
81-
#define _SERVER_NET_MODULE_VERSION 0x08F // (0x000 - 0xfff) Lvl9 wizards only
81+
#define _SERVER_NET_MODULE_VERSION 0x090 // (0x000 - 0xfff) Lvl9 wizards only
8282
#define _NETCODE_VERSION 0x1D8 // (0x000 - 0xfff) Increment when net messages change (pre-release)
83-
#define MTA_DM_BITSTREAM_VERSION 0x05F // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
83+
#define MTA_DM_BITSTREAM_VERSION 0x060 // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code).
8484

8585
// To avoid user confusion, make sure the ASE version matches only if communication is possible
8686
#if defined(MTA_DM_CONNECT_FROM_PUBLIC)

0 commit comments

Comments
 (0)