Closed ecnivo closed 8 years ago
Pretty sure this is a problem with your client, we're sending the correct message ($ 1 bets 10).
If the server is crashing / throwing exceptions, regardless of what the clients are doing, this might be an actual bug. This will be investigated + fixed tonight.
This looks like the message queue is trying to remove a message when there are no messages left. This is potentially due to synchronization issues (with messages being added + removed at the same time from different threads)
Just add an if statement with queue.size. it should fix it. This wont fix the problem if some messages arent being queued at all. On Dec 8, 2015 1:50 PM, "Bimesh De Silva" notifications@github.com wrote:
This looks like the message queue is trying to remove a message when there are no messages left. This is potentially due to synchronization issues (with messages being added + removed at the same time from different threads)
— Reply to this email directly or view it on GitHub https://github.com/Bimde/Blackjack-Server/issues/35#issuecomment-162978727 .
Whoops, I misread this. Thought this was the console output of a client rather than a server.
@Williamxu98 This is already being done (look at the Server#actionPerformed method). The problem is probably related to the message queue being changed in between the check and removing the message from the queue. A potential solution is to use a different data structure that is thread safe. I.e. a LinkedBlockingDeque
@ecnivo Was this using the latest version (after our discussion about using master)? And is it possible to reproduce this error?
He was using an outdated version when he showed me the error. Try reproducing it in the new version On Dec 8, 2015 2:10 PM, "Bimesh De Silva" notifications@github.com wrote:
@ecnivo https://github.com/ecnivo Was this using the latest version (after our discussion about using master)? And is it possible to reproduce this error?
— Reply to this email directly or view it on GitHub https://github.com/Bimde/Blackjack-Server/issues/35#issuecomment-162984874 .
I pulled master during fifth and it was broken af, but I'm on stable at home (latest), and I haven't seen anything weird.
Could you send logs of what is broken with master?
Nothing. I pressed "run" and nothing was printed, and it just stopped running. Now it's fine.
Silly me, I didn't realize that you guys had more game rooms and ran Server instead of CentralServer.
I don't know what happened, but you should probably know about this in some way, shape, or form.