summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/proto.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-06 23:09:58 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-06 23:10:07 +0300
commit3d4f907c1237b1210ae75a9530a82fabda2af484 (patch)
tree6dd0ed3b2f81e28ccf27707539e37b9cd752dd30 /protocols/Discord/src/proto.h
parent85e72f5e8a819daeb333d38f4ef312b5f49ead6c (diff)
gateway commands
Diffstat (limited to 'protocols/Discord/src/proto.h')
-rw-r--r--protocols/Discord/src/proto.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h
index b822bbf323..aa4e36ef1c 100644
--- a/protocols/Discord/src/proto.h
+++ b/protocols/Discord/src/proto.h
@@ -26,6 +26,15 @@ struct PARAM
{}
};
+struct BOOL_PARAM : public PARAM
+{
+ bool bValue;
+ __forceinline BOOL_PARAM(LPCSTR _name, bool _value) :
+ PARAM(_name), bValue(_value)
+ {}
+};
+AsyncHttpRequest* operator<<(AsyncHttpRequest*, const BOOL_PARAM&);
+
struct INT_PARAM : public PARAM
{
int iValue;
@@ -54,6 +63,7 @@ struct WCHAR_PARAM : public PARAM
AsyncHttpRequest* operator<<(AsyncHttpRequest*, const WCHAR_PARAM&);
JSONNode& operator<<(JSONNode &json, const INT_PARAM &param);
+JSONNode& operator<<(JSONNode &json, const BOOL_PARAM &param);
JSONNode& operator<<(JSONNode &json, const CHAR_PARAM &param);
JSONNode& operator<<(JSONNode &json, const WCHAR_PARAM &param);
@@ -123,10 +133,19 @@ class CDiscordProto : public PROTO<CDiscordProto>
HANDLE
m_hGatewayNetlibUser, // the separate netlib user handle for gateways
m_hGatewayConnection; // gateway connection
+
void __cdecl GatewayThread(void*);
- void GatewaySend(int opCode, const char*);
+ void GatewaySend(int opCode, const JSONNode&);
+ void GatewayProcess(const JSONNode&);
+
+ void GatewaySendHeartbeat(void);
+ void GatewaySendIdentify(void);
+
+ void OnReceiveGateway(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
- void OnReceiveGateway(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
+ int m_iHartbeatInterval;
+ int m_iGatewaySeq; // gateway sequence number
+ DWORD m_dwLastHeartbeat;
//////////////////////////////////////////////////////////////////////////////////////
// options