@@ -36,6 +36,36 @@ cell AMX_NATIVE_CALL REU_GetAuthtype(AMX *amx, cell *params)
36
36
return g_ReunionApi->GetClientAuthtype (params[arg_index] - 1 );
37
37
}
38
38
39
+ /*
40
+ * Get client authkey
41
+ *
42
+ * @param index Client index
43
+ * @param index Buffer to copy the authkey
44
+ * @param index Maximum buffer size
45
+ *
46
+ * @return Number of cells copied to buffer
47
+ *
48
+ * native REU_GetAuthKey(const index, dest[], maxlen);
49
+ */
50
+ cell AMX_NATIVE_CALL REU_GetAuthKey (AMX *amx, cell *params)
51
+ {
52
+ enum args_e { arg_count, arg_index, arg_output, arg_maxlen };
53
+
54
+ CHECK_ISPLAYER (arg_index);
55
+
56
+ int clientId = params[arg_index] - 1 ;
57
+
58
+ char buffer[256 ];
59
+ size_t size = g_ReunionApi->GetClientAuthdata (clientId, buffer, sizeof buffer);
60
+ if (size <= 0 )
61
+ return 0 ;
62
+
63
+ size_t numToCopy = min<size_t >(size, params[arg_maxlen]);
64
+ cell *dest = getAmxAddr (amx, params[arg_output]);
65
+ setAmxString (dest, buffer, numToCopy);
66
+ return numToCopy;
67
+ }
68
+
39
69
/*
40
70
* Check if the client is running RevEmu with limited user rights.
41
71
*
@@ -70,6 +100,7 @@ AMX_NATIVE_INFO Reunion_Natives[] =
70
100
{
71
101
{ " REU_GetProtocol" , REU_GetProtocol },
72
102
{ " REU_GetAuthtype" , REU_GetAuthtype },
103
+ { " REU_GetAuthKey" , REU_GetAuthKey },
73
104
{ " REU_IsRevemuWithoutAdminRights" , REU_IsRevemuWithoutAdminRights },
74
105
75
106
{ nullptr , nullptr }
0 commit comments