Clean up debug messages a bit (lower case, no useless errors)

This commit is contained in:
def 2016-05-02 21:35:32 +02:00
parent a8ce73dffa
commit 61e47422f6
33 changed files with 237 additions and 333 deletions

View file

@ -413,7 +413,7 @@ int mem_check_imp()
MEMTAIL *tail = (MEMTAIL *)(((char*)(header+1))+header->size);
if(tail->guard != MEM_GUARD_VAL)
{
dbg_msg("mem", "Memory check failed at %s(%d): %d", header->filename, header->line, header->size);
dbg_msg("mem", "memory check failed at %s(%d): %d", header->filename, header->line, header->size);
return 0;
}
header = header->next;
@ -1707,7 +1707,7 @@ int fs_makedir_rec_for(const char *path)
char buffer[1024*2];
char *p;
str_copy(buffer, path, sizeof(buffer));
for(p = buffer; *p != '\0'; p++)
for(p = buffer+1; *p != '\0'; p++)
{
if(*p == '/' && *(p + 1) != '\0')
{

View file

@ -749,6 +749,7 @@ void CClient::Disconnect()
{
if(m_DummyConnected)
DummyDisconnect(0);
if(m_State != IClient::STATE_OFFLINE)
DisconnectWithReason(0);
}
@ -1283,7 +1284,7 @@ void CClient::ProcessConnlessPacket(CNetChunk *pPacket)
{
m_pMasterServer->SetCount(ServerID, ServerCount);
if(g_Config.m_Debug)
dbg_msg("MasterCount", "Server %d got %d servers", ServerID, ServerCount);
dbg_msg("mastercount", "server %d got %d servers", ServerID, ServerCount);
}
}
// server list from master server
@ -2444,7 +2445,7 @@ void CClient::Update()
FinishMapDownload();
else if(m_pMapdownloadTask->State() == CFetchTask::STATE_ERROR)
{
dbg_msg("webdl", "HTTP failed falling back to gameserver.");
dbg_msg("webdl", "http failed, falling back to gameserver");
ResetMapDownload();
SendMapRequest();
}

View file

@ -75,7 +75,7 @@ void CFetcher::Escape(char *pBuf, size_t size, const char *pStr)
void CFetcher::FetcherThread(void *pUser)
{
CFetcher *pFetcher = (CFetcher *)pUser;
dbg_msg("fetcher", "Thread started...");
dbg_msg("fetcher", "thread started...");
while(1)
{
lock_wait(pFetcher->m_Lock);
@ -85,7 +85,7 @@ void CFetcher::FetcherThread(void *pUser)
lock_unlock(pFetcher->m_Lock);
if(pTask)
{
dbg_msg("fetcher", "Task got %s:%s", pTask->m_aUrl, pTask->m_aDest);
dbg_msg("fetcher", "task got %s:%s", pTask->m_aUrl, pTask->m_aDest);
pFetcher->FetchFile(pTask);
if(pTask->m_pfnCompCallback)
pTask->m_pfnCompCallback(pTask, pTask->m_pUser);
@ -104,12 +104,12 @@ void CFetcher::FetchFile(CFetchTask *pTask)
m_pStorage->GetCompletePath(pTask->m_StorageType, pTask->m_aDest, aPath, sizeof(aPath));
if(fs_makedir_rec_for(aPath) < 0)
dbg_msg("fetcher", "I/O Error couldnt create folder for: %s", aPath);
dbg_msg("fetcher", "i/o error, cannot create folder for: %s", aPath);
IOHANDLE File = io_open(aPath, IOFLAG_WRITE);
if(!File){
dbg_msg("fetcher", "I/O Error cannot open file: %s", pTask->m_aDest);
dbg_msg("fetcher", "i/o error, cannot open file: %s", pTask->m_aDest);
pTask->m_State = CFetchTask::STATE_ERROR;
return;
}
@ -144,18 +144,18 @@ void CFetcher::FetchFile(CFetchTask *pTask)
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSDATA, pTask);
curl_easy_setopt(m_pHandle, CURLOPT_PROGRESSFUNCTION, &CFetcher::ProgressCallback);
dbg_msg("fetcher", "Downloading %s", pTask->m_aDest);
dbg_msg("fetcher", "downloading %s", pTask->m_aDest);
pTask->m_State = CFetchTask::STATE_RUNNING;
int ret = curl_easy_perform(m_pHandle);
io_close(File);
if(ret != CURLE_OK)
{
dbg_msg("fetcher", "Task failed. libcurl error: %s", aErr);
dbg_msg("fetcher", "task failed. libcurl error: %s", aErr);
pTask->m_State = (ret == CURLE_ABORTED_BY_CALLBACK) ? CFetchTask::STATE_ABORTED : CFetchTask::STATE_ERROR;
}
else
{
dbg_msg("fetcher", "Task done %s", pTask->m_aDest);
dbg_msg("fetcher", "task done %s", pTask->m_aDest);
pTask->m_State = CFetchTask::STATE_DONE;
}
}
@ -168,7 +168,6 @@ void CFetcher::WriteToFile(char *pData, size_t size, size_t nmemb, void *pFile)
int CFetcher::ProgressCallback(void *pUser, double DlTotal, double DlCurr, double UlTotal, double UlCurr)
{
CFetchTask *pTask = (CFetchTask *)pUser;
//dbg_msg("fetcher", "DlCurr:%f, DlTotal:%f", DlCurr, DlTotal);
pTask->m_Current = DlCurr;
pTask->m_Size = DlTotal;
pTask->m_Progress = (100 * DlCurr) / (DlTotal ? DlTotal : 1);

View file

@ -679,7 +679,7 @@ void CServerBrowser::Update(bool ForceResort)
m_pNetClient->Send(&Packet);
if(g_Config.m_Debug)
{
dbg_msg("client_srvbrowse", "Count-Request sent to %d", i);
dbg_msg("client_srvbrowse", "count-request sent to %d", i);
}
}
}
@ -724,7 +724,7 @@ void CServerBrowser::Update(bool ForceResort)
}
if(g_Config.m_Debug)
{
dbg_msg("client_srvbrowse", "ServerCount: %d, requesting server list", m_MasterServerCount);
dbg_msg("client_srvbrowse", "servercount: %d, requesting server list", m_MasterServerCount);
}
m_LastPacketTick = 0;
}
@ -917,7 +917,7 @@ void CServerBrowser::LoadDDNet()
if (pSrv->type != json_object || pTypes->type != json_object || pName->type != json_string || pFlagID->type != json_integer)
{
dbg_msg("client_srvbrowse", "Invalid attributes");
dbg_msg("client_srvbrowse", "invalid attributes");
continue;
}

View file

