@@ -471,20 +471,82 @@ cell_t GetClientCookieTime(IPluginContext *pContext, const cell_t *params)
471471 return value;
472472}
473473
474+ static cell_t Cookie_Set (IPluginContext *pContext, const cell_t *params)
475+ {
476+ // This version takes (handle, client, value). The original is (client, handle, value).
477+ const cell_t new_params[4 ] = {
478+ 3 ,
479+ params[2 ],
480+ params[1 ],
481+ params[3 ]
482+ };
483+
484+ return SetClientPrefCookie (pContext, new_params);
485+ }
486+
487+ static cell_t Cookie_Get (IPluginContext *pContext, const cell_t *params)
488+ {
489+ // This verson takes (handle, client, buffer, maxlen). The original is (client, handle, buffer, maxlen).
490+ const cell_t new_params[5 ] = {
491+ 4 ,
492+ params[2 ],
493+ params[1 ],
494+ params[3 ],
495+ params[4 ]
496+ };
497+
498+ return GetClientPrefCookie (pContext, new_params);
499+ }
500+
501+ static cell_t Cookie_SetByAuthId (IPluginContext *pContext, const cell_t *params)
502+ {
503+ // This version takes (handle, authid, value). The original is (authid, handle, value).
504+ const cell_t new_params[4 ] = {
505+ 3 ,
506+ params[2 ],
507+ params[1 ],
508+ params[3 ]
509+ };
510+
511+ return SetAuthIdCookie (pContext, new_params);
512+ }
513+
514+ static cell_t Cookie_GetClientTime (IPluginContext *pContext, const cell_t *params)
515+ {
516+ // This version takes (handle, client). The original is (client, handle)
517+ const cell_t new_params[3 ] = {
518+ 2 ,
519+ params[2 ],
520+ params[1 ],
521+ };
522+
523+ return GetClientCookieTime (pContext, new_params);
524+ }
525+
474526sp_nativeinfo_t g_ClientPrefNatives[] =
475527{
476- {" RegClientCookie" , RegClientPrefCookie},
477- {" FindClientCookie" , FindClientPrefCookie},
478- {" SetClientCookie" , SetClientPrefCookie},
479- {" SetAuthIdCookie" , SetAuthIdCookie},
480- {" GetClientCookie" , GetClientPrefCookie},
481- {" AreClientCookiesCached" , AreClientCookiesCached},
482- {" GetCookieAccess" , GetCookieAccess},
483- {" ReadCookieIterator" , ReadCookieIterator},
484- {" GetCookieIterator" , GetCookieIterator},
485- {" ShowCookieMenu" , ShowSettingsMenu},
486- {" SetCookieMenuItem" , AddSettingsMenuItem},
487- {" SetCookiePrefabMenu" , AddSettingsPrefabMenuItem},
528+ {" RegClientCookie" , RegClientPrefCookie},
529+ {" FindClientCookie" , FindClientPrefCookie},
530+ {" SetClientCookie" , SetClientPrefCookie},
531+ {" SetAuthIdCookie" , SetAuthIdCookie},
532+ {" GetClientCookie" , GetClientPrefCookie},
533+ {" AreClientCookiesCached" , AreClientCookiesCached},
534+ {" GetCookieAccess" , GetCookieAccess},
535+ {" ReadCookieIterator" , ReadCookieIterator},
536+ {" GetCookieIterator" , GetCookieIterator},
537+ {" ShowCookieMenu" , ShowSettingsMenu},
538+ {" SetCookieMenuItem" , AddSettingsMenuItem},
539+ {" SetCookiePrefabMenu" , AddSettingsPrefabMenuItem},
488540 {" GetClientCookieTime" , GetClientCookieTime},
489- {NULL , NULL }
541+
542+ {" Cookie.Cookie" , RegClientPrefCookie},
543+ {" Cookie.Find" , FindClientPrefCookie},
544+ {" Cookie.Set" , Cookie_Set},
545+ {" Cookie.Get" , Cookie_Get},
546+ {" Cookie.SetByAuthId" , Cookie_SetByAuthId},
547+ {" Cookie.SetPrefabMenu" , AddSettingsPrefabMenuItem},
548+ {" Cookie.GetClientTime" , Cookie_GetClientTime},
549+ {" Cookie.AccessLevel.get" , GetCookieAccess},
550+
551+ {NULL , NULL }
490552};
0 commit comments