PDA

View Full Version : Some questions. Help needed.



Dalisra
12-19-2006, 08:40 PM
Hello everyone. My name is Dalris.

I just started to advance into programing, and now I feel like I have enough knowledge to start making my own game. All the time I wanted to make a browser-, text-, tick-based game.
Few days ago I started this little "project" of mine, made a user database, login, register pages (this was done in few hours).. and got stuck.
When it came to create the game itself: layout, design, etc. I found out that I lack some ideas.

I wonder maybe there are people who could advice me how to get started. This "project" of mine is just to learn some more programing and make a very simple game. I am programming in JSP, and using MySql database.

What am I aiming for: To start off, I just want to make a realy simple game.
What I need: Someone who have the same goal as me, someone who knows basics of JSP and SQL. Motivation too! ;) Or just an advice how to move on, how to plan all the things that needs to be programed..

Dalisra
12-20-2006, 01:26 AM
Okay, so I moved on and created few more tables and pages, and got stuck again.

This time it is about user identification. When users log into the game they get unique key, this key is then stored into the database; also it is beeing passed from page to page(to make sure that user is logged in):

<input type="hidden" name="AuthenticationKey" value="unique_value">
Where unique_value represents a unique key that is beeing created each time user logs in.

But.. the only way I can pass this information is if players press on the button:
<input name="submit" type="submit" value="Main Page"> is there any way it could be passed on if they press on a normal link such as:
<a href=main.jsp>Main</a>
?

Dalisra
12-20-2006, 08:23 AM
Okay, so I found a way to go arround this. Had to make a simple code to be able to remove any letters from the identification key, and just used a simple command:
<a href="main.jsp?key=unique_value">Main</a>

It will be showing in browser adress line but it was the best solution I could do, also I added IP confirmation. (If anyone knows how to do this without showing: "?key=uniquevalue" please help me out here).

So next comes... ticker, program that will make calculations, lets say, once every 15min and update the system with new numbers. This shouldn't be hard, I'll just google for it or ask a friend. Anyhow if there is someone who wants to help me out, it would be so nice.

What worries me most is - I made a page where you can see all other players. At first I thought I will just list them, but lets imagine if there are 2000+ players. The list would be so damn long... Any suggestions how I could do it in parts?

Dalris

P.S. It becomes more and more like a log, but I am still in need for some help. I hope there will be few nice people who will be able to help me.

Westech
12-20-2006, 11:54 AM
I'm not familiar with JSP, but I'll offer a few suggestions based on how I'd handle it in php. I assume that JSP must have some similar features.

1. Getting rid of "?key=uniquevalue" in the URL. php offers session management functionality. You can set a session variable for a user, and then access the variable from another page at another time during that user's session. The session id can be set to be stored in a cookie so that it doesnt' have to show in the URL. JSP probably has similar session management features.

2. The "ticker." I'd set up a cron job (If on a Linux server) or a Scheduled Task (if on a Windows server) to run every 15 minutes. This cron job should execute your script that updates your numbers.

3. Player listing page. I'd paginate it. Only show 50 or 100 per page and have Previous and Next links to page through the list. You can pull the data from mysql in this way by using the LIMIT parameter. Example:

SELECT * FROM player_table ORDER BY player_id LIMIT 50, 101

This query would return player data ordered by player_id, it would return only 50 results, starting with result number 101.

I hope this helps. Good luck with your project!

Dalisra
12-20-2006, 01:39 PM
Wow, that was great help. I will check out how to make cookies.
Now when you said it about the "ticker", I start to wonder why haven't I thought about it myself.
This Limit parameter is just what I was looking for.

Thank you, Westech, for the help!

Dalris