StovePCMatchmaking(Native dll)  1.0.4.1
StovePCMatchmakingInternal.h
1 //=============================================================================
2 // File : Matchmaking_Callback_Internal.h
3 //
4 // Description :
5 // Author :
6 //
7 // Copyright (c) 2019,
8 //=============================================================================
9 
10 #ifndef STOVEPCMATCHMAKINGINTERNAL_H_
11 #define STOVEPCMATCHMAKINGINTERNAL_H_
12 
13 
14 #include <cstdint>
15 #include <string>
16 #include <windows.h>
17 #include <api\ChatAppCommon.h>
19 
20 #ifndef UNREFERENCED_PARAMETER
21 #define UNREFERENCED_PARAMETER(P) (P)
22 #endif
23 
24 #ifndef callId_t
25 // call id 타입
26 typedef int callId_t;
27 #endif
28 
29 void __stdcall OnDisconnect(CT::chatApp::RespDisconnect_t& ret);
30 void __stdcall OnConnect(CT::chatApp::RespConnect_t& ret);
31 void __stdcall OnUserJoin(CT::chatApp::RespUserJoin_t& ret);
32 void __stdcall OnUserLeave(CT::chatApp::RespUserLeave_t& ret);
33 void __stdcall OnJoinLobby(CT::chatApp::RespJoinChannel_t& ret);
34 void __stdcall OnLeaveLobby(CT::chatApp::RespLeaveChannel_t& ret);
35 void __stdcall OnGetMyLobbyList(CT::chatApp::RespGetMyChannelList_t& ret);
36 void __stdcall OnGetLobbyUserList(CT::chatApp::RespGetChannelUserList_t& ret);
37 void __stdcall OnGetLobbyBanUserList(CT::chatApp::RespGetChannelBanUserList_t& ret);
38 void __stdcall OnGetLobbyList(CT::chatApp::RespGetChannelList_t& ret);
39 void __stdcall OnSystemMessage(CT::chatApp::RespSystemMessage_t& ret);
40 void __stdcall OnSendUserMessage(CT::chatApp::RespUserMessage_t& ret);
41 void __stdcall OnRecvUserMessage(CT::chatApp::RespUserMessage_t& ret);
42 void __stdcall OnSendUserBinarydata(CT::chatApp::RespUserBinarydata_t& ret);
43 void __stdcall OnRecvUserBinarydata(CT::chatApp::RespUserBinarydata_t& ret);
44 void __stdcall OnSendLobbyMessage(CT::chatApp::RespChannelMessage_t& ret);
45 void __stdcall OnRecvLobbyMessage(CT::chatApp::RespChannelMessage_t& ret);
46 void __stdcall OnRecvLobbyBinarydata(CT::chatApp::RespChannelBinarydata_t& ret);
47 void __stdcall OnSendLobbyBinarydata(CT::chatApp::RespChannelBinarydata_t& ret);
48 void __stdcall OnSendLobbyInvitation(CT::chatApp::RespChannelInvitation_t& ret);
49 void __stdcall OnRecvLobbyInvitation(CT::chatApp::RespChannelInvitation_t& ret);
50 void __stdcall OnSendRejectLobbyInvitation(CT::chatApp::RespRejectChannelInvitation_t& ret);
51 void __stdcall OnRecvRejectLobbyInvitation(CT::chatApp::RespRejectChannelInvitation_t& ret);
52 void __stdcall OnCreateLobby(CT::chatApp::RespCreateChannel_t& ret);
53 void __stdcall OnDestroyLobby(CT::chatApp::RespDestroyChannel_t& ret);
54 void __stdcall OnKickUser(CT::chatApp::RespKickUser_t& ret);
55 void __stdcall OnBanUser(CT::chatApp::RespBanUser_t& ret);
56 void __stdcall OnUnBanUser(CT::chatApp::RespUnBanUser_t& ret);
57 void __stdcall OnSetAffiliation(CT::chatApp::RespSetAffiliation_t& ret);
58 void __stdcall OnSetLobbyOwner(CT::chatApp::RespHandoverOwner_t& ret);
59 void __stdcall OnSetMuteUser(CT::chatApp::RespSetMuteUser_t& ret);
60 void __stdcall OnPresenceChange(CT::chatApp::RespPresenceChange_t& ret);
61 void __stdcall OnSetLobbyUserdata(CT::chatApp::RespSetMyChannelMetadata_t& ret);
62 void __stdcall OnLobbyPresenceChange(CT::chatApp::RespChannelPresenceChange_t& ret);
63 void __stdcall OnSetLobbyData(CT::chatApp::RespSetChannelMetaConfig_t& ret);
64 void __stdcall OnGetLobbyData(CT::chatApp::RespGetChannelMetaConfig_t& ret);
65 
66 void __stdcall OnSearchLobbyList(CT::chatApp::RespSearchChannelList_t& ret);
67 
68 void __stdcall OnSetChannelConfig(CT::chatApp::RespSetChannelConfig_t& ret);
69 void __stdcall OnGetChannelConfig(CT::chatApp::RespGetChannelConfig_t& ret);
70 
71 void __stdcall OnStartGame(CT::chatApp::RespStartGame_t& ret);
72 void __stdcall OnEndGame(CT::chatApp::RespEndGame_t& ret);
73 void __stdcall OnLobbyCommand(CT::chatApp::RespLobbyCommand_t& ret);
74 
75 void __stdcall OnGetFriendsList(CT::chatApp::RespGetFriendsList_t& ret);
76 void __stdcall OnUserStatusChanged(CT::chatApp::RespUserStatusChanged_t& ret);
77 
78 const unsigned __int64 JidToUID(const std::wstring& jid);
79 const std::wstring UIDToJid(const unsigned __int64 UID, const std::wstring& domain);
80 const std::wstring JidToId(const std::wstring& jid);
81 const std::wstring IdToJid(const std::wstring& id, const std::wstring& domain);
82 std::string GetRestApi(const std::string& uri, std::vector<std::string> headers);
83 
84 extern StovePCMatchmakingCallback g_callback;
85 
87 {
88  // 토큰
89  const char* accessToken;
90 
91  // 테스트 환경
92  const char* env;
93 
94  // 게임 아이디
95  const char* gameID;
96 
97  // 유저 아이디
98  unsigned __int64 UID;
99 };
100 
102 {
103  // 토큰 재 갱신 콜백
104  void(*OnRenewToken)(const char*);
105 };
106 
108 {
109 public:
111 
112  // dll 로팅
113  bool DllLoading(const std::wstring& path, const std::wstring& fileName);
114  bool DllFunctionCall(const std::string& funcName);
115  void DllClose();
116 
117  // 리소스 서버 json 로딩
118  bool ResourceSvrLoading();
119 
120 public:
121  void SetAccessToken(const std::string& token)
122  {
123  _accessToken = token;
124  }
125  const std::string GetAccessToken()
126  {
127  return _accessToken;
128  }
129  void SetUID(unsigned __int64 id)
130  {
131  _UID = id;
132  }
133  unsigned __int64 GetUID()
134  {
135  return _UID;
136  }
137  void SetGameID(const std::string& gid)
138  {
139  _gameID = gid;
140  }
141  const std::string GetGameID()
142  {
143  return _gameID;
144  }
145  void SetEnvironment(const std::string& env);
146  const std::string GetEnvironment()
147  {
148  return _env;
149  }
150  void SetSvrJson(const std::string& json)
151  {
152  _resourceSvrJson = json;
153  }
154  const std::string GetSvrJson()
155  {
156  return _resourceSvrJson;
157  }
158  void SetDomain(const std::string& domain)
159  {
160  _domain = domain;
161  }
162  const std::string GetDomain()
163  {
164  return _domain;
165  }
166  const std::wstring GetDomainW();
167  void SetServer(const std::string& host, int port)
168  {
169  _server = host + ":" + std::to_string(port);
170  }
171  const std::string GetServer()
172  {
173  return _server;
174  }
175 
176  const char* GetAccessTokenPtr()
177  {
178  return _accessToken.c_str();
179  }
180  const char* GetGameIDPtr()
181  {
182  return _gameID.c_str();
183  }
184  const char* GetEnvironmentPtr()
185  {
186  return _env.c_str();
187  }
188  const char* GetDomainPtr()
189  {
190  return _domain.c_str();
191  }
192  const char* GetServerPtr()
193  {
194  return _server.c_str();
195  }
196  void SetLogLevel(int logLevel)
197  {
198  _logLevel = logLevel;
199  }
200  int GetLogLevel()
201  {
202  return _logLevel;
203  }
204 
205 private:
206  HINSTANCE _hDLL;
207 
208  std::string _accessToken;
209  unsigned __int64 _UID;
210  std::string _gameID;
211  std::string _env;
212  std::string _resourceSvrJson;
213  std::string _domain;
214  std::string _server;
215  int _logLevel;
216 };
217 
218 typedef const StovePCAddIn(*LPRegisterAddInCallback)(const StovePCAddInCallback& callback);
219 
220 void OnRenewToken(const char*);
221 
222 extern StovePCSDKMatchmakingConfig g_sdkConfig;
223 
224 #endif //STOVEPCMATCHMAKINGINTERNAL_H_
Definition: StovePCMatchmakingInternal.h:101
Definition: StovePCMatchmakingInternal.h:107
StovePCMatchmakingCallback 헤더파일
Definition: StovePCMatchmakingInternal.h:86
API 호출시 응답받는 콜백을 설정하는 구조체입니다.
Definition: StovePCMatchmakingCallback.h:642