iFun Engine API  1.0.0-b6053
Great Technology for Great Games
authentication.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 
9 #ifndef INCLUDE_FUNAPI_SERVICE_AUTHENTICATION_H_
10 #define INCLUDE_FUNAPI_SERVICE_AUTHENTICATION_H_
11 
12 #include <funapi/player_account.h>
13 #include <funapi/types.h>
14 
15 
16 namespace fun {
17 
18 typedef string AuthenticationKey;
19 
20 
21 // MakeFacebookAuthenticationKey is deprecated
22 // please use FacebookAuthenticationRequest instead.
23 FUNAPI_DLL_VISIBILITY
24 AuthenticationKey MakeFacebookAuthenticationKey(
25  const string &facebook_access_token);
26 
27 
28 // MakeGooglePlusAuthenticationKey is deprecated
29 // please use GooglePlusAuthenticationRequest instead.
30 FUNAPI_DLL_VISIBILITY
31 AuthenticationKey MakeGooglePlusAuthenticationKey(
32  const string &google_client_id,
33  const string &google_access_token);
34 
35 
36 // MakeNexonToyAuthenticationKey is deprecated
37 // please use NexonToyAuthenticationRequest instead.
38 FUNAPI_DLL_VISIBILITY
39 AuthenticationKey MakeNexonToyAuthenticationKey(
40  int64_t svc_id,
41  const string &client_id,
42  const string &np_sn,
43  const string &np_token);
44 
45 
46 struct FUNAPI_DLL_VISIBILITY AccountAuthenticationRequest {
47  AccountAuthenticationRequest(const string &service_provider,
48  const string &local_account,
49  const AuthenticationKey &key);
50 
51  PlayerAccount player_account;
52  AuthenticationKey authentication_key;
53 };
54 
55 
56 struct FUNAPI_DLL_VISIBILITY AccountAuthenticationResponse {
58  AccountAuthenticationResponse(const int64_t &response_reason_code,
59  const string &response_reason_description);
60 
61  bool success;
62  int64_t reason_code;
63  string reason_description;
64 };
65 
66 
67 struct FUNAPI_DLL_VISIBILITY AccountPersonalInfoRequest {
68  AccountPersonalInfoRequest(const string &service_provider,
69  const string &local_account,
70  const AuthenticationKey &key);
71 
72  PlayerAccount player_account;
73  AuthenticationKey authentication_key;
74 };
75 
76 
77 struct FUNAPI_DLL_VISIBILITY AccountPersonalInfoResponse {
79  explicit AccountPersonalInfoResponse(
80  const PlayerAccountVector &friend_accounts);
81  AccountPersonalInfoResponse(
82  const int64_t &response_reason_code,
83  const string &response_reason_description);
84 
85  bool success;
86  int64_t reason_code;
87  string reason_description;
88  PlayerAccountVector friends;
89 };
90 
91 
92 typedef function<void(const AccountAuthenticationRequest &request,
93  const AccountAuthenticationResponse &response,
94  const bool &error)> AuthenticationResponseHandler;
95 
96 
97 typedef function<void(const AccountPersonalInfoRequest &request,
98  const AccountPersonalInfoResponse &response,
99  const bool &error)> PersonalInfoResponseHandler;
100 
101 
102 // Authenticate is deprecated,
103 // please use Authenticate in {platform}_authentication.h instead.
104 FUNAPI_DLL_VISIBILITY
105 void Authenticate(const AccountAuthenticationRequest &request,
106  const AuthenticationResponseHandler &handler);
107 // AuthenticateSync is deprecated,
108 // please use AuthenticateSync in {platform}_authentication.h instead.
109 FUNAPI_DLL_VISIBILITY
110 bool AuthenticateSync(const AccountAuthenticationRequest &request,
112 
113 // GetPersonalInfo is deprecated,
114 // please use GetPersonalInfo in {platform}_authentication.h instead.
115 FUNAPI_DLL_VISIBILITY
116 void GetPersonalInfo(const AccountPersonalInfoRequest &request,
117  const PersonalInfoResponseHandler &handler);
118 // GetPersonalInfoSync is deprecated,
119 // please use GetPersonalInfoSync in {platform}_authentication.h instead.
120 FUNAPI_DLL_VISIBILITY
121 bool GetPersonalInfoSync(const AccountPersonalInfoRequest &request,
122  AccountPersonalInfoResponse *response);
123 
124 } // namespace fun
125 
126 #endif // INCLUDE_FUNAPI_SERVICE_AUTHENTICATION_H_
Account Id.
Definition: player_account.h:20
Definition: authentication.h:46
Definition: json.h:18
Definition: authentication.h:67
Definition: authentication.h:77
Definition: authentication.h:56