@ -116,7 +116,7 @@ void CUpdater::AddFileJob(const char *pFile, bool job)
void CUpdater::ReplaceClient()
{
dbg_msg("updater", "Replacing " PLAT_CLIENT_EXEC);
dbg_msg("updater", "replacing " PLAT_CLIENT_EXEC);
//Replace running executable by renaming twice...
if(!m_IsWinXP)
@ -131,13 +131,13 @@ void CUpdater::ReplaceClient()
char aBuf[512];
str_format(aBuf, sizeof aBuf, "chmod +x %s", aPath);
if (system(aBuf))
dbg_msg("updater", "Error setting client executable bit");
dbg_msg("updater", "ERROR: failed to set client executable bit");
#endif
}
void CUpdater::ReplaceServer()
{
dbg_msg("updater", "Replacing " PLAT_SERVER_EXEC);
dbg_msg("updater", "replacing " PLAT_SERVER_EXEC);
//Replace running executable by renaming twice...
m_pStorage->RemoveBinaryFile("DDNet-Server.old");
@ -149,7 +149,7 @@ void CUpdater::ReplaceServer()
char aBuf[512];
str_format(aBuf, sizeof aBuf, "chmod +x %s", aPath);
if (system(aBuf))
dbg_msg("updater", "Error setting server executable bit");
dbg_msg("updater", "ERROR: failed to set server executable bit");
#endif
}
@ -205,7 +205,7 @@ void CUpdater::InitiateUpdate()
void CUpdater::PerformUpdate()
{
m_State = PARSING_UPDATE;
dbg_msg("updater", "Parsing update.json");
dbg_msg("updater", "parsing update.json");
ParseUpdate();
m_State = DOWNLOADING;

View file

@ -90,7 +90,7 @@ public:
virtual void ExecuteLine(const char *Sptr, int ClientID = -1) = 0;
virtual void ExecuteLineFlag(const char *Sptr, int FlasgMask, int ClientID = -1) = 0;
virtual void ExecuteLineStroked(int Stroke, const char *pStr, int ClientID = -1) = 0;
virtual void ExecuteFile(const char *pFilename, int ClientID = -1) = 0;
virtual void ExecuteFile(const char *pFilename, int ClientID = -1, bool LogFailure = false) = 0;
virtual int RegisterPrintCallback(int OutputLevel, FPrintCallback pfnPrintCallback, void *pUserData) = 0;
virtual void SetPrintOutputLevel(int Index, int OutputLevel) = 0;

View file

@ -482,7 +482,7 @@ void CConsole::ExecuteLineFlag(const char *pStr, int FlagMask, int ClientID)
}
void CConsole::ExecuteFile(const char *pFilename, int ClientID)
void CConsole::ExecuteFile(const char *pFilename, int ClientID, bool LogFailure)
{
// make sure that this isn't being executed already
for(CExecFile *pCur = m_pFirstExec; pCur; pCur = pCur->m_pPrev)
@ -519,7 +519,7 @@ void CConsole::ExecuteFile(const char *pFilename, int ClientID)
io_close(File);
}
else
else if(LogFailure)
{
str_format(aBuf, sizeof(aBuf), "failed to open '%s'", pFilename);
Print(IConsole::OUTPUT_LEVEL_STANDARD, "console", aBuf);
@ -535,7 +535,7 @@ void CConsole::Con_Echo(IResult *pResult, void *pUserData)
void CConsole::Con_Exec(IResult *pResult, void *pUserData)
{
((CConsole*)pUserData)->ExecuteFile(pResult->GetString(0));
((CConsole*)pUserData)->ExecuteFile(pResult->GetString(0), -1, true);
}
void CConsole::ConCommandAccess(IResult *pResult, void *pUser)
@ -829,7 +829,7 @@ void CConsole::ParseArguments(int NumArgs, const char **ppArguments)
if(ppArguments[i][0] == '-' && ppArguments[i][1] == 'f' && ppArguments[i][2] == 0)
{
if(NumArgs - i > 1)
ExecuteFile(ppArguments[i+1]);
ExecuteFile(ppArguments[i+1], -1, true);
i++;
}
else if(!str_comp("-s", ppArguments[i]) || !str_comp("--silent", ppArguments[i]))

View file

@ -59,7 +59,6 @@ class CConsole : public IConsole
static void ConCommandAccess(IResult *pResult, void *pUser);
static void ConCommandStatus(IConsole::IResult *pResult, void *pUser);
void ExecuteFileRecurse(const char *pFilename);
void ExecuteLineStroked(int Stroke, const char *pStr, int ClientID = -1);
struct
@ -196,7 +195,7 @@ public:
virtual bool LineIsValid(const char *pStr);
virtual void ExecuteLine(const char *pStr, int ClientID = -1);
virtual void ExecuteLineFlag(const char *pStr, int FlagMask, int ClientID = -1);
virtual void ExecuteFile(const char *pFilename, int ClientID = -1);
virtual void ExecuteFile(const char *pFilename, int ClientID = -1, bool LogFailure = false);
virtual int RegisterPrintCallback(int OutputLevel, FPrintCallback pfnPrintCallback, void *pUserData);
virtual void SetPrintOutputLevel(int Index, int OutputLevel);

View file

@ -48,7 +48,7 @@ void FifoConsole::ListenFifoThread(void *pUser)
if(!gs_FifoLock)
{
dbg_msg("fifo", "FIFO not properly initialized");
dbg_msg("fifo", "fifo not properly initialized");
exit(2);
}
@ -63,14 +63,14 @@ void FifoConsole::ListenFifoThread(void *pUser)
if(!S_ISFIFO(attribute.st_mode))
{
dbg_msg("fifo", "'%s' is not a FIFO, removing", pData->m_pFifoFile);
dbg_msg("fifo", "'%s' is not a fifo, removing", pData->m_pFifoFile);
fs_remove(pData->m_pFifoFile);
mkfifo(pData->m_pFifoFile, 0600);
stat(pData->m_pFifoFile, &attribute);
if(!S_ISFIFO(attribute.st_mode))
{
dbg_msg("fifo", "Can't remove file, quitting");
dbg_msg("fifo", "can't remove file, quitting");
exit(2);
}
}

View file

@ -248,7 +248,7 @@ int CNetServer::TryAcceptClient(NETADDR &Addr, SECURITY_TOKEN SecurityToken, boo
{
char aAddrStr[NETADDR_MAXSTRSIZE];
net_addr_str(&Addr, aAddrStr, sizeof(aAddrStr), true);
dbg_msg("security", "Client accepted %s", aAddrStr);
dbg_msg("security", "client accepted %s", aAddrStr);
}

View file

@ -413,7 +413,7 @@ public:
GetBinaryPath(pNewFilename, aNewBuffer, sizeof(aNewBuffer));
if(fs_makedir_rec_for(aNewBuffer) < 0)
dbg_msg("storage", "I/O Error couldnt create folder for: %s", aNewBuffer);
dbg_msg("storage", "cannot create folder for: %s", aNewBuffer);
return !fs_rename(aOldBuffer, aNewBuffer);
}

View file

@ -1,4 +1,5 @@
#include <base/system.h>
#include <iostream>
#include <engine/shared/config.h>
#include <engine/map.h>
@ -38,8 +39,7 @@ void CBackground::OnInit()
m_pImages->m_pClient = GameClient();
m_pLayers->m_pClient = GameClient();
Kernel()->ReregisterInterface(static_cast<IEngineMap*>(m_pMap));
str_format(m_aMapName, sizeof(m_aMapName), "%s", g_Config.m_ClBackgroundEntities);
if(str_comp(g_Config.m_ClBackgroundEntities, CURRENT))
if(g_Config.m_ClBackgroundEntities[0] != '\0' && str_comp(g_Config.m_ClBackgroundEntities, CURRENT))
LoadBackground();
}
@ -48,6 +48,7 @@ void CBackground::LoadBackground()
if(time_get()-m_LastLoad < 10*time_freq())
return;
std::cout << "here" << std::endl;
if(m_Loaded && m_pMap == m_pBackgroundMap)
m_pMap->Unload();
@ -56,7 +57,7 @@ void CBackground::LoadBackground()
m_pLayers->m_pLayers = m_pBackgroundLayers;
m_pImages = m_pBackgroundImages;
str_format(m_aMapName, sizeof(m_aMapName), "%s", g_Config.m_ClBackgroundEntities);
str_copy(m_aMapName, g_Config.m_ClBackgroundEntities, sizeof(m_aMapName));
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "maps/%s", g_Config.m_ClBackgroundEntities);
if(m_pMap->Load(aBuf))
@ -87,7 +88,7 @@ void CBackground::OnMapLoad()
void CBackground::OnRender()
{
//probably not the best place for this
if(str_comp(g_Config.m_ClBackgroundEntities, m_aMapName))
if(g_Config.m_ClBackgroundEntities[0] != '\0' && str_comp(g_Config.m_ClBackgroundEntities, m_aMapName))
LoadBackground();
if(!m_Loaded)
@ -112,9 +113,9 @@ void CBackground::OnRender()
if(!pGroup)
{
dbg_msg("MapLayers", "Error:Group was null, Group Number = %d, Total Groups = %d", g, m_pLayers->m_pLayers->NumGroups());
dbg_msg("MapLayers", "This is here to prevent a crash but the source of this is unknown, please report this for it to get fixed");
dbg_msg("MapLayers", "we need mapname and crc and the map that caused this if possible, and anymore info you think is relevant");
dbg_msg("background", "error group was null, group number = %d, total groups = %d", g, m_pLayers->m_pLayers->NumGroups());
dbg_msg("background", "this is here to prevent a crash but the source of this is unknown, please report this for it to get fixed");
dbg_msg("background", "we need mapname and crc and the map that caused this if possible, and anymore info you think is relevant");
continue;
}

View file

@ -2,6 +2,7 @@
#define GAME_CLIENT_COMPONENTS_BACKGROUND_H
#include <game/client/component.h>
// Special value to use background of current map
#define CURRENT "%current%"
class CBackground : public CComponent

View file

@ -378,10 +378,6 @@ void CControls::OnRender()
m_InputDirectionRight[g_Config.m_ClDummy] = 0;
}
//dbg_msg("dbg", "RunPressed %d m_JoystickSwipeJumpClear %lld m_JoystickSwipeJumpY %d RunY %d cond %d",
// RunPressed, m_JoystickSwipeJumpClear, (int)m_JoystickSwipeJumpY, RunY,
// (int)((!m_JoystickSwipeJumpY && RunY > SWIPE_JUMP_THRESHOLD) || (m_JoystickSwipeJumpY && RunY < -SWIPE_JUMP_THRESHOLD)));
if( HookPressed )
{
m_MousePos[g_Config.m_ClDummy] = vec2(HookX / 30, HookY / 30);

View file

@ -49,7 +49,7 @@ void CGhost::AddInfos(CGhostCharacter Player)
// Just to be sure it doesnt eat too much memory, the first test should be enough anyway
if(m_CurGhost.m_Path.size() > Client()->GameTickSpeed()*60*20)
{
dbg_msg("ghost", "20 minutes elapsed. Stopping ghost record");
dbg_msg("ghost", "20 minutes elapsed. stopping ghost record");
StopRecord();
m_CurGhost.m_Path.clear();
return;
@ -396,7 +396,7 @@ void CGhost::Save()
m_pClient->m_pMenus->m_lGhosts.add(Item);
m_pClient->m_pMenus->m_OwnGhost = &find_linear(m_pClient->m_pMenus->m_lGhosts.all(), Item).front();
dbg_msg("ghost", "Saved better ghost");
dbg_msg("ghost", "saved better ghost");
m_Saving = false;
}

View file

@ -134,9 +134,9 @@ void CMapLayers::OnRender()
if(!pGroup)
{
dbg_msg("MapLayers", "Error:Group was null, Group Number = %d, Total Groups = %d", g, m_pLayers->NumGroups());
dbg_msg("MapLayers", "This is here to prevent a crash but the source of this is unknown, please report this for it to get fixed");
dbg_msg("MapLayers", "we need mapname and crc and the map that caused this if possible, and anymore info you think is relevant");
dbg_msg("maplayers", "error group was null, group number = %d, total groups = %d", g, m_pLayers->NumGroups());
dbg_msg("maplayers", "this is here to prevent a crash but the source of this is unknown, please report this for it to get fixed");
dbg_msg("maplayers", "we need mapname and crc and the map that caused this if possible, and anymore info you think is relevant");
continue;
}

View file

@ -210,5 +210,5 @@ void CRaceDemo::SaveDemo(const char* pDemo)
Storage()->RenameFile(aOldFilename, aNewFilename, IStorage::TYPE_SAVE);
dbg_msg("racedemo", "Saved better demo");
dbg_msg("racedemo", "saved better demo");
}

