Permalink
Browse files

Fix source code formatting

  • Loading branch information...
codenulls committed Dec 13, 2018
1 parent 2194c29 commit 10ae3dde9881f0fd21d1b4dfd44b09a882bd8f5f
@@ -519,8 +519,8 @@ bool CGame::Start(int iArgumentCount, char* szArguments[])
m_pRegisteredCommands = new CRegisteredCommands(m_pACLManager);
m_pLuaManager = new CLuaManager(m_pObjectManager, m_pPlayerManager, m_pVehicleManager, m_pBlipManager, m_pRadarAreaManager, m_pRegisteredCommands,
m_pMapManager, &m_Events);
m_pConsole =
new CConsole(m_pBlipManager, m_pMapManager, m_pPlayerManager, m_pRegisteredCommands, m_pVehicleManager, m_pLuaManager, m_pBanManager, m_pACLManager);
m_pConsole = new CConsole(m_pBlipManager, m_pMapManager, m_pPlayerManager, m_pRegisteredCommands, m_pVehicleManager, m_pLuaManager,
m_pBanManager, m_pACLManager);
m_pMainConfig = new CMainConfig(m_pConsole, m_pLuaManager);
m_pRPCFunctions = new CRPCFunctions;

@@ -1357,7 +1357,7 @@ void CGame::QuitPlayer(CPlayer& Player, CClient::eQuitReasons Reason, bool bSayI
return;

Player.SetLeavingServer(true);

// Grab quit reaason
const char* szReason = "Unknown";
switch (Reason)
@@ -8174,27 +8174,27 @@ void CHandlingManager::InitializeDefaultHandlings(void)
m_OriginalHandlingData[209].ucTailLight = 1;
m_OriginalHandlingData[209].ucAnimGroup = 0;

m_OriginalHandlingData[210] = m_OriginalHandlingData[69]; // HT_HOTRINA = HT_HOTRING
m_OriginalHandlingData[210] = m_OriginalHandlingData[69]; // HT_HOTRINA = HT_HOTRING
m_OriginalHandlingData[210].iVehicleID = 210;

m_OriginalHandlingData[211] = m_OriginalHandlingData[69]; // HT_HOTRINB = HT_HOTRING
m_OriginalHandlingData[211] = m_OriginalHandlingData[69]; // HT_HOTRINB = HT_HOTRING
m_OriginalHandlingData[211].iVehicleID = 211;

m_OriginalHandlingData[212] = m_OriginalHandlingData[103]; // HT_SADLSHIT = HT_SADLER
m_OriginalHandlingData[212] = m_OriginalHandlingData[103]; // HT_SADLSHIT = HT_SADLER
m_OriginalHandlingData[212].iVehicleID = 212;

m_OriginalHandlingData[213] = m_OriginalHandlingData[52]; // HT_GLENSHIT = HT_GLENDALE
m_OriginalHandlingData[213] = m_OriginalHandlingData[52]; // HT_GLENSHIT = HT_GLENDALE
m_OriginalHandlingData[213].iVehicleID = 213;

m_OriginalHandlingData[214] = m_OriginalHandlingData[163]; // HT_FAGGIO = HT_PIZZABOY
m_OriginalHandlingData[214] = m_OriginalHandlingData[163]; // HT_FAGGIO = HT_PIZZABOY
m_OriginalHandlingData[214].iVehicleID = 214;

m_OriginalHandlingData[215] = m_OriginalHandlingData[7]; // HT_FIRELA = HT_FIRETRUK
m_OriginalHandlingData[215] = m_OriginalHandlingData[7]; // HT_FIRELA = HT_FIRETRUK
m_OriginalHandlingData[215].iVehicleID = 215;

m_OriginalHandlingData[216] = m_OriginalHandlingData[65]; // HT_RNCHLURE = HT_RANCHER
m_OriginalHandlingData[216] = m_OriginalHandlingData[65]; // HT_RNCHLURE = HT_RANCHER
m_OriginalHandlingData[216].iVehicleID = 216;

m_OriginalHandlingData[217] = m_OriginalHandlingData[126]; // HT_FREIBOX = HT_FREIFLAT
m_OriginalHandlingData[217] = m_OriginalHandlingData[126]; // HT_FREIBOX = HT_FREIFLAT
m_OriginalHandlingData[217].iVehicleID = 217;
}
@@ -261,7 +261,7 @@ namespace
// "has this function been removed yet?"
// bRemoved actually means:
// "is not rename?" (you can't rename removed functions)
bool bRemoved;
bool bRemoved;

