summaryrefslogtreecommitdiff
path: root/protocols/Steam/src/api/poll.h
blob: 6336b212e916c03b7b1b7b89587e928cfafb34cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef _STEAM_REQUEST_POLL_H_
#define _STEAM_REQUEST_POLL_H_

class PollRequest : public HttpRequest
{
public:
	PollRequest(const char *token, const char *umqId, UINT32 messageId, int idleSeconds) :
		HttpRequest(HttpPost, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Poll/v0001")
	{
		timeout = (STEAM_API_TIMEOUT + 5) * 1000;
		// flags |= NLHRF_PERSISTENT;

		Headers << CHAR_PARAM("Connection", "keep-alive");

		Content = new FormUrlEncodedContent(this)
			<< CHAR_PARAM("access_token", token)
			<< CHAR_PARAM("umqid", umqId)
			<< INT64_PARAM("message", messageId)
			<< INT_PARAM("secidletime", idleSeconds)
			<< INT_PARAM("sectimeout", STEAM_API_TIMEOUT);
	}

	//{
	//	"pollid": 0,
	//	"sectimeout" : 30,
	//	"error" : "Timeout"
	//}

	//{
	//	"pollid": 0,
	//	"messages": [
	//		{
	//			"type": "typing",
	//			"timestamp": 17276041,
	//			"utc_timestamp": 1514974857,
	//			"steamid_from": "XXXXXXXXXXXXXXXXX",
	//			"text": ""
	//		},
	//		{
	//			"type": "saytext",
	//			"timestamp" : 17380133,
	//			"utc_timestamp" : 1514974961,
	//			"steamid_from" : "XXXXXXXXXXXXXXXXX",
	//			"text" : "message"
	//		},
	//		{
	//			"type": "personarelationship",
	//			"timestamp" : 7732750,
	//			"utc_timestamp" : 1515187192,
	//			"steamid_from" : "XXXXXXXXXXXXXXXXX",
	//			"status_flags" : 1,
	//			"persona_state" : 2
	//		},
	//		{
	//			"type": "personastate",
	//			"timestamp" : 366860,
	//			"utc_timestamp" : 1515007523,
	//			"steamid_from" : "XXXXXXXXXXXXXXXXX",
	//			"status_flags" : 9055,
	//			"persona_state" : 1,
	//			"persona_name" : "nickname"
	//		},
	//		{
	//			"type": "notificationcountupdate",
	//			"timestamp" : 11605105,
	//			"utc_timestamp" : 1515191064
	//		}
	//	]
	//	,
	//	"messagelast": 4,
	//	"timestamp": 17276041,
	//	"utc_timestamp": 1514974857,
	//	"messagebase": 3,
	//	"sectimeout": 14,
	//	"error": "OK"
	//}

};

#endif //_STEAM_REQUEST_POLL_H_