Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  Login through a website  (Read 3551 times)
0 Members and 1 Guest are viewing this topic.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Posted 2013-12-19 16:59:39 »

Soon I will be hosting a website where players will be able to create an account with an email, password and beta key. I need to know a way that the program/game will be able to access the site to confirm information that is entered into the game text box and then allow entrance, any leads?

I love making games...
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #1 - Posted 2013-12-19 17:33:40 »

Why exactly do users need an account to play your game?
Most of the members will recommend not making people login, because many simply wont bother then.

But to answer your question, you could setup a php form where the program submits the login data to.
This form could simply return true or false on a successful submit. However this is very easy to tinker with, if you could give an example, its much easyer to suggest something.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #2 - Posted 2013-12-19 21:37:13 »

Well I added a login system so that I could get the users name for when they join multiplayer and I also have a login system to prevent pirating of my game

I love making games...
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Slyth2727
« Reply #3 - Posted 2013-12-19 23:59:11 »

Well with login forms, or any php forms, you have to be veeeeery careful. There are many things people can do to your site if you aren't.

RobinB is right, most people are simply to lazy to register for a game and just stop playing..

Honestly, you should probably read up on PHP and get a page working that you can view on your browser and submit data to though $_GET's. Then you can take it a step further and create a small, test Java program to send data to it through post requests. Finally, implement it in your game.

However: Don't release that version of it yet, read up on how people can exploit these kinds of php forms. If you want I can help you in that area and make a few suggestions as to where you can make your php code a bit more secure.

As for actually storing the data, I think it's pretty common to just use MySQL. If you are feeling adventurous I suppose you could check out PostgreSQL, as well as a few others. But MySQL is generally the most common one in my opinion.
There are other ways of storing login data, and it depends on what and how you want to do stuff.

Have fun, experiment!

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Online ags1

JGO Ninja


Medals: 46
Projects: 2
Exp: 5 years


Make code not war!


« Reply #4 - Posted 2013-12-20 00:20:59 »

I use Servlets and GoogleAppEngine on my website. It's free and a lot less hassle than setting up a LAMP server.

Offline Slyth2727
« Reply #5 - Posted 2013-12-20 03:23:43 »

I use Servlets and GoogleAppEngine on my website. It's free and a lot less hassle than setting up a LAMP server.

Where's the fun in that? Or the learning?
This is a perfect opportunity to learn some server side languages such as Ruby, Python, Perl, Django, etc.
Take it!

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #6 - Posted 2013-12-20 16:06:47 »

Thanks man! You seem to have a lot of knowledge in this area of programming, if I get stuck I'll message you

I love making games...
Offline Slyth2727
« Reply #7 - Posted 2013-12-20 19:30:22 »

Thanks man! You seem to have a lot of knowledge in this area of programming, if I get stuck I'll message you

I'm okay. There are tons of people out there that are so much better than I am, but I know enough to be able to help you here Smiley
Looking forward to helping you out on this one, I love this stuff!

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Online ags1

JGO Ninja


Medals: 46
Projects: 2
Exp: 5 years


Make code not war!


« Reply #8 - Posted 2013-12-20 20:07:52 »

I use Servlets and GoogleAppEngine on my website. It's free and a lot less hassle than setting up a LAMP server.

Where's the fun in that? Or the learning?
This is a perfect opportunity to learn some server side languages such as Ruby, Python, Perl, Django, etc.
Take it!

I didn't know it was a learning exercise. Anyway, Java is the uber server-side language. Also, I have no idea where you get the idea that building a Java-based website would not be fun, or that using the Google infrastructure would not involve learning relevant and with-it technologies like nosql.

Offline Slyth2727
« Reply #9 - Posted 2013-12-20 22:11:36 »

Quote
I didn't know it was a learning exercise. Anyway, Java is the uber server-side language. Also, I have no idea where you get the idea that building a Java-based website would not be fun, or that using the Google infrastructure would not involve learning relevant and with-it technologies like nosql.

