Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void ULogin::Login()
- {
- FString username = T_Username->GetText().ToString();
- FString password= T_PASSWORD->GetText().ToString();
- if (username.IsEmpty() & password.IsEmpty()) {
- MessageBoxA(NULL, "Username and Password Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
- return;
- }
- else if (username.IsEmpty()) {
- MessageBoxA(NULL, "Username Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
- return;
- }
- else if (password.IsEmpty()) {
- MessageBoxA(NULL, "Password Can´t be Empty", "Login", MB_OK | MB_SYSTEMMODAL);
- return;
- }
- else {
- GameSparks::Core::GS& gs = UGameSparksModule::GetModulePtr()->GetGSInstance();
- GameSparks::Api::Requests::AuthenticationRequest authRequest(gs);
- authRequest.SetUserName(std::string(TCHAR_TO_UTF8(*username)));
- authRequest.SetPassword(std::string(TCHAR_TO_UTF8(*password)));
- authRequest.Send(AuthenticationRequest_Response);
- authRequest.Send([this](GameSparks::Core::GS& gs, const GameSparks::Api::Responses::AuthenticationResponse& response) {
- AuthenticationRequest_Response(gs, response);
- if (!response.GetHasErrors()) {
- GameSparks::Core::GS& gs = UGameSparksModule::GetModulePtr()->GetGSInstance();
- GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::Red, response.GetJSONString().c_str());
- GSRequestData scriptData;
- this->Sucesso();
- //scriptData.AddString("email",std::string(TCHAR_TO_UTF8(*email)));
- //scriptData.AddString("level", "3");
- //Sucesso&;
- //GameSparks::Api::Requests::LogEventRequest forceMessage(gs);
- // forceMessage.SetEventKey("AAAAMessage");
- // forceMessage.Send();
- }
- else {
- GEngine->AddOnScreenDebugMessage(-1, 20.f, FColor::Red, TEXT("ERRO"));
- }
- });
- /* if (!ensure(MenuSwicther != nullptr)) return;
- if (!ensure(Server != nullptr)) return;
- MenuSwicther->SetActiveWidget(Server);
- */
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement