Skip to content

Commit

Permalink
[luadefs-server] Sort and conform a "few" things
Browse files Browse the repository at this point in the history
  • Loading branch information
qaisjp committed Sep 13, 2015
1 parent 57544b4 commit 2dd372b
Show file tree
Hide file tree
Showing 22 changed files with 70 additions and 118 deletions.
14 changes: 7 additions & 7 deletions MTA10_Server/mods/deathmatch/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ struct SAclRequest;
#include "luadefs/CLuaBitDefs.h"
#include "luadefs/CLuaBlipDefs.h"
#include "luadefs/CLuaCameraDefs.h"
#include "luadefs/CLuaClassDefs.h"
#include "luadefs/CLuaColShapeDefs.h"
#include "luadefs/CLuaDefs.h"
#include "luadefs/CLuaFileDefs.h"
#include "luadefs/CLuaHTTPDefs.h"
#include "luadefs/CLuaHandlingDefs.h"
#include "luadefs/CLuaMarkerDefs.h"
#include "luadefs/CLuaMatrixDefs.h"
#include "luadefs/CLuaObjectDefs.h"
#include "luadefs/CLuaPedDefs.h"
#include "luadefs/CLuaPickupDefs.h"
Expand All @@ -131,16 +133,14 @@ struct SAclRequest;
#include "luadefs/CLuaTeamDefs.h"
#include "luadefs/CLuaTextDefs.h"
#include "luadefs/CLuaTimerDefs.h"
#include "luadefs/CLuaWaterDefs.h"
#include "luadefs/CLuaWorldDefs.h"
#include "luadefs/CLuaVehicleDefs.h"
#include "luadefs/CLuaVoiceDefs.h"
#include "luadefs/CLuaXMLDefs.h"
#include "luadefs/CLuaClassDefs.h"
#include "luadefs/CLuaVector2Defs.h"
#include "luadefs/CLuaVector3Defs.h"
#include "luadefs/CLuaVector4Defs.h"
#include "luadefs/CLuaMatrixDefs.h"
#include "luadefs/CLuaVehicleDefs.h"
#include "luadefs/CLuaVoiceDefs.h"
#include "luadefs/CLuaWaterDefs.h"
#include "luadefs/CLuaWorldDefs.h"
#include "luadefs/CLuaXMLDefs.h"
#include "lua/oopdefs/CLuaOOPDefs.h"

// Lua includes
Expand Down
2 changes: 2 additions & 0 deletions MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="CLuaAccountDefs.cpp" />
<ClCompile Include="CServer.cpp" />
<ClCompile Include="..\..\sdk\MTAPlatform.cpp" />
<ClCompile Include="logic\CPerfStat.PlayerPacketUsage.cpp" />
Expand Down Expand Up @@ -875,6 +876,7 @@
<ClCompile Include="..\..\..\Shared\animation\CPositionRotationAnimation.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="CLuaAccountDefs.h" />
<ClInclude Include="logic\CLightsyncManager.h" />
<ClInclude Include="Config.h" />
<ClInclude Include="..\..\..\vendor\zip\crypt.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,11 @@
<ClCompile Include="logic\luadefs\CLuaRadarAreaDefs.cpp">
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
<ClCompile Include="CLuaAccountDefs.cpp">
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
<ClCompile Include="logic\luadefs\CLuaColShapeDefs.cpp">
<Filter>Source Files\logic\lua</Filter>
<Filter>Source Files\logic\luadefs</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -1886,6 +1889,9 @@
<ClInclude Include="logic\luadefs\CLuaColShapeDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
<ClInclude Include="CLuaAccountDefs.h">
<Filter>Header Files\logic\luadefs</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Xml Include="acl.xml">
Expand Down
30 changes: 12 additions & 18 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,33 +271,27 @@ void CLuaMain::InitClasses ( lua_State* luaVM )
if ( !m_bEnableOOP )
return;

// Ordering of classes matters here -
// just make sure that inherited classes
// stay near the top.
// Putting CLuaElementDefs::AddClass near
// the bottom will cause a crash.
CLuaElementDefs ::AddClass ( luaVM );
CLuaElementDefs ::AddClass ( luaVM ); // keep this at the top because inheritance
AddAccountClass ( luaVM );
AddBanClass ( luaVM );
CLuaBlipDefs ::AddClass ( luaVM );
CLuaColShapeDefs ::AddClass ( luaVM );
AddConnectionClass ( luaVM );
CLuaFileDefs ::AddClass ( luaVM );
CLuaXMLDefs ::AddClass ( luaVM );
CLuaPickupDefs ::AddClass ( luaVM );
CLuaTextDefs ::AddClasses ( luaVM );
CLuaACLDefs ::AddClasses ( luaVM );
CLuaVehicleDefs ::AddClass ( luaVM );
CLuaMarkerDefs ::AddClass ( luaVM );
CLuaObjectDefs ::AddClass ( luaVM );
CLuaPedDefs ::AddClass ( luaVM );
CLuaPickupDefs ::AddClass ( luaVM );
CLuaPlayerDefs ::AddClass ( luaVM );
AddQueryHandleClass ( luaVM );
CLuaRadarAreaDefs ::AddClass ( luaVM );
CLuaResourceDefs ::AddClass ( luaVM );
CLuaBlipDefs ::AddClass ( luaVM );
CLuaTeamDefs ::AddClass ( luaVM );
CLuaWaterDefs ::AddClass ( luaVM );
CLuaTextDefs ::AddClass ( luaVM );
CLuaTimerDefs ::AddClass ( luaVM );
CLuaRadarAreaDefs ::AddClass ( luaVM );
AddAccountClass ( luaVM );
AddBanClass ( luaVM );
AddConnectionClass ( luaVM );
AddQueryHandleClass ( luaVM );
CLuaVehicleDefs ::AddClass ( luaVM );
CLuaWaterDefs ::AddClass ( luaVM );
CLuaXMLDefs ::AddClass ( luaVM );
}


Expand Down
22 changes: 11 additions & 11 deletions MTA10_Server/mods/deathmatch/logic/lua/CLuaManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,27 +289,27 @@ void CLuaManager::LoadCFunctions ( void )
// Load the functions from our classes
CLuaACLDefs::LoadFunctions ();
CLuaBitDefs::LoadFunctions ();
CLuaBlipDefs::LoadFunctions ();
CLuaCameraDefs::LoadFunctions ();
CLuaColShapeDefs::LoadFunctions ();
CLuaElementDefs::LoadFunctions ();
CLuaVehicleDefs::LoadFunctions ();
CLuaFileDefs::LoadFunctions ();
CLuaHandlingDefs::LoadFunctions ();
CLuaPickupDefs::LoadFunctions ();
CLuaResourceDefs::LoadFunctions ();
CLuaTextDefs::LoadFunctions ();
CLuaWorldDefs::LoadFunctions ();
CLuaVoiceDefs::LoadFunctions ();
CLuaXMLDefs::LoadFunctions ();
CLuaMarkerDefs::LoadFunctions ();
CLuaObjectDefs::LoadFunctions ();
CLuaPedDefs::LoadFunctions ();
CLuaPickupDefs::LoadFunctions ();
CLuaPlayerDefs::LoadFunctions ();
CLuaBlipDefs::LoadFunctions ();
CLuaRadarAreaDefs::LoadFunctions ();
CLuaResourceDefs::LoadFunctions ();
CLuaTeamDefs::LoadFunctions ();
CLuaWaterDefs::LoadFunctions ();
CLuaTextDefs::LoadFunctions ();
CLuaTimerDefs::LoadFunctions ();
CLuaRadarAreaDefs::LoadFunctions ();
CLuaColShapeDefs::LoadFunctions ();
CLuaVehicleDefs::LoadFunctions ();
CLuaVoiceDefs::LoadFunctions ();
CLuaWaterDefs::LoadFunctions ();
CLuaWorldDefs::LoadFunctions ();
CLuaXMLDefs::LoadFunctions ();

// All-Seeing Eye Functions
CLuaCFunctions::AddFunction ( "getGameType", CLuaFunctionDefs::GetGameType );
Expand Down
7 changes: 2 additions & 5 deletions MTA10_Server/mods/deathmatch/logic/lua/LuaCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
*
*****************************************************************************/

#ifndef __LUACOMMON_H
#define __LUACOMMON_H
#pragma once

extern "C"
{
Expand Down Expand Up @@ -93,6 +92,4 @@ struct SLuaDebugInfo
SString strShortSrc;
int iLine;
int infoType;
};

#endif
};
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/luadefs/CLuaACLDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void CLuaACLDefs::LoadFunctions ( void )
}


void CLuaACLDefs::AddClasses ( lua_State* luaVM )
void CLuaACLDefs::AddClass ( lua_State* luaVM )
{
//////////////////////////
// ACL class
Expand Down
2 changes: 1 addition & 1 deletion MTA10_Server/mods/deathmatch/logic/luadefs/CLuaACLDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class CLuaACLDefs: public CLuaDefs
{
public:
static void LoadFunctions ( void );
static void AddClasses ( lua_State* luaVM );
static void AddClass ( lua_State* luaVM );

LUA_DECLARE ( aclReload );
LUA_DECLARE ( aclSave );
Expand Down
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaBitDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
*
*****************************************************************************/

#ifndef __CLUABITDEFS_H
#define __CLUABITDEFS_H

#pragma once
#include "CLuaDefs.h"

class CLuaBitDefs: public CLuaDefs
Expand All @@ -37,6 +35,4 @@ class CLuaBitDefs: public CLuaDefs
LUA_DECLARE ( bitExtract );
LUA_DECLARE ( bitReplace );

};

#endif
};
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaClassDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
*
*****************************************************************************/

