private void GetAuthToken() { ServerAPI serverAPI = Service.ServerAPI; if (this.useRealAuthentication) { string requestToken = ServerStartupTask.GenerateRequestToken(PlayerPrefs.GetString("prefPlayerId"), PlayerPrefs.GetString("prefPlayerSecret")); this.getAuthTokenCommand = new GetAuthTokenCommand(new GetAuthTokenRequest { PlayerId = PlayerPrefs.GetString("prefPlayerId"), RequestToken = requestToken }); this.getAuthTokenCommand.AddSuccessCallback(new AbstractCommand <GetAuthTokenRequest, GetAuthTokenResponse> .OnSuccessCallback(this.OnGetAuthTokenComplete)); serverAPI.Async(this.getAuthTokenCommand); } else { this.InitializeCurrentPlayer(); string playerId = Service.CurrentPlayer.PlayerId; serverAPI.SetAuth(playerId); this.CompleteTask(); } }
public unsafe static long $Invoke4(long instance, long *args) { return(GCHandledObjects.ObjectToGCHandle(ServerStartupTask.GenerateRequestToken(Marshal.PtrToStringUni(*(IntPtr *)args), Marshal.PtrToStringUni(*(IntPtr *)(args + 1))))); }