Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
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  
  Options?  (Read 2065 times)
0 Members and 1 Guest are viewing this topic.
Offline civilwar

Senior Newbie





« Posted 2011-03-19 02:48:39 »

What are my options if I want to keep my game as an applet but allow player vs player network play?
  The only problem I can think of is how I would obtain the IP's of the server and post them on the website for the client users to play versus?  I know I can use jdbc to write user scores and stuff to the sql database or at least I think so.
Offline SimonH
« Reply #1 - Posted 2011-03-19 04:36:43 »

You'll need a server on at least 1 machine. All applets loaded from that location can then talk to each other through the server.
Good PvP is hard! ...but it can be done.

People make games and games make people
Offline civilwar

Senior Newbie





« Reply #2 - Posted 2011-03-19 04:53:19 »

thats what I was afraid of.  I have a mysql database and php but not root its not a vpn so thats not an option ;s.  lol maybe I should of researched this before I wrote most of the game!   I was thinking of doing something like http://www.ttadvance.ca but w/ java in browser.  I guess I could make it like worms and have two play on one keyboard.  But that would require a friend /wrist lol j/k.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline civilwar

Senior Newbie





« Reply #3 - Posted 2011-03-19 06:02:48 »

I think I need to use php for talking to the database as thats more secure?  Just unsure of how that would work. insted of doing client to client just have clients read from database and have clients send moves to database.  client waits to see if move has occured or something like that.   I know how to do this in straight java but it would be unsecure as someone could just decompile and find root pw or raw sql.
Offline ra4king

JGO Kernel


Medals: 346
Projects: 3
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2011-03-19 07:11:27 »

I know how to do this in straight java but it would be unsecure as someone could just decompile and find root pw or raw sql.
That's why you should have a dedicated server that acts as middle-man between clients and the database.

Offline civilwar

Senior Newbie





« Reply #5 - Posted 2011-03-21 03:57:10 »

any way that that information could be hidden?  Or would it be easy to find out the password in the applet since its being sent out?
Offline ra4king

JGO Kernel


Medals: 346
Projects: 3
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2011-03-21 06:02:28 »

You don't need to give the Applet the password. All you need is to give your server a command to store this or do that and your server will handle it.

Offline civilwar

Senior Newbie





« Reply #7 - Posted 2011-03-21 17:20:31 »

Well I was trying to think up a method in which I wouldn't need a server and somehow I could just use the mysql database.  I am almost done writing it but its not secure at all lol.
Offline ra4king

JGO Kernel


Medals: 346
Projects: 3
Exp: 5 years


I'm the King!


« Reply #8 - Posted 2011-03-21 17:52:28 »

There are no scenarios where you would directly access a database securely without a middle man server.

Offline civilwar

Senior Newbie





« Reply #9 - Posted 2011-03-21 18:23:06 »

Lame but I know thats the answer hehe.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mike

JGO Wizard


Medals: 83
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #10 - Posted 2011-03-21 18:24:51 »

There are no scenarios where you would directly access a database securely without a middle man server.

There is (one?) if you define securely in a loose manner. A user with only select privileges on a set number of tables could access a database securely (as in, couldn't compromise the data, not securely as in no one being able to figure out the password), but I'd never recommend it to anyone.

If you do updates or inserts expect the database to be full of junk.

All in all, use an application server.

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline ra4king

JGO Kernel


Medals: 346
Projects: 3
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2011-03-22 01:43:33 »

There are no scenarios where you would directly access a database securely without a middle man server.

There is (one?) if you define securely in a loose manner. A user with only select privileges on a set number of tables could access a database securely (as in, couldn't compromise the data, not securely as in no one being able to figure out the password), but I'd never recommend it to anyone.
No because if he wants everyone to use the application, then all users should be allowed. Tongue
And by securely I really mean without being able to figure out the password to the database by, say, using tcpdump.

You should also encrypt your data, instead of using plain Strings back and forth. The simplest way is to send objects using ObjectOutputStream and ObjectInputStream. Java serialization will handle the "encryption" (aka, the object graph that looks like a bunch of junk).

Hope that helped Grin

Offline civilwar

Senior Newbie





« Reply #12 - Posted 2011-03-22 17:16:26 »

right now I am rewriting code to connect to http to run php code that gets moves through gets.  I will eventually want to encrypt that so thank you for the advise.
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.

Grunnt (16 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
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!