Point taken, using the Google thing would let you learn some stuff. However, in my opinion he should learn the basics of php and other languages like it as well as some SQL stuff. As you said, your method would let him learn a bit of SQL as well but I still stand by what I said.
This is just my opinion though, and everyone has a different one. Maybe he can try both Smiley

Was I before Chuang Tzu who dreamt about being a butterfly, or am I now a butterfly who dreams about being Chuang Tzu?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #10 - Posted 2013-12-21 10:49:29 »

Well I added a login system so that I could get the users name for when they join multiplayer and I also have a login system to prevent pirating of my game

He states he would make people login for an drm like tech (always on).
This will not stop pirating as it is bypassed with ease (they can simply override your website with their own, always returning successful).
Also with multiplayer this is abused easily, because it requires some more checks to make it safe.
Read up into RSA and AES to make the connection at least secure, also find out what processes need to run serverside to multiplayer your game.
An webform might not be enough.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #11 - Posted 2013-12-22 12:55:12 »

Thanks for the help everyone I also have some other questions:

1. What would be the best way to prevent pirasy of my game?
2. How could I make a in-game multi-client chat for the multiplayer portion of my game?

I love making games...
Offline nerb
« Reply #12 - Posted 2013-12-22 14:30:01 »

1. What would be the best way to prevent pirasy of my game?

I wouldn't worry about it unless your game becomes popular enough to pirate. When you start earning a living from your game, piracy might become a concern.

2. How could I make a in-game multi-client chat for the multiplayer portion of my game?

Perhaps you could send some form of message protocol through TCP sockets? A quick google of "java chat" should reveal all you need to know. Honestly, if you know enough to implement a website and login system, then chat should be a breeze to implement.
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #13 - Posted 2013-12-22 15:14:42 »

1. What would be the best way to prevent pirasy of my game?

Same as nerb, you cant. You can only add annoyances, but with every pirate you scare away, potential players go with him.

2. How could I make a in-game multi-client chat for the multiplayer portion of my game?

You cant with an website, i think you want an response time within seconds from the chat, when you have lets say 10 players, your webpage will be bombed with 10 requests a second. People who visit your site might not even be able to load your page then.
You would need an server application on an server keeping sockets open and sending events when needed.
There might be some simpler solutions like adding some kind of irc api to your program and fetching its contents once a while.
Offline CodeHead

JGO Coder


Medals: 40


From rags to riches...to rags.


« Reply #14 - Posted 2013-12-22 15:34:35 »

You cant with an website, i think you want an response time within seconds from the chat, when you have lets say 10 players, your webpage will be bombed with 10 requests a second. People who visit your site might not even be able to load your page then.

Given the minuscule amount of data involved with text based message, I'm fairly sure even the least optimized web server out there can handle well over 10 requests per second without breaking a sweat, much less grinding to a halt.

You would need an server application on an server keeping sockets open and sending events when needed.

Or you could have a lower priority thread that runs on the client and polls the server via a GET request for new chat messages at a set interval. Web based Ajax chat widgets have been doing this for quite a while and implementing the same in Java is fairly trivial if you already have enough knowledge to develop the client server protocol for your game. In the case of chat, you get a bit of cushion room in the timing department since a small delay in sending or receiving doesn't have a real impact on the game itself.

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #15 - Posted 2013-12-22 16:31:54 »

I meant a chat program within my game btw Cheesy
-I'm asking a lot here but does anyone have a multi-client chat program along with eclipse source code?
-I also have another question...how do i allow the user to start typing data in a program thats already running, I dont want the text boxes there the whole time and they should only be able to type data in a certain part of the menu within the game, any ideas how this could be done?

I love making games...
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #16 - Posted 2013-12-22 16:34:33 »

You cant with an website, i think you want an response time within seconds from the chat, when you have lets say 10 players, your webpage will be bombed with 10 requests a second. People who visit your site might not even be able to load your page then.