#ifndef __LUACLASSES_H
#define __LUACLASSES_H

#pragma once
extern "C"
{
#include "lua.h"
Expand Down Expand Up @@ -45,6 +43,4 @@ class CLuaClassDefs: public CLuaDefs
static const char* GetBanClass ( CBan* pBan );
static const char* GetQueryClass ( CDbJobData* pJobData );
static const char* GetElementClass ( CElement* pElement );
};

#endif
};
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
*
*****************************************************************************/

#ifndef __CLUADEFS_H
#define __CLUADEFS_H

#pragma once
#include "../CAccessControlListManager.h"
#include "../CAccountManager.h"
#include "../CBlipManager.h"
Expand Down Expand Up @@ -88,6 +86,4 @@ class CLuaDefs
static CResourceManager* m_pResourceManager;
static CAccessControlListManager* m_pACLManager;
static CMainConfig* m_pMainConfig;
};

#endif
};
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaHTTPDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
*
*****************************************************************************/

#ifndef __CLUAHTTPDEFS_H
#define __CLUAHTTPDEFS_H

#pragma once
#include "CLuaDefs.h"

// This class is for functions are only available to HTTPD scripts.
Expand All @@ -28,6 +26,4 @@ class CLuaHTTPDefs: public CLuaDefs
LUA_DECLARE ( httpSetResponseCode );
LUA_DECLARE ( httpClear );
LUA_DECLARE ( httpRequestLogin );
};

#endif
};
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaMatrixDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
*
*****************************************************************************/

#ifndef __CLUAMATRIXDEFS_H
#define __CLUAMATRIXDEFS_H

#pragma once
extern "C"
{
#include "lua.h"
Expand Down Expand Up @@ -49,6 +47,4 @@ class CLuaMatrixDefs: public CLuaDefs
LUA_DECLARE ( Sub );
LUA_DECLARE ( Mul );
LUA_DECLARE ( Div );
};

#endif
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void CLuaTextDefs::LoadFunctions ( void )
CLuaCFunctions::AddFunction ( "textItemGetPriority", textItemGetPriority );
}

void CLuaTextDefs::AddClasses ( lua_State* luaVM )
void CLuaTextDefs::AddClass ( lua_State* luaVM )
{
//////////////////////////
// TextDisplay class
Expand Down
12 changes: 4 additions & 8 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaTextDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@
*
*****************************************************************************/

#ifndef __CLUATEXTDEFS_H
#define __CLUATEXTDEFS_H

#pragma once
#include "CLuaDefs.h"

class CLuaTextDefs: public CLuaDefs
{
public:
static void LoadFunctions ( void );
static void AddClasses ( lua_State* luaVM );
static void LoadFunctions ( void );
static void AddClass ( lua_State* luaVM );

LUA_DECLARE ( textCreateDisplay );
LUA_DECLARE ( textDestroyDisplay );
Expand All @@ -44,6 +42,4 @@ class CLuaTextDefs: public CLuaDefs
LUA_DECLARE ( textItemGetColor );
LUA_DECLARE ( textItemSetPriority );
LUA_DECLARE ( textItemGetPriority );
};

#endif
};
7 changes: 2 additions & 5 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVector2Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
*
*****************************************************************************/

#ifndef __LUAVECTORDEFS_H
#define __LUAVECTORDEFS_H
#pragma once

extern "C"
{
Expand Down Expand Up @@ -50,6 +49,4 @@ class CLuaVector2Defs : public CLuaDefs
LUA_DECLARE ( Pow );
LUA_DECLARE ( Unm );
LUA_DECLARE ( Eq );
};

#endif
};
7 changes: 2 additions & 5 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVector3Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
*
*****************************************************************************/

#ifndef __LUAVECTOR3DEFS_H
#define __LUAVECTOR3DEFS_H
#pragma once

extern "C"
{
Expand Down Expand Up @@ -51,6 +50,4 @@ class CLuaVector3Defs: public CLuaDefs
LUA_DECLARE ( Pow );
LUA_DECLARE ( Unm );
LUA_DECLARE ( Eq );
};

#endif
};
8 changes: 2 additions & 6 deletions MTA10_Server/mods/deathmatch/logic/luadefs/CLuaVector4Defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
*
*****************************************************************************/

#ifndef __LUAVECTOR4DEFS_H
#define __LUAVECTOR4DEFS_H

#pragma once
extern "C"
{
#include "lua.h"
Expand Down Expand Up @@ -52,6 +50,4 @@ class CLuaVector4Defs: public CLuaDefs
LUA_DECLARE ( Pow );
LUA_DECLARE ( Unm );
LUA_DECLARE ( Eq );
};

#endif
};

0 comments on commit 2dd372b

Please sign in to comment.