View file

@ -79,7 +79,6 @@ void CUI::AndroidShowScreenKeys(bool shown)
static SDL_Rect ButtonHidden = { 0, 0, 0, 0 };
if( !ScreenKeyboardInitialized )
{
//dbg_msg("dbg", "CUI::AndroidShowScreenKeys: ScreenKeyboardInitialized");
ScreenKeyboardInitialized = true;
for( int i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++ )
@ -158,7 +157,6 @@ void CUI::AndroidShowScreenKeys(bool shown)
if( ScreenKeyboardShown == shown )
return;
ScreenKeyboardShown = shown;
//dbg_msg("dbg", "CUI::AndroidShowScreenKeys: shown %d", shown);
for( int i = 0; i < SDL_ANDROID_SCREENKEYBOARD_BUTTON_NUM; i++ )
SDL_ANDROID_SetScreenKeyboardButtonPos( i, shown ? &Buttons[i] : &ButtonHidden );
#endif

View file

@ -588,7 +588,6 @@ void CCollision::GetSpeedup(int Index, vec2 *Dir, int *Force, int *MaxSpeed)
int CCollision::IsSwitch(int Index)
{
//dbg_msg("IsSwitch","Index %d, pSwitch %d, m_Type %d, m_Number %d", Index, m_pSwitch, (m_pSwitch)?m_pSwitch[Index].m_Type:0, (m_pSwitch)?m_pSwitch[Index].m_Number:0);
if(Index < 0 || !m_pSwitch)
return 0;
@ -600,7 +599,6 @@ int CCollision::IsSwitch(int Index)
int CCollision::GetSwitchNumber(int Index)
{
//dbg_msg("GetSwitchNumber","Index %d, pSwitch %d, m_Type %d, m_Number %d", Index, m_pSwitch, (m_pSwitch)?m_pSwitch[Index].m_Type:0, (m_pSwitch)?m_pSwitch[Index].m_Number:0);
if(Index < 0 || !m_pSwitch)
return 0;
@ -612,7 +610,6 @@ int CCollision::GetSwitchNumber(int Index)
int CCollision::GetSwitchDelay(int Index)
{
//dbg_msg("GetSwitchNumber","Index %d, pSwitch %d, m_Type %d, m_Number %d", Index, m_pSwitch, (m_pSwitch)?m_pSwitch[Index].m_Type:0, (m_pSwitch)?m_pSwitch[Index].m_Number:0);
if(Index < 0 || !m_pSwitch)
return 0;
@ -745,9 +742,6 @@ int CCollision::GetMapIndex(vec2 Pos)
int Nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
int Ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
int Index = Ny*m_Width+Nx;
/*if (m_pTele && (m_pTele[Index].m_Type == TILE_TELEIN)) dbg_msg("m_pTele && TELEIN","Index %d",Index);
else if (m_pTele && m_pTele[Index].m_Type==TILE_TELEOUT) dbg_msg("TELEOUT","Index %d",Index);
else dbg_msg("GetMapIndex(","Index %d",Index);//REMOVE */
if(TileExists(Index))
return Index;
@ -765,9 +759,6 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, unsigned MaxInd
int Nx = clamp((int)Pos.x / 32, 0, m_Width - 1);
int Ny = clamp((int)Pos.y / 32, 0, m_Height - 1);
int Index = Ny * m_Width + Nx;
/*if (m_pTele && (m_pTele[Index].m_Type == TILE_TELEIN)) dbg_msg("m_pTele && TELEIN","Index %d",Index);
else if (m_pTele && m_pTele[Index].m_Type==TILE_TELEOUT) dbg_msg("TELEOUT","Index %d",Index);
else dbg_msg("GetMapIndex(","Index %d",Index);//REMOVE */
if(TileExists(Index))
{
@ -791,15 +782,12 @@ std::list<int> CCollision::GetMapIndices(vec2 PrevPos, vec2 Pos, unsigned MaxInd
Nx = clamp((int)Tmp.x / 32, 0, m_Width - 1);
Ny = clamp((int)Tmp.y / 32, 0, m_Height - 1);
Index = Ny * m_Width + Nx;
//dbg_msg("lastindex","%d",LastIndex);
//dbg_msg("index","%d",Index);
if(TileExists(Index) && LastIndex != Index)
{
if(MaxIndices && Indices.size() > MaxIndices)
return Indices;
Indices.push_back(Index);
LastIndex = Index;
//dbg_msg("pushed","%d",Index);
}
}
@ -819,7 +807,6 @@ vec2 CCollision::GetPos(int Index)
int CCollision::GetTileIndex(int Index)
{
/*dbg_msg("GetTileIndex","m_pTiles[%d].m_Index = %d",Index,m_pTiles[Index].m_Index);//Remove*/
if(Index < 0)
return 0;
return m_pTiles[Index].m_Index;
@ -827,8 +814,6 @@ int CCollision::GetTileIndex(int Index)
int CCollision::GetFTileIndex(int Index)
{
/*dbg_msg("GetFTileIndex","m_pFront[%d].m_Index = %d",Index,m_pFront[Index].m_Index);//Remove*/
if(Index < 0 || !m_pFront)
return 0;
return m_pFront[Index].m_Index;
@ -836,7 +821,6 @@ int CCollision::GetFTileIndex(int Index)
int CCollision::GetTileFlags(int Index)
{
/*dbg_msg("GetTileIndex","m_pTiles[%d].m_Index = %d",Index,m_pTiles[Index].m_Index);//Remove*/
if(Index < 0)
return 0;
return m_pTiles[Index].m_Flags;
@ -844,8 +828,6 @@ int CCollision::GetTileFlags(int Index)
int CCollision::GetFTileFlags(int Index)
{
/*dbg_msg("GetFTileIndex","m_pFront[%d].m_Index = %d",Index,m_pFront[Index].m_Index);//Remove*/
if(Index < 0 || !m_pFront)
return 0;
return m_pFront[Index].m_Flags;
@ -905,7 +887,6 @@ int CCollision::GetFTile(int x, int y)
return 0;
int Nx = clamp(x/32, 0, m_Width-1);
int Ny = clamp(y/32, 0, m_Height-1);
/*dbg_msg("GetFTile","m_Index %d",m_pFront[Ny*m_Width+Nx].m_Index);//Remove */
if(m_pFront[Ny*m_Width+Nx].m_Index == TILE_DEATH
|| m_pFront[Ny*m_Width+Nx].m_Index == TILE_NOLASER)
return m_pFront[Ny*m_Width+Nx].m_Index;
@ -941,7 +922,7 @@ int CCollision::Entity(int x, int y, int Layer)
default:
str_format(aBuf,sizeof(aBuf), "Unknown");
}
dbg_msg("CCollision::Entity","Something is VERY wrong with the %s layer please report this at https://github.com/ddnet/ddnet, you will need to post the map as well and any steps that u think may have led to this", aBuf);
dbg_msg("collision","something is VERY wrong with the %s layer please report this at https://github.com/ddnet/ddnet, you will need to post the map as well and any steps that u think may have led to this", aBuf);
return 0;
}
switch (Layer)

View file

@ -111,7 +111,6 @@ void CCharacterCore::Tick(bool UseInput, bool IsClient)
int MapIndexR = Collision()->GetPureMapIndex(vec2(m_Pos.x - (28/2)-4,m_Pos.y));
int MapIndexT = Collision()->GetPureMapIndex(vec2(m_Pos.x,m_Pos.y + (28/2)+4));
int MapIndexB = Collision()->GetPureMapIndex(vec2(m_Pos.x,m_Pos.y - (28/2)-4));
//dbg_msg("","N%d L%d R%d B%d T%d",MapIndex,MapIndexL,MapIndexR,MapIndexB,MapIndexT);
m_TileIndex = Collision()->GetTileIndex(MapIndex);
m_TileFlags = Collision()->GetTileFlags(MapIndex);
m_TileIndexL = Collision()->GetTileIndex(MapIndexL);
@ -486,7 +485,6 @@ void CCharacterCore::Tick(bool UseInput, bool IsClient)
else
{
if(MaxSpeed > 0 && MaxSpeed < 5) MaxSpeed = 5;
//dbg_msg("speedup tile start","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
if(MaxSpeed > 0)
{
if(Direction.x > 0.0000001f)
@ -517,7 +515,6 @@ void CCharacterCore::Tick(bool UseInput, bool IsClient)
DiffAngle = SpeederAngle - TeeAngle;
SpeedLeft = MaxSpeed / 5.0f - cos(DiffAngle) * TeeSpeed;
//dbg_msg("speedup tile debug","MaxSpeed %i, TeeSpeed %f, SpeedLeft %f, SpeederAngle %f, TeeAngle %f", MaxSpeed, TeeSpeed, SpeedLeft, SpeederAngle, TeeAngle);
if(abs((int)SpeedLeft) > Force && SpeedLeft > 0.0000001f)
TempVel += Direction * Force;
else if(abs((int)SpeedLeft) > Force)
@ -540,8 +537,6 @@ void CCharacterCore::Tick(bool UseInput, bool IsClient)
m_Vel = TempVel;
//dbg_msg("speedup tile end","(Direction*Force) %f %f m_Vel%f %f",(Direction*Force).x,(Direction*Force).y,m_Vel.x,m_Vel.y);
//dbg_msg("speedup tile end","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
}
}

View file

@ -1267,7 +1267,6 @@ void CCharacter::HandleSkippableTiles(int Index)
else
{
if(MaxSpeed > 0 && MaxSpeed < 5) MaxSpeed = 5;
//dbg_msg("speedup tile start","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
if(MaxSpeed > 0)
{
if(Direction.x > 0.0000001f)
@ -1298,7 +1297,6 @@ void CCharacter::HandleSkippableTiles(int Index)
DiffAngle = SpeederAngle - TeeAngle;
SpeedLeft = MaxSpeed / 5.0f - cos(DiffAngle) * TeeSpeed;
//dbg_msg("speedup tile debug","MaxSpeed %i, TeeSpeed %f, SpeedLeft %f, SpeederAngle %f, TeeAngle %f", MaxSpeed, TeeSpeed, SpeedLeft, SpeederAngle, TeeAngle);
if(abs((int)SpeedLeft) > Force && SpeedLeft > 0.0000001f)
TempVel += Direction * Force;
else if(abs((int)SpeedLeft) > Force)
@ -1318,8 +1316,6 @@ void CCharacter::HandleSkippableTiles(int Index)
if(TempVel.y > 0 && ((m_TileIndex == TILE_STOP && m_TileFlags == ROTATION_0) || (m_TileIndexT == TILE_STOP && m_TileFlagsT == ROTATION_0) || (m_TileIndexT == TILE_STOPS && (m_TileFlagsT == ROTATION_0 || m_TileFlagsT == ROTATION_180)) || (m_TileIndexT == TILE_STOPA) || (m_TileFIndex == TILE_STOP && m_TileFFlags == ROTATION_0) || (m_TileFIndexT == TILE_STOP && m_TileFFlagsT == ROTATION_0) || (m_TileFIndexT == TILE_STOPS && (m_TileFFlagsT == ROTATION_0 || m_TileFFlagsT == ROTATION_180)) || (m_TileFIndexT == TILE_STOPA) || (m_TileSIndex == TILE_STOP && m_TileSFlags == ROTATION_0) || (m_TileSIndexT == TILE_STOP && m_TileSFlagsT == ROTATION_0) || (m_TileSIndexT == TILE_STOPS && (m_TileSFlagsT == ROTATION_0 || m_TileSFlagsT == ROTATION_180)) || (m_TileSIndexT == TILE_STOPA)))
TempVel.y = 0;
m_Core.m_Vel = TempVel;
//dbg_msg("speedup tile end","(Direction*Force) %f %f m_Core.m_Vel%f %f",(Direction*Force).x,(Direction*Force).y,m_Core.m_Vel.x,m_Core.m_Vel.y);
//dbg_msg("speedup tile end","Direction %f %f, Force %d, Max Speed %d", (Direction).x,(Direction).y, Force, MaxSpeed);
}
}
}
@ -1334,7 +1330,6 @@ void CCharacter::HandleTiles(int Index)
int MapIndexR = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x - (m_ProximityRadius / 2) - Offset, m_Pos.y));
int MapIndexT = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x, m_Pos.y + (m_ProximityRadius / 2) + Offset));
int MapIndexB = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x, m_Pos.y - (m_ProximityRadius / 2) - Offset));
//dbg_msg("","N%d L%d R%d B%d T%d",MapIndex,MapIndexL,MapIndexR,MapIndexB,MapIndexT);
m_TileIndex = GameServer()->Collision()->GetTileIndex(MapIndex);
m_TileFlags = GameServer()->Collision()->GetTileFlags(MapIndex);
m_TileIndexL = GameServer()->Collision()->GetTileIndex(MapIndexL);
@ -1365,7 +1360,6 @@ void CCharacter::HandleTiles(int Index)
m_TileSFlagsB = (GameServer()->Collision()->m_pSwitchers && GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetDTileNumber(MapIndexB)].m_Status[Team()])?(Team() != TEAM_SUPER)? GameServer()->Collision()->GetDTileFlags(MapIndexB) : 0 : 0;
m_TileSIndexT = (GameServer()->Collision()->m_pSwitchers && GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetDTileNumber(MapIndexT)].m_Status[Team()])?(Team() != TEAM_SUPER)? GameServer()->Collision()->GetDTileIndex(MapIndexT) : 0 : 0;
m_TileSFlagsT = (GameServer()->Collision()->m_pSwitchers && GameServer()->Collision()->m_pSwitchers[GameServer()->Collision()->GetDTileNumber(MapIndexT)].m_Status[Team()])?(Team() != TEAM_SUPER)? GameServer()->Collision()->GetDTileFlags(MapIndexT) : 0 : 0;
//dbg_msg("Tiles","%d, %d, %d, %d, %d", m_TileSIndex, m_TileSIndexL, m_TileSIndexR, m_TileSIndexB, m_TileSIndexT);
//Sensitivity
int S1 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x + m_ProximityRadius / 3.f, m_Pos.y - m_ProximityRadius / 3.f));
int S2 = GameServer()->Collision()->GetPureMapIndex(vec2(m_Pos.x + m_ProximityRadius / 3.f, m_Pos.y + m_ProximityRadius / 3.f));
@ -1379,8 +1373,6 @@ void CCharacter::HandleTiles(int Index)
int FTile2 = GameServer()->Collision()->GetFTileIndex(S2);
int FTile3 = GameServer()->Collision()->GetFTileIndex(S3);
int FTile4 = GameServer()->Collision()->GetFTileIndex(S4);
//dbg_msg("","N%d L%d R%d B%d T%d",m_TileIndex,m_TileIndexL,m_TileIndexR,m_TileIndexB,m_TileIndexT);
//dbg_msg("","N%d L%d R%d B%d T%d",m_TileFIndex,m_TileFIndexL,m_TileFIndexR,m_TileFIndexB,m_TileFIndexT);
if(Index < 0)
{
m_LastRefillJumps = false;
@ -1651,7 +1643,6 @@ void CCharacter::HandleTiles(int Index)
}
if(((m_TileIndex == TILE_STOP && m_TileFlags == ROTATION_0) || (m_TileIndexT == TILE_STOP && m_TileFlagsT == ROTATION_0) || (m_TileIndexT == TILE_STOPS && (m_TileFlagsT == ROTATION_0 || m_TileFlagsT == ROTATION_180)) || (m_TileIndexT == TILE_STOPA) || (m_TileFIndex == TILE_STOP && m_TileFFlags == ROTATION_0) || (m_TileFIndexT == TILE_STOP && m_TileFFlagsT == ROTATION_0) || (m_TileFIndexT == TILE_STOPS && (m_TileFFlagsT == ROTATION_0 || m_TileFFlagsT == ROTATION_180)) || (m_TileFIndexT == TILE_STOPA) || (m_TileSIndex == TILE_STOP && m_TileSFlags == ROTATION_0) || (m_TileSIndexT == TILE_STOP && m_TileSFlagsT == ROTATION_0) || (m_TileSIndexT == TILE_STOPS && (m_TileSFlagsT == ROTATION_0 || m_TileSFlagsT == ROTATION_180)) || (m_TileSIndexT == TILE_STOPA)) && m_Core.m_Vel.y > 0)
{
//dbg_msg("","%f %f",GameServer()->Collision()->GetPos(MapIndex).y,m_Core.m_Pos.y);
if((int)GameServer()->Collision()->GetPos(MapIndexT).y)
if((int)GameServer()->Collision()->GetPos(MapIndexT).y < (int)m_Core.m_Pos.y)
m_Core.m_Pos = m_PrevPos;
@ -2071,14 +2062,10 @@ void CCharacter::DDRacePostCoreTick()
std::list < int > Indices = GameServer()->Collision()->GetMapIndices(m_PrevPos, m_Pos);
if(!Indices.empty())
for(std::list < int >::iterator i = Indices.begin(); i != Indices.end(); i++)
{
HandleTiles(*i);
//dbg_msg("Running","%d", *i);
}
else
{
HandleTiles(CurrentIndex);
//dbg_msg("Running","%d", CurrentIndex);
}
HandleBroadcast();

View file

@ -1493,9 +1493,7 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
else if(pPlayer->m_ClientVersion < Version)
pPlayer->m_ClientVersion = Version;
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "%d using Custom Client %d", ClientID, pPlayer->m_ClientVersion);
dbg_msg("DDNet", aBuf);
dbg_msg("ddnet", "%d using Custom Client %d", ClientID, pPlayer->m_ClientVersion);
//first update his teams state
((CGameControllerDDRace*)m_pController)->m_Teams.SendTeamsState(ClientID);
@ -2413,7 +2411,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
Collision()->m_pSwitchers[i].m_Initial = true;
}
Console()->ExecuteFile(g_Config.m_SvResetFile);
Console()->ExecuteFile(g_Config.m_SvResetFile, -1);
LoadMapSettings();
@ -2479,27 +2477,27 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
if(Index == TILE_OLDLASER)
{
g_Config.m_SvOldLaser = 1;
dbg_msg("Game Layer", "Found Old Laser Tile");
dbg_msg("game layer", "found old laser tile");
}
else if(Index == TILE_NPC)
{
m_Tuning.Set("player_collision", 0);
dbg_msg("Game Layer", "Found No Collision Tile");
dbg_msg("game layer", "found no collision tile");
}
else if(Index == TILE_EHOOK)
{
g_Config.m_SvEndlessDrag = 1;
dbg_msg("Game Layer", "Found No Unlimited hook time Tile");
dbg_msg("game layer", "found no unlimited hook time tile");
}
else if(Index == TILE_NOHIT)
{
g_Config.m_SvHit = 0;
dbg_msg("Game Layer", "Found No Weapons Hitting others Tile");
dbg_msg("game layer", "found no weapons hitting others tile");
}
else if(Index == TILE_NPH)
{
m_Tuning.Set("player_hooking", 0);
dbg_msg("Game Layer", "Found No Player Hooking Tile");
dbg_msg("game layer", "found no player hooking tile");
}
if(Index >= ENTITY_OFFSET)
@ -2515,27 +2513,27 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
if(Index == TILE_OLDLASER)
{
g_Config.m_SvOldLaser = 1;
dbg_msg("Front Layer", "Found Old Laser Tile");
dbg_msg("front layer", "found old laser tile");
}
else if(Index == TILE_NPC)
{
m_Tuning.Set("player_collision", 0);
dbg_msg("Front Layer", "Found No Collision Tile");
dbg_msg("front layer", "found no collision tile");
}
else if(Index == TILE_EHOOK)
{
g_Config.m_SvEndlessDrag = 1;
dbg_msg("Front Layer", "Found No Unlimited hook time Tile");
dbg_msg("front layer", "found no unlimited hook time tile");
}
else if(Index == TILE_NOHIT)
{
g_Config.m_SvHit = 0;
dbg_msg("Front Layer", "Found No Weapons Hitting others Tile");
dbg_msg("front layer", "found no weapons hitting others tile");
}
else if(Index == TILE_NPH)
{
m_Tuning.Set("player_hooking", 0);
dbg_msg("Front Layer", "Found No Player Hooking Tile");
dbg_msg("front layer", "found no player hooking tile");
}
if(Index >= ENTITY_OFFSET)
{

View file

@ -184,10 +184,8 @@ int CSaveTee::LoadString(char* String)
return 0;
else
{
dbg_msg("Load", "failed to load Tee-string");
char aBuf[32];
str_format(aBuf, sizeof(aBuf), "loaded %d vars", Num);
dbg_msg("Load", aBuf);
dbg_msg("load", "failed to load tee-string");
dbg_msg("load", "loaded %d vars", Num);
return Num+1; // never 0 here
}
}
@ -385,7 +383,7 @@ int CSaveTeam::LoadString(const char* String)
if(StrSize <= 0)
{
dbg_msg("Load", "Savegame: wrong format (couldn't load TeamStats)");
dbg_msg("load", "savegame: wrong format (couldn't load teamstats)");
return 1;
}
@ -395,15 +393,13 @@ int CSaveTeam::LoadString(const char* String)
int Num = sscanf(TeamStats, "%d\t%d\t%d\t%d", &m_TeamState, &m_MembersCount, &m_NumSwitchers, &m_TeamLocked);
if(Num != 4)
{
dbg_msg("Load", "failed to load Teamstats");
char aBuf[32];
str_format(aBuf, sizeof(aBuf), "loaded %d vars", Num);
dbg_msg("Load", aBuf);
dbg_msg("load", "failed to load teamstats");
dbg_msg("load", "loaded %d vars", Num);
}
}
else
{
dbg_msg("Load", "Savegame: wrong format (couldn't load TeamStats, too big)");
dbg_msg("load", "savegame: wrong format (couldn't load teamstats, too big)");
return 1;
}
@ -431,7 +427,7 @@ int CSaveTeam::LoadString(const char* String)
if(StrSize <= 0)
{
dbg_msg("Load", "Savegame: wrong format (couldn't load Tee)");
dbg_msg("load", "savegame: wrong format (couldn't load tee)");
return 1;
}
@ -441,16 +437,14 @@ int CSaveTeam::LoadString(const char* String)
int Num = SavedTees[n].LoadString(SaveTee);
if(Num)
{
dbg_msg("Load", "failed to load Tee");
char aBuf[32];
str_format(aBuf, sizeof(aBuf), "loaded %d vars", Num-1);
dbg_msg("Load", aBuf);
dbg_msg("load", "failed to load tee");
dbg_msg("load", "loaded %d vars", Num-1);
return 1;
}
}
else
{
dbg_msg("Load", "Savegame: wrong format (couldn't load Tee, too big)");
dbg_msg("load", "savegame: wrong format (couldn't load tee, too big)");
return 1;
}
}
@ -479,7 +473,7 @@ int CSaveTeam::LoadString(const char* String)
if(StrSize <= 0)
{
dbg_msg("Load", "Savegame: wrong format (couldn't load Switcher)");
dbg_msg("load", "savegame: wrong format (couldn't load switcher)");
return 1;
}
@ -489,15 +483,13 @@ int CSaveTeam::LoadString(const char* String)
int Num = sscanf(Switcher, "%d\t%d\t%d", &(m_Switchers[n].m_Status), &(m_Switchers[n].m_EndTime), &(m_Switchers[n].m_Type));
if(Num != 3)
{
dbg_msg("Load", "failed to load Switcher");
char aBuf[32];
str_format(aBuf, sizeof(aBuf), "loaded %d vars", Num-1);
dbg_msg("Load", aBuf);
dbg_msg("load", "failed to load switcher");
dbg_msg("load", "loaded %d vars", Num-1);
}
}
else
{
dbg_msg("Load", "Savegame: wrong format (couldn't load Switcher, too big)");
dbg_msg("load", "savegame: wrong format (couldn't load switcher, too big)");
return 1;
}
}

