Advertisement
Guest User

Untitled

a guest
Dec 5th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. void ULogin::Login()
  2. {
  3.  
  4. FString username = T_Username->GetText().ToString();
  5. FString password= T_PASSWORD->GetText().ToString();
  6.  
  7. if (username.IsEmpty() & password.IsEmpty()) {
  8. MessageBoxA(NULL, "Username and Password Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
  9. return;
  10. }
  11. else if (username.IsEmpty()) {
  12. MessageBoxA(NULL, "Username Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
  13. return;
  14. }
  15. else if (password.IsEmpty()) {
  16. MessageBoxA(NULL, "Password Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
  17. return;
  18. }
  19. else {
  20. GameSparks::Core::GS& gs = UGameSparksModule::GetModulePtr()->GetGSInstance();
  21. GameSparks::Api::Requests::AuthenticationRequest authRequest(gs);
  22. authRequest.SetUserName(std::string(TCHAR_TO_UTF8(*username)));
  23. authRequest.SetPassword(std::string(TCHAR_TO_UTF8(*password)));
  24. authRequest.Send(AuthenticationRequest_Response);
  25. authRequest.Send([this](GameSparks::Core::GS& gs, const GameSparks::Api::Responses::AuthenticationResponse& response) {
  26. AuthenticationRequest_Response(gs, response);
  27. if (!response.GetHasErrors()) {
  28. GameSparks::Core::GS& gs = UGameSparksModule::GetModulePtr()->GetGSInstance();
  29. GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::Red, response.GetJSONString().c_str());
  30.  
  31.  
  32. GSRequestData scriptData;
  33.  
  34. this->Sucesso();
  35.  
  36. //scriptData.AddString("email",std::string(TCHAR_TO_UTF8(*email)));
  37. //scriptData.AddString("level", "3");
  38. //Sucesso&;
  39. //GameSparks::Api::Requests::LogEventRequest forceMessage(gs);
  40.  
  41. // forceMessage.SetEventKey("AAAAMessage");
  42. // forceMessage.Send();
  43. }
  44. else {
  45. GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::Red, TEXT("ERRO"));
  46. }
  47.  
  48.  
  49. });
  50. /* if (!ensure(MenuSwicther != nullptr)) return;
  51. if (!ensure(Server != nullptr)) return;
  52. MenuSwicther->SetActiveWidget(Server);
  53. */
  54.  
  55.  
  56. }
  57.  
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement