AppWarpS2 JoinRoomWithProperties error code 1

0 votes
Hi I'm using AppWarpS2 server with Unity. I can initialise the connectio with the following code:

WarpClient.initialize(GlobalContext.API_KEY, GlobalContext.HOST_NAME);
// Allow for some connection resiliency = 60 seconds
GlobalContext.warpClient = WarpClient.GetInstance();

Then I call connect with the following code:

WarpClient.GetInstance().Connect(GlobalContext.localUsername, "");

In ConnectionListiner onConnectionDone is SUCCESS and I then call:


To join the room but then I get a response back in ConnectionListiner with response code 1 (AUTH_ERROR)...?

My player is not being added to the game room and I don't know why, can you please help with this situation here?

 There is no other user connected at that time and my app is of the correct type! I'm running the server locally and the QuizZoneAdapter is registering the request handleAddUserRequest()!

asked Nov 6, 2015 in Announcements by wiredvoltage (84 points)
edited Nov 6, 2015 by wiredvoltage

1 Answer

0 votes


Can you please provide the code snippet of handleAddUserRequest() function that you are overriding on AppWarpS2 side.

It will help us to trace the exact problem you are facing.

Let me know.


Vishnu Garg


answered Nov 6, 2015 by Vishnu Garg (674 points)
Hi Vishnu, here is the code:

     * Invoked when connect request is received from a client.
     * By default the user will be added to the zone and if user with the  
     * same name exists that user will be disconnected.
     * @param user the user who has sent the connect request.
     * @param authData the authdata passed in the connect request
     * @param result use this to override the default behaviour
    public void handleAddUserRequest(IUser user, String authData, HandlingResult result)
        System.out.println("In handleAddUserRequest()");
        // Below method of finding user fb friend in zone is totally
        // slow and I will need to re-write
            /*If user had joined using his facebook account this function will make
             *list of friends those are playing this game in current zone
            System.out.println("Add user request " + user.getName());
            if (!authData.equals(""))
                    JSONObject statObj = new JSONObject(user.getCustomData());
                    // Get list of user fb friends
                    List fbFriends = Utils.getFacebookFriends(statObj.getString("AccessToken"));
                    // Create a list of IUsers for fb friends
                    ArrayList<IUser> FBFriendsInMyZone = new ArrayList<IUser>();
                    // Create a list of users in this zone
                    Iterator zoneLstIterator =;
                    // Loop for each user in this zone
                    while (zoneLstIterator.hasNext())
                        // Create a IUser object for each user in zone
                        IUser zoneUser = (IUser);
                        // Get user fb id
                        String fbId = new JSONObject(zoneUser.getCustomData()).getString("FacebookId");
                        // Create an iterator for user fb friends from user fb firend list
                        Iterator lstIterator = fbFriends.listIterator();
                        // Loop for each user fb friend
                        while (lstIterator.hasNext())
                            // Check if the current zone user is user fb friend as we loop through
                            User fbuser = (User);
                            if (fbId.equals(fbuser.getId()))
                                // It is user fb friend so add them to our friend list
                    // Create a JSON user array
                    JSONArray usersArray = new JSONArray();
                    // Loop for each user friend we found in zone
                    for (int i = 0; i < FBFriendsInMyZone.size(); i++)
                        JSONObject objPayload = new JSONObject();
                        // Add user fb friend name to JSONObject
                        objPayload.put("username", FBFriendsInMyZone.get(i).getName());
                        // Add user fb friend custom data and fb id to JSONObject
                        objPayload.put("facebookId", new JSONObject(FBFriendsInMyZone.get(i).getCustomData()).getString("FacebookId"));
                        // Add each user fb friend JSONObject to our JSONArray
                    // Create byte array of user fb friend list
                    int Length = 40 + usersArray.toString().getBytes().length;
                    IoBuffer buf = IoBuffer.allocate(Length);
                    // Broadcast user fb friend list byte array to client
                    user.SendUpdatePeersNotification(buf.array(), false);
                catch (Exception e)
        catch (Exception e)

I have a native WP app that connects to the same game on server which works fine! I am currently working on developing the Unity version and dropping the WP only app when finished.

On which platform you are facing this issue with Unity.
Hi Vishnu, the problem has been solved. Thanks for your help.

I found that both events that initialises the connection to AppWarpS2 server and then to connect were defined twice in the constructor, apologies I totally missed this as it happened when uploading scripts to BitBucket and they were not resolved on upload so they got duplicated!

Let me know if more queries are concern. Thanks
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