W
W
Wolframius2017-06-20 10:22:31
Parsing
Wolframius, 2017-06-20 10:22:31

How to login to spaces.ru?

I am making an android client for the game nebo.mobi. There are people who play through spaces.ru and I need to add the ability to enter through it.
I send the nickname to the game server and if it's registered via spaces it returns me the login page through it. I'm parsing this page by taking out the login form and fields (input) with the names sid and ck, also taking the action. I take login (contact) and password (password) from EditText. I use Volley to connect. Here is the method to enter via spaces

private void spacesAuth(final String login, final String password, final String sid, final String ck){
    Log.d("#*", spaces_action);
    Response.Listener<String> responseSuccess = new Response.Listener<String>(){
      @Override
      public void onResponse(String response)
      {
        pd.dismiss();
        Document doc = Jsoup.parse(response);
        String pageText = doc.text();
        Log.d("#*", doc.text());
      };
    };
    Response.ErrorListener responseFailed = new Response.ErrorListener(){
      @Override
      public void onErrorResponse(VolleyError error)
      {
        pd.dismiss();
        Log.d("#*", error.toString());
        Toast.makeText(ctx, "Ошибка подключения к Интернету", Toast.LENGTH_SHORT).show();
      }
    };

    StringRequest request = new StringRequest(Request.Method.POST, spaces_action, responseSuccess, responseFailed){
      @Override
      protected Map<String, String> getParams()
      {
        Map<String, String> params = new HashMap<String, String>();
        params.put("contact", login);
        params.put("password", password);
        params.put("sid", sid);
        params.put("CK", ck);
        return params;
      }
    };
    App.getInstance().getRequestQueue().add(request);
  }

All data comes to the method correctly. The server returns the same login page to me (without any warnings). Why is that and how can I enter spaces?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
romaaa32, 2018-08-19
@romaaa32

Were you able to log in?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question