lobby room

281 views
Skip to first unread message

Максим Шокавин

unread,
Dec 15, 2014, 9:38:12 AM12/15/14
to jets...@googlegroups.com
How can I disconnect from lobby and connect to another room?

Максим Шокавин

unread,
Dec 15, 2014, 11:07:16 AM12/15/14
to jets...@googlegroups.com
I have a  lits of rooms in my lobby, and I tried to disconnect  from lobby and connect to another room from list using oneRoom.diconnect(Playersession), anotherRoom.connect(PlayerSession) Then, when I tried to send something, I have exeption:
DefaultToClientHandler Exception occurred in tcp channel: java.lang.NullPointerException

понедельник, 15 декабря 2014 г., 17:38:12 UTC+3 пользователь Максим Шокавин написал:

abraham menacherry

unread,
Dec 15, 2014, 1:45:25 PM12/15/14
to jets...@googlegroups.com
 I *think* you may not be applying a network protocol after connecting to new room. Please checkout the following unit test for session disconnect.

The last 2 tests in this file are for session disconnect/reconnect scenarios. See if all the steps are being followed. Let me know if you need further assistance.

Thanks,
Abraham.

--
You received this message because you are subscribed to the Google Groups "jetserver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jetserver+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Максим Шокавин

unread,
Dec 15, 2014, 5:01:20 PM12/15/14
to jets...@googlegroups.com

Thank you for your help. The problem was  with the protocol. Now the problem with gameRoom.sendBrodkast. The room has two clients and this function sends messages selectively. Typically, a client who first connected recieved almost all events. The second practically does not receive.

понедельник, 15 декабря 2014 г., 21:45:25 UTC+3 пользователь Abraham Menacherry написал:

abraham menacherry

unread,
Dec 17, 2014, 9:46:15 AM12/17/14
to jets...@googlegroups.com
Hi,

Check out this unit test where multiple handlers are added to each game room and the number of events verified. https://github.com/menacher/java-game-server/blob/netty4/nadron/src/test/java/io/nadron/app/impl/PlayerSessionTest.java

I don't have a unit test specifically for gameroom.sendBroadcast, but this test internally invokes that code. However this file does the sendBroadcast in an integration test scenario and it is working fine https://github.com/menacher/java-game-server/blob/netty4/example-games/src/main/java/io/nadron/example/lostdecade/LDRoom.java
So there could be 2 possibilities here.
1. sendBroadcast has a bug and somehow not sending the request to second client.
2. The listener of the second client is misconfigured and is not listening for the second message.

I would suggest that you just debug the LDRoom and see how the listeners are added and broadcast is sent. Compare it with your code to see if something is missing.

Thanks,
Abraham.
Reply all
Reply to author
Forward
0 new messages