Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Slick game freezes  (Read 1625 times)
0 Members and 1 Guest are viewing this topic.
Offline 111poiss111

Senior Newbie





« Posted 2012-11-23 18:52:01 »

Hi.I made a turn based card game(or at least beginning of it) in Slick2d.I wanted it to be multiplayer so I used same code that thenewboston uses for his internet chat.Did little edits and tested.Right now when I run the game without network it works fine.But when I run it with server,it connects fine and when I send messages to client they all show up in console but game window itself is not responding.Hope you understand.Here is the pastebin of networking class http://pastebin.com/A0XEg4y0
Offline Mads

JGO Ninja


Medals: 23
Projects: 3


One for all!


« Reply #1 - Posted 2012-11-23 18:55:24 »

If you're using Eclipse (perhaps other IDE's have this feature aswell), you can execute the program line by line to debug, and see where the code fails to do what you intended.

Here's how!

Offline Gjallar

Senior Member


Medals: 7


Follower of Nurgle


« Reply #2 - Posted 2012-11-23 19:05:04 »

it connects fine and when I send messages to client they all show up in console but game window itself is not responding.

When the networking code works fine but the game window starts freezing you might want to show us that class aswell.
Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline 111poiss111

Senior Newbie





« Reply #3 - Posted 2012-11-23 20:11:18 »

http://pastebin.com/T0v45yUa here is code of the game state.BTW,when I close server the game unfreezes again.
Could the problem be that my computer has java 7 but my project is in JavaSE-1.6
Offline Cero
« Reply #4 - Posted 2012-11-23 21:04:48 »

not responding always sound like a loop not finishing...

Offline 111poiss111

Senior Newbie





« Reply #5 - Posted 2012-11-23 21:34:53 »

I think it might be do loop around whileChatting that freezes,but I cant find any workarounds for that
Offline Cero
« Reply #6 - Posted 2012-11-23 21:47:03 »

I think it might be do loop around whileChatting that freezes,but I cant find any workarounds for that

its pretty annoying but you have to for example debug by using a lot of sysout's and find where it gets stuck

or with eclipse and breakpoints

Offline Phased
« Reply #7 - Posted 2012-11-24 06:25:25 »

When I first started with kryonet it was freezing she. Try connect, it turned out the server wasn't allowing new connections, when the other client disconnected the frozen client would unfreeze and be connected to the server. Maybe you should check the user connection on the server side.
Offline 111poiss111

Senior Newbie





« Reply #8 - Posted 2012-11-24 17:03:49 »

I am not using kryonet.Yet.
Pages: [1]
  ignore  |  Print  
 
 

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (60 views)
2013-05-17 21:29:12

alaslipknot (69 views)
2013-05-16 21:24:48

gouessej (99 views)
2013-05-16 00:53:38

gouessej (98 views)
2013-05-16 00:17:58

theagentd (107 views)
2013-05-15 15:01:13

theagentd (98 views)
2013-05-15 15:00:54

StreetDoggy (144 views)
2013-05-14 15:56:26

kutucuk (167 views)
2013-05-12 17:10:36

kutucuk (166 views)
2013-05-12 15:36:09

UnluckyDevil (175 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.231 seconds with 21 queries.