mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- adjusted stat code for the new survey.
This commit is contained in:
parent
21575bc3df
commit
369267bbe9
3 changed files with 35 additions and 7 deletions
|
@ -34,6 +34,7 @@ extern int sys_ostype;
|
||||||
#include "x86.h"
|
#include "x86.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
|
#include "gl_load/gl_interface.h"
|
||||||
|
|
||||||
CVAR(Int, sys_statsenabled, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
CVAR(Int, sys_statsenabled, -1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
||||||
CVAR(String, sys_statshost, "gzstats.drdteam.org", CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOSET)
|
CVAR(String, sys_statshost, "gzstats.drdteam.org", CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOSET)
|
||||||
|
@ -42,12 +43,31 @@ CVAR(Int, sys_statsport, 80, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOSET)
|
||||||
// Each machine will only send two reports, one when started with hardware rendering and one when started with software rendering.
|
// Each machine will only send two reports, one when started with hardware rendering and one when started with software rendering.
|
||||||
#define CHECKVERSION 350
|
#define CHECKVERSION 350
|
||||||
#define CHECKVERSIONSTR "350"
|
#define CHECKVERSIONSTR "350"
|
||||||
CVAR(Int, sentstats_swr_done, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
|
||||||
CVAR(Int, sentstats_hwr_done, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
CVAR(Int, sentstats_hwr_done, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOSET)
|
||||||
|
|
||||||
std::pair<double, bool> gl_getInfo();
|
std::pair<double, bool> gl_getInfo();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FString URLencode(const char *s)
|
||||||
|
{
|
||||||
|
const char * unreserved = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.~";
|
||||||
|
|
||||||
|
FString out;
|
||||||
|
for (size_t i = 0; s[i]; i++)
|
||||||
|
{
|
||||||
|
if (strchr(unreserved, s[i]))
|
||||||
|
{
|
||||||
|
out += s[i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
out.AppendFormat("%%%02X", s[i]&255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
bool I_HTTPRequest(const char* request)
|
bool I_HTTPRequest(const char* request)
|
||||||
|
@ -255,6 +275,12 @@ static int GetRenderInfo()
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int GetGLVersion()
|
||||||
|
{
|
||||||
|
auto info = gl_getInfo();
|
||||||
|
return int(info.first * 10);
|
||||||
|
}
|
||||||
|
|
||||||
static void D_DoHTTPRequest(const char *request)
|
static void D_DoHTTPRequest(const char *request)
|
||||||
{
|
{
|
||||||
if (I_HTTPRequest(request))
|
if (I_HTTPRequest(request))
|
||||||
|
@ -278,8 +304,8 @@ void D_DoAnonStats()
|
||||||
if (sentstats_hwr_done >= CHECKVERSION) return;
|
if (sentstats_hwr_done >= CHECKVERSION) return;
|
||||||
|
|
||||||
static char requeststring[1024];
|
static char requeststring[1024];
|
||||||
mysnprintf(requeststring, sizeof requeststring, "GET /stats_35.py?render=%i&cores=%i&os=%i&renderconfig=%i HTTP/1.1\nHost: %s\nConnection: close\nUser-Agent: %s %s\n\n",
|
mysnprintf(requeststring, sizeof requeststring, "GET /stats_35.py?render=%i&cores=%i&os=%i&glversion=%i&vendor=%s&model=%s HTTP/1.1\nHost: %s\nConnection: close\nUser-Agent: %s %s\n\n",
|
||||||
GetRenderInfo(), GetCoreInfo(), GetOSVersion(), V_IsHardwareRenderer(), sys_statshost.GetHumanString(), GAMENAME, VERSIONSTR);
|
GetRenderInfo(), GetCoreInfo(), GetOSVersion(), GetGLVersion(), URLencode(gl.vendorstring).GetChars(), URLencode(gl.modelstring).GetChars(), sys_statshost.GetHumanString(), GAMENAME, VERSIONSTR);
|
||||||
DPrintf(DMSG_NOTIFY, "Sending %s", requeststring);
|
DPrintf(DMSG_NOTIFY, "Sending %s", requeststring);
|
||||||
std::thread t1(D_DoHTTPRequest, requeststring);
|
std::thread t1(D_DoHTTPRequest, requeststring);
|
||||||
t1.detach();
|
t1.detach();
|
||||||
|
@ -300,11 +326,11 @@ void D_ConfirmSendStats()
|
||||||
"The three items we would like to know about are:\n" \
|
"The three items we would like to know about are:\n" \
|
||||||
"- Operating system\n" \
|
"- Operating system\n" \
|
||||||
"- Number of processor cores\n" \
|
"- Number of processor cores\n" \
|
||||||
"- Currently used renderer\n\n" \
|
"- OpenGL version and your graphics card's name\n\n" \
|
||||||
"All information sent will be anonymous. We will NOT be sending this information to any third party.\n" \
|
"All information sent will be anonymously. We will NOT be sending this information to any third party.\n" \
|
||||||
"It will merely be used for decision-making about GZDoom's future development.\n" \
|
"It will merely be used for decision-making about GZDoom's future development.\n" \
|
||||||
"Data will only be sent at most twice per system, once for the software renderer and once for the hardware renderer.\n" \
|
"Data will only be sent once per system.\n" \
|
||||||
"If you are getting this notice more than once per renderer, please let us know on the forums. Thanks!\n\n" \
|
"If you are getting this notice more than once, please let us know on the forums. Thanks!\n\n" \
|
||||||
"May we send this data? If you click 'no', nothing will be sent and you will not be asked again.";
|
"May we send this data? If you click 'no', nothing will be sent and you will not be asked again.";
|
||||||
|
|
||||||
static const char *const TITLE_TEXT = "GZDoom needs your help!";
|
static const char *const TITLE_TEXT = "GZDoom needs your help!";
|
||||||
|
|
|
@ -162,6 +162,7 @@ void gl_LoadExtensions()
|
||||||
gl.glslversion = strtod((char*)glGetString(GL_SHADING_LANGUAGE_VERSION), NULL) + 0.01f;
|
gl.glslversion = strtod((char*)glGetString(GL_SHADING_LANGUAGE_VERSION), NULL) + 0.01f;
|
||||||
|
|
||||||
gl.vendorstring = (char*)glGetString(GL_VENDOR);
|
gl.vendorstring = (char*)glGetString(GL_VENDOR);
|
||||||
|
gl.modelstring = (char*)glGetString(GL_RENDERER);
|
||||||
|
|
||||||
// first test for optional features
|
// first test for optional features
|
||||||
if (CheckExtension("GL_ARB_texture_compression")) gl.flags |= RFL_TEXTURE_COMPRESSION;
|
if (CheckExtension("GL_ARB_texture_compression")) gl.flags |= RFL_TEXTURE_COMPRESSION;
|
||||||
|
|
|
@ -40,6 +40,7 @@ struct RenderContext
|
||||||
float glslversion;
|
float glslversion;
|
||||||
int max_texturesize;
|
int max_texturesize;
|
||||||
char * vendorstring;
|
char * vendorstring;
|
||||||
|
char * modelstring;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern RenderContext gl;
|
extern RenderContext gl;
|
||||||
|
|
Loading…
Reference in a new issue