Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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 3057 times)
0 Members and 1 Guest are viewing this topic.
Offline 111poiss111

Senior Newbie





« Posted 2012-11-23 17: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: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #1 - Posted 2012-11-23 17: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

JGO Coder


Medals: 13
Projects: 1


Follower of Nurgle


« Reply #2 - Posted 2012-11-23 18: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!
Legends of Yore - The Casual Retro Roguelike
Offline 111poiss111

Senior Newbie





« Reply #3 - Posted 2012-11-23 19: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 20:04:48 »

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

Offline 111poiss111

Senior Newbie





« Reply #5 - Posted 2012-11-23 20: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 20: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 05: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 16:03:49 »

I am not using kryonet.Yet.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

trollwarrior1 (34 views)
2014-11-22 12:13:56

xFryIx (73 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04

CopyableCougar4 (82 views)
2014-11-01 23:36:41
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!