Esempio n. 1
0
	void ReportMessage(const char *message, ...)
	{
		if (!IsEnabled() || CheckSpamLimited())
			return;
		int pos = NextFreePos();
		if (pos == -1)
			return;

		const int MESSAGE_BUFFER_SIZE = 65536;
		char temp[MESSAGE_BUFFER_SIZE];

		va_list args;
		va_start(args, message);
		vsnprintf(temp, MESSAGE_BUFFER_SIZE - 1, message, args);
		temp[MESSAGE_BUFFER_SIZE - 1] = '\0';
		va_end(args);

		Payload &payload = payloadBuffer[pos];
		payload.type = RequestType::MESSAGE;
		payload.string1 = message;
		payload.string2 = temp;

		std::thread th(Process, pos);
		th.detach();
	}
Esempio n. 2
0
	void ReportMessageFormatted(const char *message, const char *formatted)
	{
		if (!IsEnabled() || CheckSpamLimited())
			return;
		int pos = NextFreePos();
		if (pos == -1)
			return;

		Payload &payload = payloadBuffer[pos];
		payload.type = RequestType::MESSAGE;
		payload.string1 = message;
		payload.string2 = formatted;

		std::thread th(Process, pos);
		th.detach();
	}
Esempio n. 3
0
	void ReportMessage(const char *message, ...)
	{
		if (!IsEnabled() || CheckSpamLimited())
			return;

		const int MESSAGE_BUFFER_SIZE = 32768;
		char temp[MESSAGE_BUFFER_SIZE];

		va_list args;
		va_start(args, message);
		vsnprintf(temp, MESSAGE_BUFFER_SIZE - 1, message, args);
		temp[MESSAGE_BUFFER_SIZE - 1] = '\0';
		va_end(args);

		int pos = payloadBufferPos++ % PAYLOAD_BUFFER_SIZE;
		Payload &payload = payloadBuffer[pos];
		payload.type = MESSAGE;
		payload.string1 = message;
		payload.string2 = temp;

		std::thread th(Process, pos);
		th.detach();
	}