Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
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  
  Applet which loads a map from a server  (Read 793 times)
0 Members and 1 Guest are viewing this topic.
Offline Embedded

Junior Member


Medals: 1



« Posted 2011-11-12 19:58:00 »

Hey this is my first post here it goes,

Ive made a 2D game where you control a circle man and shoot, the background of the game is made up of 32x32 tiles and it runs as an applet. I made a server program which loads lots of numbers from a file and stores them in a big integer array. Then once you load up the client game it connects to the server and downloads the big integer array from the server. Basicly every number represents a tile with diffrent properties exct that is used to lay out the map.

I complied the server and am running it by itself, and then i load the applet in eclipse and it works however when i run the applet in an actual browser (ive tried firefox and IE) it doesnt load the map, it runs but the map is blank meaning something has gone wrong getting the integer array from the server. Now i think this problem is probably something todo with security i dont know about ive tried disabling firewall on my computer and the port is fowarded correctly, as it works in eclipse.

any ideas? Huh

tl;dr applet works in eclipse and browser but networking part of applet doesnt work in browser
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2011-11-12 20:01:02 »

That's because it's a security feature where an applet cannot connect to any IP address other than where it's hosted. To be able to connect to another IP address, you will need to sign your applet.

EDIT: It also sounds like you are running in on localhost (127.0.0.1), which is blocked too.

Offline Embedded

Junior Member


Medals: 1



« Reply #2 - Posted 2011-11-12 20:04:05 »

Thanks for the response, i am connecting to my own ip address and the applet is hosted locally on my computer its not accessable via the internet so surely it is connecting to where its hosted?

EDIT: the socket is bound to my ip address not 127.0.0.1
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sproingie

JGO Kernel


Medals: 202



« Reply #3 - Posted 2011-11-12 20:10:41 »

Open the Java console and look for errors.  It's hard to diagnose anything before you do that.
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2011-11-12 20:10:45 »

Ah but you are hosting the applet on localhost. When you double click on any HTML file on your computer, it is run in localhost.

Offline Embedded

Junior Member


Medals: 1



« Reply #5 - Posted 2011-11-12 20:11:35 »

aggh thank you very much managed to fix it i think the problem was that i was running the applet localy on my computer so it thought it was hosted at 127.0.0.1 instead of my ip and localhost is blocked anyway. I fixed it by putting it in the ol' webserver you can see it here

http://81.96.53.133/egg/WeaponHat.htm

so yea what you suggested thanks Cheesy
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2011-11-12 20:12:56 »

Yep I can connect fine too. Great job Smiley

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.

TehJavaDev (15 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (30 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (43 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!