iw4x-client/src/Components/Modules/BitMessage.hpp

40 lines
973 B
C++
Raw Normal View History

#pragma once
#ifndef DISABLE_BITMESSAGE
#define BITMESSAGE_KEYS_FILENAME std::string("players/bmk.dat")
#define BITMESSAGE_OBJECT_STORAGE_FILENAME std::string("players/storage.dat")
namespace Components
{
class BitMessage : public Component
{
public:
BitMessage();
~BitMessage();
2016-09-16 05:04:28 -04:00
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
const char* getName() { return "BitMessage"; };
#endif
2016-08-30 06:23:53 -04:00
static void SetDefaultTTL(time_t ttl);
static bool RequestPublicKey(std::string targetAddress);
static bool WaitForPublicKey(std::string targetAddress);
static bool Subscribe(std::string targetAddress);
static bool SendMsg(std::string targetAddress, std::string message, time_t ttl = 0);
static bool SendBroadcast(std::string message, time_t ttl = 0);
static void Save();
2016-08-30 06:23:53 -04:00
static BitMRC* BMClient;
private:
static std::thread ShutDownThread;
2016-08-30 06:23:53 -04:00
static PubAddr* FindPublicKey(PubAddr addr);
static bool InitAddr();
static void ShutDown();
};
}
#endif