mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
4762: Set gfx_opengl_major 1 as default on 32bit x86 r=heinrich5991 a=def- Multiple reports that BiT3 doesn't load with higher OpenGL <!-- What is the motivation for the changes of this pull request --> ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) 4792: Use ipv4 for info2.ddnet.tw requests r=heinrich5991 a=def- <!-- What is the motivation for the changes of this pull request --> ## Checklist - [x] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: def <dennis@felsin9.de> Co-authored-by: Dennis Felsing <dennis@felsin9.de>
This commit is contained in:
commit
fb20961cec
|
@ -4508,7 +4508,8 @@ void CClient::RequestDDNetInfo()
|
|||
str_append(aUrl, aEscaped, sizeof(aUrl));
|
||||
}
|
||||
|
||||
m_pDDNetInfoTask = std::make_shared<CGetFile>(Storage(), aUrl, m_aDDNetInfoTmp, IStorage::TYPE_SAVE, CTimeout{10000, 500, 10});
|
||||
// Use ipv4 so we can know the ingame ip addresses of players before they join game servers
|
||||
m_pDDNetInfoTask = std::make_shared<CGetFile>(Storage(), aUrl, m_aDDNetInfoTmp, IStorage::TYPE_SAVE, CTimeout{10000, 500, 10}, HTTPLOG::ALL, IPRESOLVE::V4);
|
||||
Engine()->AddJob(m_pDDNetInfoTask);
|
||||
}
|
||||
|
||||
|
|
|
@ -86,11 +86,12 @@ void EscapeUrl(char *pBuf, int Size, const char *pStr)
|
|||
curl_free(pEsc);
|
||||
}
|
||||
|
||||
CRequest::CRequest(const char *pUrl, CTimeout Timeout, HTTPLOG LogProgress) :
|
||||
CRequest::CRequest(const char *pUrl, CTimeout Timeout, HTTPLOG LogProgress, IPRESOLVE IpResolve) :
|
||||
m_Timeout(Timeout),
|
||||
m_Size(0),
|
||||
m_Progress(0),
|
||||
m_LogProgress(LogProgress),
|
||||
m_IpResolve(IpResolve),
|
||||
m_State(HTTP_QUEUED),
|
||||
m_Abort(false)
|
||||
{
|
||||
|
@ -147,6 +148,7 @@ int CRequest::RunImpl(CURL *pHandle)
|
|||
curl_easy_setopt(pHandle, CURLOPT_NOPROGRESS, 0L);
|
||||
curl_easy_setopt(pHandle, CURLOPT_PROGRESSDATA, this);
|
||||
curl_easy_setopt(pHandle, CURLOPT_PROGRESSFUNCTION, ProgressCallback);
|
||||
curl_easy_setopt(pHandle, CURLOPT_IPRESOLVE, m_IpResolve == IPRESOLVE::V4 ? CURL_IPRESOLVE_V4 : m_IpResolve == IPRESOLVE::V6 ? CURL_IPRESOLVE_V6 : CURL_IPRESOLVE_WHATEVER);
|
||||
|
||||
if(curl_version_info(CURLVERSION_NOW)->version_num < 0x076800)
|
||||
{
|
||||
|
@ -283,8 +285,8 @@ size_t CGet::OnData(char *pData, size_t DataSize)
|
|||
return DataSize;
|
||||
}
|
||||
|
||||
CGetFile::CGetFile(IStorage *pStorage, const char *pUrl, const char *pDest, int StorageType, CTimeout Timeout, HTTPLOG LogProgress) :
|
||||
CRequest(pUrl, Timeout, LogProgress),
|
||||
CGetFile::CGetFile(IStorage *pStorage, const char *pUrl, const char *pDest, int StorageType, CTimeout Timeout, HTTPLOG LogProgress, IPRESOLVE IpResolve) :
|
||||
CRequest(pUrl, Timeout, LogProgress, IpResolve),
|
||||
m_pStorage(pStorage),
|
||||
m_File(0),
|
||||
m_StorageType(StorageType)
|
||||
|
|
|
@ -25,6 +25,13 @@ enum class HTTPLOG
|
|||
ALL,
|
||||
};
|
||||
|
||||
enum class IPRESOLVE
|
||||
{
|
||||
WHATEVER,
|
||||
V4,
|
||||
V6,
|
||||
};
|
||||
|
||||
struct CTimeout
|
||||
{
|
||||
long ConnectTimeoutMs;
|
||||
|
@ -51,6 +58,7 @@ class CRequest : public IJob
|
|||
std::atomic<double> m_Current;
|
||||
std::atomic<int> m_Progress;
|
||||
HTTPLOG m_LogProgress;
|
||||
IPRESOLVE m_IpResolve;
|
||||
|
||||
std::atomic<int> m_State;
|
||||
std::atomic<bool> m_Abort;
|
||||
|
@ -65,7 +73,7 @@ protected:
|
|||
virtual int OnCompletion(int State) { return State; }
|
||||
|
||||
public:
|
||||
CRequest(const char *pUrl, CTimeout Timeout, HTTPLOG LogProgress = HTTPLOG::ALL);
|
||||
CRequest(const char *pUrl, CTimeout Timeout, HTTPLOG LogProgress = HTTPLOG::ALL, IPRESOLVE IpResolve = IPRESOLVE::WHATEVER);
|
||||
|
||||
double Current() const { return m_Current.load(std::memory_order_relaxed); }
|
||||
double Size() const { return m_Size.load(std::memory_order_relaxed); }
|
||||
|
@ -129,7 +137,7 @@ protected:
|
|||
virtual int OnCompletion(int State);
|
||||
|
||||
public:
|
||||
CGetFile(IStorage *pStorage, const char *pUrl, const char *pDest, int StorageType = -2, CTimeout Timeout = CTimeout{4000, 500, 5}, HTTPLOG LogProgress = HTTPLOG::ALL);
|
||||
CGetFile(IStorage *pStorage, const char *pUrl, const char *pDest, int StorageType = -2, CTimeout Timeout = CTimeout{4000, 500, 5}, HTTPLOG LogProgress = HTTPLOG::ALL, IPRESOLVE IpResolve = IPRESOLVE::WHATEVER);
|
||||
|
||||
const char *Dest() const { return m_aDest; }
|
||||
};
|
||||
|
|
|
@ -401,7 +401,11 @@ MACRO_CONFIG_INT(ClDemoShowSpeed, cl_demo_show_speed, 0, 0, 1, CFGFLAG_SAVE | CF
|
|||
MACRO_CONFIG_INT(ClDemoKeyboardShortcuts, cl_demo_keyboard_shortcuts, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable keyboard shortcuts in demo player")
|
||||
|
||||
// opengl
|
||||
#ifndef CONF_ARCH_IA32
|
||||
MACRO_CONFIG_INT(GfxOpenGLMajor, gfx_opengl_major, 3, 1, 10, CFGFLAG_SAVE | CFGFLAG_CLIENT, "OpenGL major version")
|
||||
#else
|
||||
MACRO_CONFIG_INT(GfxOpenGLMajor, gfx_opengl_major, 1, 1, 10, CFGFLAG_SAVE | CFGFLAG_CLIENT, "OpenGL major version")
|
||||
#endif
|
||||
MACRO_CONFIG_INT(GfxOpenGLMinor, gfx_opengl_minor, 0, 0, 10, CFGFLAG_SAVE | CFGFLAG_CLIENT, "OpenGL minor version")
|
||||
MACRO_CONFIG_INT(GfxOpenGLPatch, gfx_opengl_patch, 0, 0, 10, CFGFLAG_SAVE | CFGFLAG_CLIENT, "OpenGL patch version")
|
||||
|
||||
|
|
Loading…
Reference in a new issue