Upload in a thread and print error message for failures.
This commit is contained in:
parent
2d0e211e07
commit
54fa7a0979
@ -280,7 +280,7 @@ void UploadCrashDump(const char *path)
|
|||||||
|
|
||||||
if (!xfer->PostAndDownload("http://crash.limetech.org/submit", form, &data, NULL))
|
if (!xfer->PostAndDownload("http://crash.limetech.org/submit", form, &data, NULL))
|
||||||
{
|
{
|
||||||
printf(">>> UPLOAD FAILED\n");
|
printf(">>> UPLOAD FAILED: %s (%d)\n", xfer->LastErrorMessage(), xfer->LastErrorCode());
|
||||||
} else {
|
} else {
|
||||||
printf(">>> UPLOADED CRASH DUMP");
|
printf(">>> UPLOADED CRASH DUMP");
|
||||||
printf("%s", data.GetBuffer());
|
printf("%s", data.GetBuffer());
|
||||||
@ -291,8 +291,11 @@ void UploadCrashDump(const char *path)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Accelerator::OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax)
|
class UploadThread: public IThread {
|
||||||
|
void RunThread(IThreadHandle *pHandle)
|
||||||
{
|
{
|
||||||
|
printf("Upload thread started.\n");
|
||||||
|
|
||||||
IDirectory *dumps = libsys->OpenDirectory(buffer);
|
IDirectory *dumps = libsys->OpenDirectory(buffer);
|
||||||
|
|
||||||
char path[512];
|
char path[512];
|
||||||
@ -340,6 +343,11 @@ void Accelerator::OnCoreMapStart(edict_t *pEdictList, int edictCount, int client
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnTerminate(IThreadHandle *pHandle, bool cancel) {
|
||||||
|
printf("Upload thread terminated (%s)\n", (cancel ? "true" : "false"));
|
||||||
|
}
|
||||||
|
} uploadThread;
|
||||||
|
|
||||||
bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
||||||
{
|
{
|
||||||
sharesys->AddDependency(myself, "webternet.ext", true, true);
|
sharesys->AddDependency(myself, "webternet.ext", true, true);
|
||||||
@ -357,6 +365,8 @@ bool Accelerator::SDK_OnLoad(char *error, size_t maxlength, bool late)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
threader->MakeThread(&uploadThread);
|
||||||
|
|
||||||
if (!gameconfs->LoadGameConfigFile("accelerator.games", &gameconfig, error, maxlength)) {
|
if (!gameconfs->LoadGameConfigFile("accelerator.games", &gameconfig, error, maxlength)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
|
//virtual bool SDK_OnMetamodPauseChange(bool paused, char *error, size_t maxlen);
|
||||||
#endif
|
#endif
|
||||||
virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
#endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
//#define SMEXT_ENABLE_MEMUTILS
|
//#define SMEXT_ENABLE_MEMUTILS
|
||||||
//#define SMEXT_ENABLE_GAMEHELPERS
|
//#define SMEXT_ENABLE_GAMEHELPERS
|
||||||
//#define SMEXT_ENABLE_TIMERSYS
|
//#define SMEXT_ENABLE_TIMERSYS
|
||||||
//#define SMEXT_ENABLE_THREADER
|
#define SMEXT_ENABLE_THREADER
|
||||||
#define SMEXT_ENABLE_LIBSYS
|
#define SMEXT_ENABLE_LIBSYS
|
||||||
//#define SMEXT_ENABLE_MENUS
|
//#define SMEXT_ENABLE_MENUS
|
||||||
//#define SMEXT_ENABLE_ADTFACTORY
|
//#define SMEXT_ENABLE_ADTFACTORY
|
||||||
|
Loading…
Reference in New Issue
Block a user