2016-08-27 00:51:00 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef DISABLE_BITMESSAGE
|
|
|
|
|
2016-08-28 13:38:16 -04:00
|
|
|
#define BITMESSAGE_KEYS_FILENAME std::string("players/bmkeys.dat")
|
2016-08-27 15:20:08 -04:00
|
|
|
#define BITMESSAGE_OBJECT_STORAGE_FILENAME std::string("players/bmstore.dat")
|
2016-08-27 00:51:00 -04:00
|
|
|
|
|
|
|
namespace Components
|
|
|
|
{
|
|
|
|
class BitMessage : public Component
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BitMessage();
|
2016-08-28 13:38:16 -04:00
|
|
|
~BitMessage();
|
2016-08-27 00:51:00 -04:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
const char* GetName() { return "BitMessage"; };
|
|
|
|
#endif
|
|
|
|
|
2016-08-28 13:38:16 -04:00
|
|
|
void SetDefaultTTL(time_t ttl);
|
|
|
|
bool RequestPublicKey(std::string targetAddress);
|
|
|
|
bool Subscribe(std::string targetAddress);
|
|
|
|
bool SendMsg(std::string targetAddress, std::string message, time_t ttl = 0);
|
|
|
|
bool SendBroadcast(std::string message, time_t ttl = 0);
|
|
|
|
|
2016-08-27 00:51:00 -04:00
|
|
|
static BitMessage* Singleton;
|
2016-08-27 15:20:08 -04:00
|
|
|
BitMRC* BMClient;
|
2016-08-27 00:51:00 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool InitAddr();
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|