BAD_REQUEST on Android

0 votes

I try to connect ot my server (server is working fine, I setup a zone and a room).

On Android I always get a BAD_REQUEST response on my connectWithUsername method.

What should I check? I double checked the app key, ip address. For username and token i tried different values (including sending "test" for both)

All I do is this:

WarpClient.initialize("6c9b8599-1f8e-4023-9", "192.168.0.161");
WarpClient.enableTrace(true);
WarpClient.setRecoveryAllowance(60);
warpClient = WarpClient.getInstance();
warpClient.addConnectionRequestListener(this);
warpClient.addZoneRequestListener(this);
warpClient.connectWithUserName("test", "test");
asked Jul 20, 2016 in AppWarpS2 by amarkovits (25 points)

1 Answer

0 votes

Hi Amark,

Greetings!!!!!!!

As AppWarpS2 is extended version of AppWarp, where you can override existing business logic. So there may be a reason that you have overrided handleAddUserRequest method at Zone level, that is responsible for player connectivity with server.

Will you please share the code written in handleAddUserRequest  function, that will help us to trace the problem why you are getting BAD_REQUEST.

Let me know the details.

Thanks

Vishnu Garg

answered Jul 21, 2016 by Vishnu Garg (674 points)
I have no idea what was the problem before but today the same code started to work. I guess I had some connectivity issues on my server.
and now 10 minutes later i'm back to the same error.
The request does not get to server, the problem is something on the client side but I don't know what.
This is my handleAddUserRequest code:
    @Override
    public void handleAddUserRequest(IUser user, String authData, HandlingResult result) {
        try {
            System.out.println("handleAddUserRequest " + user.getName() + " " + authData);
            result.code = WarpResponseResultCode.SUCCESS;
        }catch(Exception e){
            e.printStackTrace();
        }
    }
ok. i found the real problem.
i sent a username that is to long. It contains more than 25 characters. I think this kind of errors should be returned in a better way so developers don't waste days trying to find out what is the problem. also i think the limit of 25 characters should be increased
Yes, there is a validation on userName
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...