View file

@ -224,7 +224,7 @@ void CFileScore::LoadScore(int ClientID)
void CFileScore::SaveTeamScore(int* ClientIDs, unsigned int Size, float Time)
{
dbg_msg("FileScore", "SaveTeamScore not implemented for FileScore");
dbg_msg("filescore", "saveteamscore not implemented for filescore");
}
void CFileScore::SaveScore(int ClientID, float Time,

View file

@ -43,11 +43,11 @@ CSqlScore::~CSqlScore()
{
delete m_pStatement;
delete m_pConnection;
dbg_msg("SQL", "SQL connection disconnected");
dbg_msg("sql", "sql connection disconnected");
}
catch (sql::SQLException &e)
{
dbg_msg("SQL", "ERROR: No SQL connection");
dbg_msg("sql", "ERROR: no sql connection");
}
}
@ -62,11 +62,8 @@ bool CSqlScore::Connect()
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: SQL connection failed");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: sql connection failed");
return false;
}
return true;
@ -103,52 +100,49 @@ bool CSqlScore::Connect()
// Connect to specific database
m_pConnection->setSchema(m_pDatabase);
dbg_msg("SQL", "SQL connection established");
dbg_msg("sql", "sql connection established");
return true;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: SQL connection failed");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: sql connection failed");
return false;
}
catch (const std::exception& ex)
{
// ...
dbg_msg("SQL", "1 %s",ex.what());
dbg_msg("sql", "1 %s",ex.what());
}
catch (const std::string& ex)
{
// ...
dbg_msg("SQL", "2 %s",ex.c_str());
dbg_msg("sql", "2 %s",ex.c_str());
}
catch( int )
{
dbg_msg("SQL", "3 %s");
dbg_msg("sql", "3 %s");
}
catch( float )
{
dbg_msg("SQL", "4 %s");
dbg_msg("sql", "4 %s");
}
catch( char[] )
{
dbg_msg("SQL", "5 %s");
dbg_msg("sql", "5 %s");
}
catch( char )
{
dbg_msg("SQL", "6 %s");
dbg_msg("sql", "6 %s");
}
catch (...)
{
dbg_msg("SQL", "Unknown Error cause by the MySQL/C++ Connector, my advice compile server_debug and use it");
dbg_msg("sql", "unknown error caused by the mysql/c++ connector, compile server_debug and use it");
dbg_msg("SQL", "ERROR: SQL connection failed");
dbg_msg("sql", "ERROR: sql connection failed");
return false;
}
return false;
@ -185,7 +179,7 @@ void CSqlScore::Init()
str_format(aBuf, sizeof(aBuf), "CREATE TABLE IF NOT EXISTS %s_points (Name VARCHAR(%d) BINARY NOT NULL, Points INT DEFAULT 0, UNIQUE KEY Name (Name)) CHARACTER SET utf8 ;", m_pPrefix, MAX_NAME_LENGTH);
m_pStatement->execute(aBuf);
dbg_msg("SQL", "Tables were created successfully");
dbg_msg("sql", "tables were created successfully");
}
// get the best time
@ -196,7 +190,7 @@ void CSqlScore::Init()
{
((CGameControllerDDRace*)GameServer()->m_pController)->m_CurrentRecord = (float)m_pResults->getDouble("Time");
dbg_msg("SQL", "Getting best time on server done");
dbg_msg("sql", "getting best time on server done");
}
// delete statement
@ -204,10 +198,8 @@ void CSqlScore::Init()
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Tables were NOT created");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: tables were NOT created");
}
// disconnect from database
@ -242,17 +234,15 @@ void CSqlScore::CheckBirthdayThread(void *pUser)
pData->m_pSqlData->GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf, pData->m_ClientID);
}
dbg_msg("SQL", "Checking birthday done");
dbg_msg("sql", "checking birthday done");
// delete statement and results
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not check birthday");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not check birthday");
}
// disconnect from database
@ -315,17 +305,15 @@ void CSqlScore::LoadScoreThread(void *pUser)
}
}
dbg_msg("SQL", "Getting best time done");
dbg_msg("sql", "getting best time done");
// delete statement and results
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not update account");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not update account");
}
// disconnect from database
@ -433,7 +421,7 @@ void CSqlScore::SaveTeamScoreThread(void *pUser)
if (aUpdateID[0])
{
str_format(aBuf, sizeof(aBuf), "UPDATE %s_teamrace SET Time='%.2f' WHERE ID = '%s';", pData->m_pSqlData->m_pPrefix, pData->m_Time, aUpdateID);
dbg_msg("SQL", aBuf);
dbg_msg("sql", aBuf);
pData->m_pSqlData->m_pStatement->execute(aBuf);
}
else
@ -444,23 +432,21 @@ void CSqlScore::SaveTeamScoreThread(void *pUser)
{
// if no entry found... create a new one
str_format(aBuf, sizeof(aBuf), "INSERT IGNORE INTO %s_teamrace(Map, Name, Timestamp, Time, ID) VALUES ('%s', '%s', CURRENT_TIMESTAMP(), '%.2f', @id);", pData->m_pSqlData->m_pPrefix, pData->m_pSqlData->m_aMap, pData->m_aNames[i], pData->m_Time);
dbg_msg("SQL", aBuf);
dbg_msg("sql", aBuf);
pData->m_pSqlData->m_pStatement->execute(aBuf);
}
}
end:
dbg_msg("SQL", "Updating team time done");
dbg_msg("sql", "updating team time done");
// delete results statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not update time");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not update time");
}
// disconnect from database
@ -559,10 +545,8 @@ void CSqlScore::MapVoteThread(void *pUser)
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not update time");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not update time");
}
pData->m_pSqlData->Disconnect();
@ -660,10 +644,8 @@ void CSqlScore::MapInfoThread(void *pUser)
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not update time");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not update time");
}
pData->m_pSqlData->Disconnect();
@ -717,17 +699,15 @@ void CSqlScore::SaveScoreThread(void *pUser)
// if no entry found... create a new one
str_format(aBuf, sizeof(aBuf), "INSERT IGNORE INTO %s_race(Map, Name, Timestamp, Time, Server, cp1, cp2, cp3, cp4, cp5, cp6, cp7, cp8, cp9, cp10, cp11, cp12, cp13, cp14, cp15, cp16, cp17, cp18, cp19, cp20, cp21, cp22, cp23, cp24, cp25) VALUES ('%s', '%s', CURRENT_TIMESTAMP(), '%.2f', '%s', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f', '%.2f');", pData->m_pSqlData->m_pPrefix, pData->m_pSqlData->m_aMap, pData->m_aName, pData->m_Time, g_Config.m_SvSqlServerName, pData->m_aCpCurrent[0], pData->m_aCpCurrent[1], pData->m_aCpCurrent[2], pData->m_aCpCurrent[3], pData->m_aCpCurrent[4], pData->m_aCpCurrent[5], pData->m_aCpCurrent[6], pData->m_aCpCurrent[7], pData->m_aCpCurrent[8], pData->m_aCpCurrent[9], pData->m_aCpCurrent[10], pData->m_aCpCurrent[11], pData->m_aCpCurrent[12], pData->m_aCpCurrent[13], pData->m_aCpCurrent[14], pData->m_aCpCurrent[15], pData->m_aCpCurrent[16], pData->m_aCpCurrent[17], pData->m_aCpCurrent[18], pData->m_aCpCurrent[19], pData->m_aCpCurrent[20], pData->m_aCpCurrent[21], pData->m_aCpCurrent[22], pData->m_aCpCurrent[23], pData->m_aCpCurrent[24]);
dbg_msg("SQL", aBuf);
dbg_msg("sql", aBuf);
pData->m_pSqlData->m_pStatement->execute(aBuf);
dbg_msg("SQL", "Updating time done");
dbg_msg("sql", "updating time done");
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not update time");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not update time");
}
// disconnect from database
@ -842,37 +822,35 @@ void CSqlScore::ShowTeamRankThread(void *pUser)
}
}
dbg_msg("SQL", "Showing teamrank done");
dbg_msg("sql", "showing teamrank done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show team rank");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show team rank");
}
// disconnect from database
pData->m_pSqlData->Disconnect();
}
}
delete pData;
delete pData;
lock_unlock(gs_SqlLock);
lock_unlock(gs_SqlLock);
}
void CSqlScore::ShowTeamTop5Thread(void *pUser)
{
lock_wait(gs_SqlLock);
lock_wait(gs_SqlLock);
CSqlScoreData *pData = (CSqlScoreData *)pUser;
CSqlScoreData *pData = (CSqlScoreData *)pUser;
// Connect to database
if(pData->m_pSqlData->Connect())
{
// Connect to database
if(pData->m_pSqlData->Connect())
{
try
{
// check sort methode
@ -944,17 +922,15 @@ void CSqlScore::ShowTeamTop5Thread(void *pUser)
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "-------------------------------");
dbg_msg("SQL", "Showing teamtop5 done");
dbg_msg("sql", "showing teamtop5 done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show teamtop5");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show teamtop5");
}
// disconnect from database
@ -1015,17 +991,15 @@ void CSqlScore::ShowRankThread(void *pUser)
}
}
dbg_msg("SQL", "Showing rank done");
dbg_msg("sql", "showing rank done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show rank");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show rank");
}
// disconnect from database
@ -1097,17 +1071,15 @@ void CSqlScore::ShowTop5Thread(void *pUser)
}
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "-------------------------------");
dbg_msg("SQL", "Showing top5 done");
dbg_msg("sql", "showing top5 done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show top5");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show top5");
}
// disconnect from database
@ -1183,17 +1155,15 @@ void CSqlScore::ShowTimesThread(void *pUser)
}
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "----------------------------------------------------");
dbg_msg("SQL", "Showing times done");
dbg_msg("sql", "showing times done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show times");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show times");
}
end:
// disconnect from database
@ -1420,17 +1390,15 @@ void CSqlScore::ShowPointsThread(void *pUser)
pData->m_pSqlData->GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf, pData->m_ClientID);
}
dbg_msg("SQL", "Showing points done");
dbg_msg("sql", "showing points done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show points");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show points");
}
// disconnect from database
@ -1484,17 +1452,15 @@ void CSqlScore::ShowTopPointsThread(void *pUser)
}
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "-------------------------------");
dbg_msg("SQL", "Showing toppoints done");
dbg_msg("sql", "showing toppoints done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not show toppoints");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not show toppoints");
}
// disconnect from database
@ -1549,17 +1515,15 @@ void CSqlScore::RandomMapThread(void *pUser)
pData->m_pSqlData->GameServer()->Console()->ExecuteLine(aBuf);
}
dbg_msg("SQL", "Voting random map done");
dbg_msg("sql", "voting random map done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not vote random map");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not vote random map");
}
// disconnect from database
@ -1607,17 +1571,15 @@ void CSqlScore::RandomUnfinishedMapThread(void *pUser)
pData->m_pSqlData->GameServer()->Console()->ExecuteLine(aBuf);
}
dbg_msg("SQL", "Voting random unfinished map done");
dbg_msg("sql", "voting random unfinished map done");
// delete results and statement
delete pData->m_pSqlData->m_pResults;
}
catch (sql::SQLException &e)
{
char aBuf[256];
str_format(aBuf, sizeof(aBuf), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf);
dbg_msg("SQL", "ERROR: Could not vote random unfinished map");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not vote random unfinished map");
}
// disconnect from database
@ -1739,7 +1701,7 @@ void CSqlScore::SaveTeamThread(void *pUser)
char aBuf[65536];
str_format(aBuf, sizeof(aBuf), "INSERT IGNORE INTO %s_saves(Savegame, Map, Code, Timestamp, Server) VALUES ('%s', '%s', '%s', CURRENT_TIMESTAMP(), '%s')", pData->m_pSqlData->m_pPrefix, TeamString, Map, pData->m_Code, pData->m_Server);
dbg_msg("SQL", aBuf);
dbg_msg("sql", aBuf);
pData->m_pSqlData->m_pStatement->execute(aBuf);
char aBuf2[256];
@ -1749,17 +1711,15 @@ void CSqlScore::SaveTeamThread(void *pUser)
}
else
{
dbg_msg("SQL", "ERROR: This save-code already exists");
dbg_msg("sql", "ERROR: this save-code already exists");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "This save-code already exists");
}
}
catch (sql::SQLException &e)
{
char aBuf2[256];
str_format(aBuf2, sizeof(aBuf2), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf2);
dbg_msg("SQL", "ERROR: Could not save the team");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "MySQL Error: Could not save the team");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not save the team");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "MySQL error: Could not save the team");
}
// disconnect from database
@ -1767,8 +1727,8 @@ void CSqlScore::SaveTeamThread(void *pUser)
}
else if(!Num)
{
dbg_msg("SQL", "connection failed");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "ERROR: Unable to connect to SQL-Server");
dbg_msg("sql", "connection failed");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "Error: Unable to connect to SQL-Server");
}
((CGameControllerDDRace*)(pData->m_pSqlData->GameServer()->m_pController))->m_Teams.SetSaving(Team, false);
@ -1902,11 +1862,9 @@ void CSqlScore::LoadTeamThread(void *pUser)
}
catch (sql::SQLException &e)
{
char aBuf2[256];
str_format(aBuf2, sizeof(aBuf2), "MySQL Error: %s", e.what());
dbg_msg("SQL", aBuf2);
dbg_msg("SQL", "ERROR: Could not load the team");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "MySQL Error: Could not load the team");
dbg_msg("sql", "MySQL ERROR: %s", e.what());
dbg_msg("sql", "ERROR: could not load the team");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "MySQL error: Could not load the team");
}
// disconnect from database
@ -1914,8 +1872,8 @@ void CSqlScore::LoadTeamThread(void *pUser)
}
else
{
dbg_msg("SQL", "connection failed");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "ERROR: Unable to connect to SQL-Server");
dbg_msg("sql", "connection failed");
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, "Error: Unable to connect to sql server");
}
delete pData;