SString strOldName;
SString strNewName;
@@ -11247,7 +11247,7 @@ CBan* CStaticFunctionDefinitions::BanPlayer(CPlayer* pPlayer, bool bIP, bool bUs
// Call the event
CLuaArguments Arguments;
Arguments.PushBan(pBan);

if (pResponsible)
Arguments.PushElement(pResponsible);

@@ -11420,10 +11420,10 @@ CBan* CStaticFunctionDefinitions::AddBan(SString strIP, SString strUsername, SSt
// Call the event
CLuaArguments Arguments;
Arguments.PushBan(pBan);

if (pResponsible)
Arguments.PushElement(pResponsible);

// A script can call kickPlayer in the onPlayerBan event, which would
// show him the 'kicked' message instead of our 'banned' message.
const bool bLeavingServer = pPlayer->IsLeavingServer();
@@ -15,12 +15,22 @@
void CLuaFileDefs::LoadFunctions(void)
{
std::map<const char*, lua_CFunction> functions{
{"fileOpen", fileOpen}, {"fileCreate", fileCreate}, {"fileExists", fileExists}, {"fileCopy", fileCopy},
{"fileRename", fileRename}, {"fileDelete", fileDelete},

{"fileClose", fileClose}, {"fileFlush", fileFlush}, {"fileRead", fileRead}, {"fileWrite", fileWrite},

{"fileGetPos", fileGetPos}, {"fileGetSize", fileGetSize}, {"fileGetPath", fileGetPath}, {"fileIsEOF", fileIsEOF},
{"fileOpen", fileOpen},
{"fileCreate", fileCreate},
{"fileExists", fileExists},
{"fileCopy", fileCopy},
{"fileRename", fileRename},
{"fileDelete", fileDelete},

{"fileClose", fileClose},
{"fileFlush", fileFlush},
{"fileRead", fileRead},
{"fileWrite", fileWrite},

{"fileGetPos", fileGetPos},
{"fileGetSize", fileGetSize},
{"fileGetPath", fileGetPath},
{"fileIsEOF", fileIsEOF},

{"fileSetPos", fileSetPos},
};
@@ -432,7 +442,7 @@ int CLuaFileDefs::fileCopy(lua_State* luaVM)
if (CResourceManager::ParseResourcePathInput(strInputSrcPath, pSrcResource, &strSrcAbsPath) &&
CResourceManager::ParseResourcePathInput(strInputDestPath, pDestResource, &strDestAbsPath))
{
CheckCanModifyOtherResources(argStream, pThisResource, {pSrcResource, pDestResource});
CheckCanModifyOtherResources(argStream, pThisResource, { pSrcResource, pDestResource });
CheckCanAccessOtherResourceFile(argStream, pThisResource, pSrcResource, strSrcAbsPath);
CheckCanAccessOtherResourceFile(argStream, pThisResource, pDestResource, strDestAbsPath);
if (!argStream.HasErrors())
@@ -523,7 +533,7 @@ int CLuaFileDefs::fileRename(lua_State* luaVM)
if (CResourceManager::ParseResourcePathInput(strInputSrcPath, pSrcResource, &strSrcAbsPath) &&
CResourceManager::ParseResourcePathInput(strInputDestPath, pDestResource, &strDestAbsPath))
{
CheckCanModifyOtherResources(argStream, pThisResource, {pSrcResource, pDestResource});
CheckCanModifyOtherResources(argStream, pThisResource, { pSrcResource, pDestResource });
CheckCanAccessOtherResourceFile(argStream, pThisResource, pSrcResource, strSrcAbsPath);
CheckCanAccessOtherResourceFile(argStream, pThisResource, pDestResource, strDestAbsPath);
if (!argStream.HasErrors())
@@ -935,9 +945,8 @@ int CLuaFileDefs::fileCloseGC(lua_State* luaVM)
{
// This file wasn't closed, so we should warn
// the scripter that they forgot to close it.
m_pScriptDebugging->LogWarning(pFile->GetLuaDebugInfo(), "Unclosed file (%s) was garbage collected. Check your resource for dereferenced files.",
*pFile->GetFilePath());

m_pScriptDebugging->LogWarning(pFile->GetLuaDebugInfo(), "Unclosed file (%s) was garbage collected. Check your resource for dereferenced files.", *pFile->GetFilePath());

// Close the file and delete it from elements
pFile->Unload();
m_pElementDeleter->Delete(pFile);
@@ -15,7 +15,7 @@
#include "CStringMap.h"

#ifdef MTA_CLIENT
#include "CScriptDebugging.h"
#include "CScriptDebugging.h"
#endif

/////////////////////////////////////////////////////////////////////////
@@ -1267,11 +1267,11 @@ class CScriptArgReader
// Output warning here (there's no better way to integrate it without huge code changes
if (!m_bError && !m_strCustomWarning.empty())
{
#ifdef MTA_CLIENT
#ifdef MTA_CLIENT
CLuaFunctionDefs::m_pScriptDebugging->LogWarning(m_luaVM, m_strCustomWarning);
#else
#else
g_pGame->GetScriptDebugging()->LogWarning(m_luaVM, m_strCustomWarning);
#endif
#endif

m_strCustomWarning.clear();
}
@@ -1,8 +1,8 @@
/*
BASSWMA 2.4 C/C++ header file
Copyright (c) 2002-2018 Un4seen Developments Ltd.
BASSWMA 2.4 C/C++ header file
Copyright (c) 2002-2018 Un4seen Developments Ltd.
See the BASSWMA.CHM file for more detailed documentation
See the BASSWMA.CHM file for more detailed documentation
*/

#ifndef BASSWMA_H
@@ -22,44 +22,44 @@ extern "C" {
#define BASSWMADEF(f) WINAPI f
#endif

typedef DWORD HWMENCODE; // WMA encoding handle
typedef DWORD HWMENCODE; // WMA encoding handle

// Additional error codes returned by BASS_ErrorGetCode
#define BASS_ERROR_WMA_LICENSE 1000 // the file is protected
#define BASS_ERROR_WMA 1001 // Windows Media (9 or above) is not installed
#define BASS_ERROR_WMA_WM9 BASS_ERROR_WMA
#define BASS_ERROR_WMA_DENIED 1002 // access denied (user/pass is invalid)
#define BASS_ERROR_WMA_INDIVIDUAL 1004 // individualization is needed
#define BASS_ERROR_WMA_PUBINIT 1005 // publishing point initialization problem
#define BASS_ERROR_WMA_LICENSE 1000 // the file is protected
#define BASS_ERROR_WMA 1001 // Windows Media (9 or above) is not installed
#define BASS_ERROR_WMA_WM9 BASS_ERROR_WMA
#define BASS_ERROR_WMA_DENIED 1002 // access denied (user/pass is invalid)
#define BASS_ERROR_WMA_INDIVIDUAL 1004 // individualization is needed
#define BASS_ERROR_WMA_PUBINIT 1005 // publishing point initialization problem

// Additional BASS_SetConfig options
#define BASS_CONFIG_WMA_PRECHECK 0x10100
#define BASS_CONFIG_WMA_PREBUF 0x10101
#define BASS_CONFIG_WMA_BASSFILE 0x10103
#define BASS_CONFIG_WMA_NETSEEK 0x10104
#define BASS_CONFIG_WMA_VIDEO 0x10105
#define BASS_CONFIG_WMA_BUFTIME 0x10106
#define BASS_CONFIG_WMA_PRECHECK 0x10100
#define BASS_CONFIG_WMA_PREBUF 0x10101
#define BASS_CONFIG_WMA_BASSFILE 0x10103
#define BASS_CONFIG_WMA_NETSEEK 0x10104
#define BASS_CONFIG_WMA_VIDEO 0x10105
#define BASS_CONFIG_WMA_BUFTIME 0x10106

// additional WMA sync types
#define BASS_SYNC_WMA_CHANGE 0x10100
#define BASS_SYNC_WMA_META 0x10101
#define BASS_SYNC_WMA_CHANGE 0x10100
#define BASS_SYNC_WMA_META 0x10101

// additional BASS_StreamGetFilePosition WMA mode
#define BASS_FILEPOS_WMA_BUFFER 1000 // internet buffering progress (0-100%)
#define BASS_FILEPOS_WMA_BUFFER 1000 // internet buffering progress (0-100%)

// Additional flags for use with BASS_WMA_EncodeOpen/File/Network/Publish
#define BASS_WMA_ENCODE_STANDARD 0x2000 // standard WMA
#define BASS_WMA_ENCODE_PRO 0x4000 // WMA Pro
#define BASS_WMA_ENCODE_24BIT 0x8000 // 24-bit
#define BASS_WMA_ENCODE_PCM 0x10000 // uncompressed PCM
#define BASS_WMA_ENCODE_SCRIPT 0x20000 // set script (mid-stream tags) in the WMA encoding
#define BASS_WMA_ENCODE_QUEUE 0x40000 // queue data to feed encoder asynchronously
#define BASS_WMA_ENCODE_SOURCE 0x80000 // use a BASS channel as source
#define BASS_WMA_ENCODE_VOICE 0x100000 // WMA Voice
#define BASS_WMA_ENCODE_VOICE_MIXED 0x300000 // WMA Voice mixed mode
#define BASS_WMA_ENCODE_STANDARD 0x2000 // standard WMA
#define BASS_WMA_ENCODE_PRO 0x4000 // WMA Pro
#define BASS_WMA_ENCODE_24BIT 0x8000 // 24-bit
#define BASS_WMA_ENCODE_PCM 0x10000 // uncompressed PCM
#define BASS_WMA_ENCODE_SCRIPT 0x20000 // set script (mid-stream tags) in the WMA encoding
#define BASS_WMA_ENCODE_QUEUE 0x40000 // queue data to feed encoder asynchronously
#define BASS_WMA_ENCODE_SOURCE 0x80000 // use a BASS channel as source
#define BASS_WMA_ENCODE_VOICE 0x100000 // WMA Voice
#define BASS_WMA_ENCODE_VOICE_MIXED 0x300000 // WMA Voice mixed mode

// Additional flag for use with BASS_WMA_EncodeGetRates
#define BASS_WMA_ENCODE_RATES_VBR 0x10000 // get available VBR quality settings
#define BASS_WMA_ENCODE_RATES_VBR 0x10000 // get available VBR quality settings

typedef void (CALLBACK CLIENTCONNECTPROC)(HWMENCODE handle, BOOL connect, const char *ip, void *user);
/* Client connection notification callback function.
@@ -77,24 +77,24 @@ length : Length of the data
user : The 'user' parameter value given when calling BASS_WMA_EncodeOpen */

// WMENCODEPROC "type" values
#define BASS_WMA_ENCODE_HEAD 0
#define BASS_WMA_ENCODE_DATA 1
#define BASS_WMA_ENCODE_DONE 2
#define BASS_WMA_ENCODE_HEAD 0
#define BASS_WMA_ENCODE_DATA 1
#define BASS_WMA_ENCODE_DONE 2

// BASS_WMA_EncodeSetTag "form" values
#define BASS_WMA_TAG_ANSI 0
#define BASS_WMA_TAG_UNICODE 1
#define BASS_WMA_TAG_UTF8 2
#define BASS_WMA_TAG_BINARY 0x100 // FLAG: binary tag (HIWORD=length)
#define BASS_WMA_TAG_ANSI 0
#define BASS_WMA_TAG_UNICODE 1
#define BASS_WMA_TAG_UTF8 2
#define BASS_WMA_TAG_BINARY 0x100 // FLAG: binary tag (HIWORD=length)

// BASS_CHANNELINFO type
#define BASS_CTYPE_STREAM_WMA 0x10300
#define BASS_CTYPE_STREAM_WMA_MP3 0x10301
#define BASS_CTYPE_STREAM_WMA 0x10300
#define BASS_CTYPE_STREAM_WMA_MP3 0x10301

// Additional BASS_ChannelGetTags types
#define BASS_TAG_WMA 8 // WMA header tags : series of null-terminated UTF-8 strings
#define BASS_TAG_WMA_META 11 // WMA mid-stream tag : UTF-8 string
#define BASS_TAG_WMA_CODEC 12 // WMA codec
#define BASS_TAG_WMA 8 // WMA header tags : series of null-terminated UTF-8 strings
#define BASS_TAG_WMA_META 11 // WMA mid-stream tag : UTF-8 string
#define BASS_TAG_WMA_CODEC 12 // WMA codec

HSTREAM BASSWMADEF(BASS_WMA_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);
HSTREAM BASSWMADEF(BASS_WMA_StreamCreateFileAuth)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags, const char *user, const char *pass);
@@ -123,32 +123,32 @@ void *BASSWMADEF(BASS_WMA_GetWMObject)(DWORD handle);

static inline HSTREAM BASS_WMA_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)
{
return BASS_WMA_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);
return BASS_WMA_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);
}

static inline HSTREAM BASS_WMA_StreamCreateFileAuth(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags, const char *user, const char *pass)
{
return BASS_WMA_StreamCreateFileAuth(mem, (const void*)file, offset, length, flags|BASS_UNICODE, (const char*)user, (const char*)pass);
return BASS_WMA_StreamCreateFileAuth(mem, (const void*)file, offset, length, flags|BASS_UNICODE, (const char*)user, (const char*)pass);
}

static inline const char *BASS_WMA_GetTags(const WCHAR *file, DWORD flags)
{
return BASS_WMA_GetTags((const char*)file, flags|BASS_UNICODE);
return BASS_WMA_GetTags((const char*)file, flags|BASS_UNICODE);
}

static inline HWMENCODE BASS_WMA_EncodeOpenFile(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, const WCHAR *file)
{
return BASS_WMA_EncodeOpenFile(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)file);
return BASS_WMA_EncodeOpenFile(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)file);
}

static inline HWMENCODE BASS_WMA_EncodeOpenPublish(DWORD freq, DWORD chans, DWORD flags, DWORD bitrate, const WCHAR *url, const WCHAR *user, const WCHAR *pass)
{
return BASS_WMA_EncodeOpenPublish(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)url, (const char*)user, (const char*)pass);
return BASS_WMA_EncodeOpenPublish(freq, chans, flags|BASS_UNICODE, bitrate, (const char*)url, (const char*)user, (const char*)pass);
}

static inline HWMENCODE BASS_WMA_EncodeOpenPublishMulti(DWORD freq, DWORD chans, DWORD flags, const DWORD *bitrates, const WCHAR *url, const WCHAR *user, const WCHAR *pass)
{
return BASS_WMA_EncodeOpenPublishMulti(freq, chans, flags|BASS_UNICODE, bitrates, (const char*)url, (const char*)user, (const char*)pass);
return BASS_WMA_EncodeOpenPublishMulti(freq, chans, flags|BASS_UNICODE, bitrates, (const char*)url, (const char*)user, (const char*)pass);
}
#endif

0 comments on commit 10ae3dd

Please sign in to comment.