Given the minuscule amount of data involved with text based message, I'm fairly sure even the least optimized web server out there can handle well over 10 requests per second without breaking a sweat, much less grinding to a halt.

You would need an server application on an server keeping sockets open and sending events when needed.

Or you could have a lower priority thread that runs on the client and polls the server via a GET request for new chat messages at a set interval. Web based Ajax chat widgets have been doing this for quite a while and implementing the same in Java is fairly trivial if you already have enough knowledge to develop the client server protocol for your game. In the case of chat, you get a bit of cushion room in the timing department since a small delay in sending or receiving doesn't have a real impact on the game itself.

Did you try that? I did Smiley
Its not about the data, its about the requests + associated header data, lets do some math.
10 request an second = 36.000 requests an hour = 864.000 requests a day for only 10 users!
Thats not all, because if the header data is 250 bytes (mostly around this), your using an bandwidth of 216 MB a day.

I know this is exaggerated, because you probably don't have 10 users online all day and you might get away with only fetching new messages every 5 / 10 seconds.
If you can live with this, go with it Smiley

I meant a chat program within my game btw Cheesy
-I'm asking a lot here but does anyone have a multi-client chat program along with eclipse source code?
-I also have another question...how do i allow the user to start typing data in a program thats already running, I dont want the text boxes there the whole time and they should only be able to type data in a certain part of the menu within the game, any ideas how this could be done?

1. Probably not, try it yourself first.
2. Show and focus textboxes on an keypress (like return).
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #17 - Posted 2013-12-22 16:46:46 »

2. Show and focus textboxes on an keypress (like return).
could you show me some source on how i could do that?

I love making games...
Offline Danny02
« Reply #18 - Posted 2013-12-22 16:56:48 »

or you could just use an open IRC server, the protocol is really really easy and you wouldn't have to host anything.
Offline CodeHead

JGO Coder


Medals: 40


From rags to riches...to rags.


« Reply #19 - Posted 2013-12-22 16:57:20 »

Did you try that? I did Smiley

Indeed I have.Smiley

I know this is exaggerated, because you probably don't have 10 users online all day and you might get away with only fetching new messages every 5 / 10 seconds.
If you can live with this, go with it Smiley

That was my point; due to the human interaction that happens in a chat scenario, you can get away with significantly longer delays than you can when dealing with input to the rest of the game engine. When I issue a command to a game, I expect immediate feedback, when I send a message to John or Jane Doe somewhere else in the world, I have an expectation of receiving feedback somewhere between when they get around to it to potentially never. Consider also that most home connections in technological countries can move gigabytes in a matter of a few minutes. Assuming your central server is hosted by a regular provider with a bigger pipe, 216mb a day isn't a significant amount of traffic by any means.

could you show me some source on how i could do that?

Have you mentioned what framework you're developing your game under? Vanilla Java, LWJGL, other? Depending on what you're using, there may already be "drop in" solutions you can use.

Arthur: Are all men from the future loud-mouthed braggarts?
Ash: Nope. Just me baby...Just me.
Offline Genius Coder

Junior Member


Medals: 1
Exp: 4 years



« Reply #20 - Posted 2013-12-22 22:50:58 »

or you could just use an open IRC server, the protocol is really really easy and you wouldn't have to host anything.

 Can you expand on this, I'm unsure what you are talking about

And BTW codehead I'm using Java vanilla Smiley

I love making games...
Offline AirTime

Senior Newbie


Exp: 4-6 months


Not a glitch, just a misplaced curly brace.


« Reply #21 - Posted 2014-04-26 18:26:34 »

You could try making a database (MySQL, ect.) of all the players and have the game check that database of players before letting them log in.

Nothing's gonna change my world.. well, at least until the next syntax error appears Tongue
Offline RobinB

JGO Ninja


Medals: 44
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #22 - Posted 2014-04-27 10:14:26 »

Very very very bad solution, also, check the date.
Pages: [1]
  ignore  |  Print  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (32 views)
2014-07-14 16:23:47

Riven (34 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!