View file

@ -162,7 +162,7 @@ void BuildPackets()
{
*pCurrent = m_aServers[m_NumServers-1];
m_NumServers--;
dbg_msg("mastersrv", "error: server of invalid type, dropping it");
dbg_msg("mastersrv", "ERROR: server of invalid type, dropping it");
}
}
}
@ -208,7 +208,7 @@ void AddCheckserver(NETADDR *pInfo, NETADDR *pAlt, ServerType Type)
// add server
if(m_NumCheckServers == MAX_SERVERS)
{
dbg_msg("mastersrv", "error: mastersrv is full");
dbg_msg("mastersrv", "ERROR: mastersrv is full");
return;
}
@ -243,7 +243,7 @@ void AddServer(NETADDR *pInfo, ServerType Type)
// add server
if(m_NumServers == MAX_SERVERS)
{
dbg_msg("mastersrv", "error: mastersrv is full");
dbg_msg("mastersrv", "ERROR: mastersrv is full");
return;
}
@ -314,7 +314,7 @@ void PurgeServers()
void ReloadBans()
{
m_NetBan.UnbanAll();
m_pConsole->ExecuteFile("master.cfg");
m_pConsole->ExecuteFile("master.cfg", -1, true);
}
int main(int argc, const char **argv) // ignore_convention

View file

@ -7,7 +7,7 @@ int main(int argc, const char **argv)
IStorage *pStorage = CreateLocalStorage();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}
for(int i = 1; i < argc; i++)

View file

@ -93,7 +93,7 @@ int main(int argc, const char **argv)
dbg_logger_stdout();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}

View file

@ -76,7 +76,7 @@ int main(int argc, const char **argv)
dbg_logger_stdout();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}

View file

@ -88,7 +88,7 @@ int main(int argc, const char **argv)
dbg_logger_stdout();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}

View file

@ -76,7 +76,7 @@ int main(int argc, const char **argv)
dbg_logger_stdout();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}

View file

@ -68,7 +68,7 @@ int main(int argc, const char **argv)
dbg_logger_stdout();
if(argc == 1)
{
dbg_msg("Usage", "%s FILE1 [ FILE2... ]", argv[0]);
dbg_msg("usage", "%s FILE1 [ FILE2... ]", argv[0]);
return -1;
}

View file

@ -196,9 +196,7 @@ int main(int argc, char **argv) // ignore_convention
char aAddrStr[NETADDR_MAXSTRSIZE];
net_addr_str(&Packet.m_Address, aAddrStr, sizeof(aAddrStr), false);
char aBuf[128];
str_format(aBuf, sizeof(aBuf), "version request by %s", aAddrStr);
dbg_msg("versionsrv", aBuf);
dbg_msg("versionsrv", "version request by %s", aAddrStr);
}
if(Packet.m_DataSize == sizeof(VERSIONSRV_GETNEWS) &&