2013-03-01 16:58:05 +00:00
|
|
|
// Copyright (c) 2012- PPSSPP Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0 or later versions.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official git repository and contact information can be found at
|
|
|
|
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
|
|
|
|
2013-03-24 17:18:22 +00:00
|
|
|
#include "Core/Reporting.h"
|
|
|
|
|
2013-04-29 01:56:09 +00:00
|
|
|
#include "Common/CPUDetect.h"
|
2013-05-20 03:20:41 +00:00
|
|
|
#include "Core/CoreTiming.h"
|
2013-03-01 16:58:05 +00:00
|
|
|
#include "Core/Config.h"
|
2014-02-09 21:45:51 +00:00
|
|
|
#include "Core/SaveState.h"
|
2013-03-01 16:58:05 +00:00
|
|
|
#include "Core/System.h"
|
2014-02-09 22:13:46 +00:00
|
|
|
#include "Core/FileSystems/MetaFileSystem.h"
|
2013-05-20 03:20:41 +00:00
|
|
|
#include "Core/HLE/sceDisplay.h"
|
|
|
|
#include "Core/HLE/sceKernelMemory.h"
|
2013-12-29 23:11:29 +00:00
|
|
|
#include "Core/ELF/ParamSFO.h"
|
2013-04-29 00:49:17 +00:00
|
|
|
#include "GPU/GPUInterface.h"
|
|
|
|
#include "GPU/GPUState.h"
|
2013-12-21 08:24:16 +00:00
|
|
|
#include "GPU/GLES/Framebuffer.h"
|
2013-03-01 16:58:05 +00:00
|
|
|
|
|
|
|
#include "net/http_client.h"
|
|
|
|
#include "net/resolve.h"
|
2013-05-31 21:10:14 +00:00
|
|
|
#include "net/url.h"
|
|
|
|
|
2013-03-01 16:58:05 +00:00
|
|
|
#include "base/buffer.h"
|
2013-10-28 16:41:47 +00:00
|
|
|
#include "thread/thread.h"
|
2013-03-01 16:58:05 +00:00
|
|
|
|
2014-02-09 21:56:08 +00:00
|
|
|
#include <set>
|
2013-03-01 16:58:05 +00:00
|
|
|
#include <stdlib.h>
|
2013-03-02 07:11:34 +00:00
|
|
|
#include <cstdarg>
|
2013-03-02 06:34:02 +00:00
|
|
|
|
2013-03-01 16:58:05 +00:00
|
|
|
namespace Reporting
|
|
|
|
{
|
|
|
|
const int DEFAULT_PORT = 80;
|
2013-03-02 07:11:34 +00:00
|
|
|
const u32 SPAM_LIMIT = 100;
|
2013-03-02 06:34:02 +00:00
|
|
|
const int PAYLOAD_BUFFER_SIZE = 100;
|
2013-03-01 20:56:51 +00:00
|
|
|
|
|
|
|
// Internal limiter on number of requests per instance.
|
|
|
|
static u32 spamProtectionCount = 0;
|
|
|
|
// Temporarily stores a reference to the hostname.
|
|
|
|
static std::string lastHostname;
|
2014-02-09 21:56:08 +00:00
|
|
|
// Keeps track of report-only-once identifiers.
|
|
|
|
static std::set<std::string> logOnceUsed;
|
2014-02-09 22:04:16 +00:00
|
|
|
// Keeps track of whether a harmful setting was ever used.
|
|
|
|
static bool everUnsupported = false;
|
2013-03-01 16:58:05 +00:00
|
|
|
|
2013-03-02 06:34:02 +00:00
|
|
|
enum RequestType
|
|
|
|
{
|
|
|
|
MESSAGE,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Payload
|
|
|
|
{
|
|
|
|
RequestType type;
|
2013-03-04 07:36:24 +00:00
|
|
|
std::string string1;
|
|
|
|
std::string string2;
|
2013-03-02 06:34:02 +00:00
|
|
|
};
|
|
|
|
static Payload payloadBuffer[PAYLOAD_BUFFER_SIZE];
|
|
|
|
static int payloadBufferPos = 0;
|
|
|
|
|
2013-04-14 08:25:25 +00:00
|
|
|
// Returns the full host (e.g. report.ppsspp.org:80.)
|
2013-03-24 16:53:41 +00:00
|
|
|
inline std::string ServerHost()
|
|
|
|
{
|
|
|
|
if (g_Config.sReportHost.compare("default") == 0)
|
|
|
|
return "";
|
|
|
|
return g_Config.sReportHost;
|
|
|
|
}
|
|
|
|
|
2013-04-14 08:25:25 +00:00
|
|
|
// Returns the length of the hostname part (e.g. before the :80.)
|
2013-03-01 16:58:05 +00:00
|
|
|
static size_t ServerHostnameLength()
|
|
|
|
{
|
2013-03-24 16:53:41 +00:00
|
|
|
if (!IsEnabled())
|
2013-03-01 16:58:05 +00:00
|
|
|
return g_Config.sReportHost.npos;
|
|
|
|
|
|
|
|
// IPv6 literal?
|
2013-10-05 17:16:06 +00:00
|
|
|
std::string hostString = ServerHost();
|
|
|
|
if (hostString[0] == '[')
|
2013-03-01 16:58:05 +00:00
|
|
|
{
|
2013-10-05 17:16:06 +00:00
|
|
|
size_t length = hostString.find("]:");
|
|
|
|
if (length != hostString.npos)
|
2013-03-01 16:58:05 +00:00
|
|
|
++length;
|
|
|
|
return length;
|
|
|
|
}
|
|
|
|
else
|
2013-10-05 17:16:06 +00:00
|
|
|
return hostString.find(':');
|
2013-03-01 16:58:05 +00:00
|
|
|
}
|
|
|
|
|
2013-04-14 08:25:25 +00:00
|
|
|
// Returns only the hostname part (e.g. "report.ppsspp.org".)
|
2013-03-01 16:58:05 +00:00
|
|
|
static const char *ServerHostname()
|
|
|
|
{
|
2013-03-24 16:53:41 +00:00
|
|
|
if (!IsEnabled())
|
2013-03-01 16:58:05 +00:00
|
|
|
return NULL;
|
|
|
|
|
2013-03-24 16:53:41 +00:00
|
|
|
std::string host = ServerHost();
|
2013-03-01 16:58:05 +00:00
|
|
|
size_t length = ServerHostnameLength();
|
|
|
|
|
2013-04-14 08:25:25 +00:00
|
|
|
// This means there's no port number - it's already the hostname.
|
|
|
|
if (length == host.npos)
|
|
|
|
lastHostname = host;
|
|
|
|
else
|
|
|
|
lastHostname = host.substr(0, length);
|
2013-03-01 16:58:05 +00:00
|
|
|
return lastHostname.c_str();
|
|
|
|
}
|
|
|
|
|
2013-04-14 08:25:25 +00:00
|
|
|
// Returns only the port part (e.g. 80) as an int.
|
2013-03-01 16:58:05 +00:00
|
|
|
static int ServerPort()
|
|
|
|
{
|
2013-03-24 16:53:41 +00:00
|
|
|
if (!IsEnabled())
|
2013-03-01 16:58:05 +00:00
|
|
|
return 0;
|
|
|
|
|
2013-03-24 16:53:41 +00:00
|
|
|
std::string host = ServerHost();
|
2013-03-01 16:58:05 +00:00
|
|
|
size_t offset = ServerHostnameLength();
|
2013-04-14 08:25:25 +00:00
|
|
|
// If there's no port, use the default one.
|
2013-03-24 16:53:41 +00:00
|
|
|
if (offset == host.npos)
|
2013-03-01 16:58:05 +00:00
|
|
|
return DEFAULT_PORT;
|
|
|
|
|
|
|
|
// Skip the colon.
|
2013-03-24 16:53:41 +00:00
|
|
|
std::string port = host.substr(offset + 1);
|
2013-03-01 16:58:05 +00:00
|
|
|
return atoi(port.c_str());
|
|
|
|
}
|
|
|
|
|
2013-03-01 20:56:51 +00:00
|
|
|
// Should only be called once per request.
|
|
|
|
bool CheckSpamLimited()
|
|
|
|
{
|
|
|
|
return ++spamProtectionCount >= SPAM_LIMIT;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool SendReportRequest(const char *uri, const std::string &data, Buffer *output = NULL)
|
|
|
|
{
|
|
|
|
bool result = false;
|
2013-09-30 08:25:40 +00:00
|
|
|
net::AutoInit netInit;
|
2013-03-01 20:56:51 +00:00
|
|
|
http::Client http;
|
|
|
|
Buffer theVoid;
|
|
|
|
|
|
|
|
if (output == NULL)
|
|
|
|
output = &theVoid;
|
|
|
|
|
|
|
|
if (http.Resolve(ServerHostname(), ServerPort()))
|
|
|
|
{
|
|
|
|
http.Connect();
|
2013-03-24 16:37:25 +00:00
|
|
|
http.POST("/report/message", data, "application/x-www-form-urlencoded", output);
|
2013-03-01 20:56:51 +00:00
|
|
|
http.Disconnect();
|
|
|
|
result = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2013-04-29 01:27:51 +00:00
|
|
|
std::string StripTrailingNull(const std::string &str)
|
|
|
|
{
|
|
|
|
size_t pos = str.find_first_of('\0');
|
|
|
|
if (pos != str.npos)
|
|
|
|
return str.substr(0, pos);
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2013-04-29 01:56:09 +00:00
|
|
|
std::string GetPlatformIdentifer()
|
|
|
|
{
|
|
|
|
// TODO: Do we care about OS version?
|
|
|
|
#if defined(ANDROID)
|
|
|
|
return "Android";
|
2013-04-29 02:36:15 +00:00
|
|
|
#elif defined(_WIN64)
|
|
|
|
return "Windows 64";
|
2013-04-29 01:56:09 +00:00
|
|
|
#elif defined(_WIN32)
|
|
|
|
return "Windows";
|
|
|
|
#elif defined(IOS)
|
|
|
|
return "iOS";
|
|
|
|
#elif defined(__APPLE__)
|
|
|
|
return "Mac";
|
|
|
|
#elif defined(__SYMBIAN32__)
|
|
|
|
return "Symbian";
|
|
|
|
#elif defined(__FreeBSD__)
|
|
|
|
return "BSD";
|
|
|
|
#elif defined(BLACKBERRY)
|
|
|
|
return "Blackberry";
|
|
|
|
#elif defined(LOONGSON)
|
|
|
|
return "Loongson";
|
2013-04-29 02:36:15 +00:00
|
|
|
#elif defined(MEEGO_EDITION_HARMATTAN)
|
|
|
|
return "Nokia N9/N950";
|
|
|
|
#elif defined(__linux__)
|
|
|
|
return "Linux";
|
2013-04-29 01:56:09 +00:00
|
|
|
#else
|
|
|
|
return "Unknown";
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-02-09 21:56:08 +00:00
|
|
|
void Init()
|
|
|
|
{
|
|
|
|
// New game, clean slate.
|
|
|
|
spamProtectionCount = 0;
|
|
|
|
logOnceUsed.clear();
|
2014-02-09 22:04:16 +00:00
|
|
|
everUnsupported = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void UpdateConfig()
|
|
|
|
{
|
|
|
|
if (!IsSupported())
|
|
|
|
everUnsupported = true;
|
2014-02-09 21:56:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool ShouldLogOnce(const char *identifier)
|
|
|
|
{
|
|
|
|
// True if it wasn't there already -> so yes, log.
|
|
|
|
return logOnceUsed.insert(identifier).second;
|
|
|
|
}
|
|
|
|
|
2014-02-09 22:35:40 +00:00
|
|
|
void AddGameInfo(UrlEncoder &postdata)
|
2013-03-02 06:34:02 +00:00
|
|
|
{
|
2014-02-09 22:35:40 +00:00
|
|
|
// TODO: Maybe ParamSFOData shouldn't include nulls in std::strings? Don't work to break savedata, though...
|
|
|
|
postdata.Add("game", StripTrailingNull(g_paramSFO.GetValueString("DISC_ID")) + "_" + StripTrailingNull(g_paramSFO.GetValueString("DISC_VERSION")));
|
|
|
|
postdata.Add("game_title", StripTrailingNull(g_paramSFO.GetValueString("TITLE")));
|
|
|
|
postdata.Add("sdkver", sceKernelGetCompiledSdkVersion());
|
|
|
|
}
|
2013-03-02 06:34:02 +00:00
|
|
|
|
2014-02-09 22:35:40 +00:00
|
|
|
void AddSystemInfo(UrlEncoder &postdata)
|
|
|
|
{
|
2013-04-29 07:30:54 +00:00
|
|
|
std::string gpuPrimary, gpuFull;
|
2013-05-18 16:47:17 +00:00
|
|
|
if (gpu)
|
|
|
|
gpu->GetReportingInfo(gpuPrimary, gpuFull);
|
2014-02-09 22:35:40 +00:00
|
|
|
|
2013-04-29 01:27:51 +00:00
|
|
|
postdata.Add("version", PPSSPP_GIT_VERSION);
|
2013-04-29 07:30:54 +00:00
|
|
|
postdata.Add("gpu", gpuPrimary);
|
|
|
|
postdata.Add("gpu_full", gpuFull);
|
2013-04-29 01:56:09 +00:00
|
|
|
postdata.Add("cpu", cpu_info.Summarize());
|
|
|
|
postdata.Add("platform", GetPlatformIdentifer());
|
2014-02-09 22:35:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AddConfigInfo(UrlEncoder &postdata)
|
|
|
|
{
|
2013-05-20 03:20:41 +00:00
|
|
|
postdata.Add("pixel_width", PSP_CoreParameter().pixelWidth);
|
|
|
|
postdata.Add("pixel_height", PSP_CoreParameter().pixelHeight);
|
2014-02-09 22:35:40 +00:00
|
|
|
|
|
|
|
postdata.Add("config.sys.jit", g_Config.bJit);
|
|
|
|
postdata.Add("config.sys.cpu_thread", g_Config.bSeparateCPUThread);
|
|
|
|
postdata.Add("config.sys.io_thread", g_Config.bSeparateIOThread);
|
|
|
|
postdata.Add("config.sys.locked_cpu", g_Config.iLockedCPUSpeed);
|
|
|
|
postdata.Add("config.sys.cheats", g_Config.bEnableCheats);
|
|
|
|
postdata.Add("config.sys.lang", g_Config.iLanguage);
|
|
|
|
postdata.Add("config.sys.encrypt_save", g_Config.bEncryptSave);
|
|
|
|
postdata.Add("config.sys.psp_model", g_Config.iPSPModel);
|
|
|
|
postdata.Add("config.sys.firmware_ver", g_Config.iFirmwareVersion);
|
|
|
|
postdata.Add("config.gpu.swrast", g_Config.bSoftwareRendering);
|
|
|
|
postdata.Add("config.gpu.hw_transform", g_Config.bHardwareTransform);
|
|
|
|
postdata.Add("config.gpu.sw_skinning", g_Config.bSoftwareSkinning);
|
|
|
|
postdata.Add("config.gpu.rendering_mode", g_Config.iRenderingMode);
|
|
|
|
postdata.Add("config.gpu.tex_filtering", g_Config.iTexFiltering);
|
|
|
|
postdata.Add("config.gpu.frameskip", g_Config.iFrameSkip);
|
|
|
|
postdata.Add("config.gpu.autoskip", g_Config.bAutoFrameSkip);
|
|
|
|
postdata.Add("config.gpu.vertex_cache", g_Config.bVertexCache);
|
|
|
|
postdata.Add("config.gpu.tex_backoff_cache", g_Config.bTextureBackoffCache);
|
|
|
|
postdata.Add("config.gpu.tex_second_cache", g_Config.bTextureSecondaryCache);
|
|
|
|
postdata.Add("config.gpu.vertex_jit", g_Config.bVertexDecoderJit);
|
|
|
|
postdata.Add("config.gpu.internal_res", g_Config.iInternalResolution);
|
|
|
|
postdata.Add("config.gpu.mipmap", g_Config.bMipMap);
|
|
|
|
postdata.Add("config.gpu.tex_scaling_level", g_Config.iTexScalingLevel);
|
|
|
|
postdata.Add("config.gpu.tex_scaling_type", g_Config.iTexScalingType);
|
|
|
|
postdata.Add("config.gpu.tex_deposterize", g_Config.bTexDeposterize);
|
|
|
|
postdata.Add("config.gpu.fps_limit", g_Config.iFpsLimit);
|
|
|
|
postdata.Add("config.gpu.force_max_fps", g_Config.iForceMaxEmulatedFPS);
|
|
|
|
postdata.Add("config.gpu.lowq_spline_bezier", g_Config.bLowQualitySplineBezier);
|
|
|
|
postdata.Add("config.hack.disable_stencil", g_Config.bDisableStencilTest);
|
|
|
|
postdata.Add("config.hack.always_depth_write", g_Config.bAlwaysDepthWrite);
|
|
|
|
postdata.Add("config.hack.timer_hack", g_Config.bTimerHack);
|
|
|
|
postdata.Add("config.hack.disable_alpha", g_Config.bDisableAlphaTest);
|
|
|
|
postdata.Add("config.hack.prescale_uv", g_Config.bPrescaleUV);
|
|
|
|
postdata.Add("config.hack.discard_regs", g_Config.bDiscardRegsOnJRRA);
|
|
|
|
postdata.Add("config.hack.skip_deadbeef", g_Config.bSkipDeadbeefFilling);
|
|
|
|
postdata.Add("config.hack.func_hash_map", g_Config.bFuncHashMap);
|
|
|
|
postdata.Add("config.audio.low_latency", g_Config.bLowLatencyAudio);
|
|
|
|
postdata.Add("config.net.enable_wlan", g_Config.bEnableWlan);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AddGameplayInfo(UrlEncoder &postdata)
|
|
|
|
{
|
|
|
|
// Just to get an idea of how long they played.
|
2013-06-01 05:31:05 +00:00
|
|
|
postdata.Add("ticks", (const uint64_t)CoreTiming::GetTicks());
|
2013-05-20 03:20:41 +00:00
|
|
|
|
2013-10-28 04:19:27 +00:00
|
|
|
if (g_Config.iShowFPSCounter && g_Config.iShowFPSCounter < 4)
|
2013-05-20 03:20:41 +00:00
|
|
|
{
|
|
|
|
float vps, fps;
|
|
|
|
__DisplayGetAveragedFPS(&vps, &fps);
|
|
|
|
postdata.Add("vps", vps);
|
2013-06-30 02:57:25 +00:00
|
|
|
postdata.Add("fps", fps);
|
2013-05-20 03:20:41 +00:00
|
|
|
}
|
2013-04-29 01:56:09 +00:00
|
|
|
|
2014-02-09 21:45:51 +00:00
|
|
|
postdata.Add("savestate_used", SaveState::HasLoadedState());
|
2014-02-09 22:35:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int Process(int pos)
|
|
|
|
{
|
|
|
|
Payload &payload = payloadBuffer[pos];
|
|
|
|
|
|
|
|
UrlEncoder postdata;
|
|
|
|
AddSystemInfo(postdata);
|
|
|
|
AddGameInfo(postdata);
|
|
|
|
AddConfigInfo(postdata);
|
|
|
|
AddGameplayInfo(postdata);
|
2013-03-02 06:34:02 +00:00
|
|
|
|
|
|
|
switch (payload.type)
|
|
|
|
{
|
|
|
|
case MESSAGE:
|
2013-04-29 01:27:51 +00:00
|
|
|
postdata.Add("message", payload.string1);
|
|
|
|
postdata.Add("value", payload.string2);
|
2013-03-04 07:36:24 +00:00
|
|
|
payload.string1.clear();
|
|
|
|
payload.string2.clear();
|
2013-03-02 06:34:02 +00:00
|
|
|
|
2013-04-29 01:27:51 +00:00
|
|
|
SendReportRequest("/report/message", postdata.ToString());
|
2013-03-02 06:34:02 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-09-01 19:57:39 +00:00
|
|
|
bool IsSupported()
|
|
|
|
{
|
|
|
|
// Disabled when using certain hacks, because they make for poor reports.
|
2013-12-21 12:05:51 +00:00
|
|
|
if (g_Config.iRenderingMode >= FBO_READFBOMEMORY_MIN)
|
2013-09-01 19:57:39 +00:00
|
|
|
return false;
|
2014-02-09 22:13:46 +00:00
|
|
|
|
|
|
|
// Some users run the exe from a zip or something, and don't have fonts.
|
|
|
|
// This breaks things, but let's not report it since it's confusing.
|
|
|
|
if (!pspFileSystem.GetFileInfo("flash0:/font").exists)
|
|
|
|
return false;
|
|
|
|
|
2013-09-01 19:57:39 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:53:41 +00:00
|
|
|
bool IsEnabled()
|
2013-03-01 16:58:05 +00:00
|
|
|
{
|
2014-02-09 22:04:16 +00:00
|
|
|
if (g_Config.sReportHost.empty() || !IsSupported() || everUnsupported)
|
2013-03-24 16:53:41 +00:00
|
|
|
return false;
|
2013-03-01 16:58:05 +00:00
|
|
|
// Disabled by default for now.
|
|
|
|
if (g_Config.sReportHost.compare("default") == 0)
|
2013-03-24 16:53:41 +00:00
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-09-01 19:57:39 +00:00
|
|
|
void Enable(bool flag, std::string host)
|
|
|
|
{
|
|
|
|
if (IsSupported() && IsEnabled() != flag)
|
|
|
|
{
|
|
|
|
// "" means explicitly disabled. Don't ever turn on by default.
|
|
|
|
// "default" means it's okay to turn it on by default.
|
|
|
|
g_Config.sReportHost = flag ? host : "";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void EnableDefault()
|
|
|
|
{
|
|
|
|
g_Config.sReportHost = "default";
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:53:41 +00:00
|
|
|
void ReportMessage(const char *message, ...)
|
|
|
|
{
|
|
|
|
if (!IsEnabled() || CheckSpamLimited())
|
2013-03-01 16:58:05 +00:00
|
|
|
return;
|
|
|
|
|
2013-03-01 17:51:10 +00:00
|
|
|
const int MESSAGE_BUFFER_SIZE = 32768;
|
|
|
|
char temp[MESSAGE_BUFFER_SIZE];
|
2013-03-01 16:58:05 +00:00
|
|
|
|
|
|
|
va_list args;
|
|
|
|
va_start(args, message);
|
2013-03-02 06:34:02 +00:00
|
|
|
vsnprintf(temp, MESSAGE_BUFFER_SIZE - 1, message, args);
|
|
|
|
temp[MESSAGE_BUFFER_SIZE - 1] = '\0';
|
2013-03-01 16:58:05 +00:00
|
|
|
va_end(args);
|
|
|
|
|
2013-03-02 06:34:02 +00:00
|
|
|
int pos = payloadBufferPos++ % PAYLOAD_BUFFER_SIZE;
|
|
|
|
Payload &payload = payloadBuffer[pos];
|
|
|
|
payload.type = MESSAGE;
|
2013-03-04 07:36:24 +00:00
|
|
|
payload.string1 = message;
|
|
|
|
payload.string2 = temp;
|
2013-03-02 06:34:02 +00:00
|
|
|
|
|
|
|
std::thread th(Process, pos);
|
|
|
|
th.detach();
|
2013-03-01 16:58:05 +00:00
|
|
|
}
|
|
|
|
|
2013-06-01 05:31:05 +00:00
|
|
|
}
|