User gets removed after joining the room immediately

0 votes

Hi,

We are having an issue while connecting the app warp client, we are getting connection error 5.

System.out.println("RoomCreated By user :: " + QuizUtils.roomCreatedByUser.getName());
room.setAdaptor(new QuizRoomAdaptor(this.zone, room));

It stops just before room.setadaptor gets called and the users are removed.

Please guide us.

Below are the client logs:

AppWarpTrace: NSStreamEventEndEncountered
AppWarpTrace: -[WarpClient onConnect:]..value=0...connectionState=0..sessionId=1922542432
AppWarpTrace: -[WarpClient raiseConnectionListenerWithResult:]..result=5
onConnectDone Connection failed 5

 

asked Dec 31, 2015 in AppWarp by jitesh.h.lalwani (20 points)

2 Answers

0 votes
Hello Jitesh,

Can you share your server side code with us on support@shephertz.com, so that we can look into it to debug the problem you are facing?

Thanks.
answered Jan 3, 2016 by rajeev.etc (1,660 points)
0 votes

Hi Jitesh,

Thanks for code sharing. After going through with the server side code I have modified Room Creation code snippet that will help to override the AppWarpS2 functionality.

@Override
    public void handleCreateRoomRequest(IUser user, IRoom room, HandlingResult result) {
            System.out.println("Room Created " + room.getName() + " by " + user.getName() + " with ID " + room.getId() + " Max users in the room :: " + room.getMaxUsers());
            QuizUtils.roomCreatedByUser = user;
            System.out.println("RoomCreated By user :: " + QuizUtils.roomCreatedByUser.getName());
            System.out.println(this.zone.getName() + " - rooms :: " + this.zone.getRooms().size() + " - users :: " + this.zone.getUsers().size() );
            room.setAdaptor(new QuizRoomAdaptor(this.zone, (ITurnBasedRoom) room));
    }

You can directly replace the above function code in QuizZoneAdaptor.java class.


Please don't  use static variable to save room owner name like : "QuizUtils.roomCreatedByUser = user"
It can create several conflicts when multiple users want to create a Room on server, at that time that variable is updated and again there may be issue in functionality.

You can avoid this by using Map with Room-ID as a key and Owner as a value.

Let me know if more queries are concern.

Thanks & Regards
Vishnu Garg
AppWarp Support Team

 

answered Jan 4, 2016 by Vishnu Garg (674 points)
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
...