Alexis Michael

Greenhorn
+ Follow
since Mar 29, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alexis Michael

Hi,

Suppose I have two timers in a game running at the same time. The first is set for updates every 1 sec, and the second every 10 secs. What happens when the two timers coincide? Suppose both timers update the same database.

Thanks
14 years ago
im not connecting directly via jdbc, im using PHP as an intermediate tier
14 years ago
yeah my initial thought was going through a db, and i was looking for something not going through a db.

given that i am not really familiar with servlets and short on time, do you think that storing the messages in a db and performing queries every 1-2 secs is a good idea? the game will not be playing by hundreds i assure you ;p it is for a uni project.
14 years ago
Hi,

I was wondering, is there way for to separate applet instances (created from the same page but on different computers) to communicate with each other? I want to create a live message system (not going through a database) where a player can send a message to another player currently playing the same game.

I thought of having the messages stored in a db and having the applet refresh every 2 seconds to retrieve any newly stored messages but this seems too bandwidth-consuming. Am I wrong?

Thank you
14 years ago

use HTTP "POST" requests to send queries, and get results back.



this is my question actually how do i get those results back? do i have the php script create an html page with the results, and then get that output through a streaming reader in my applet?
14 years ago
You can't to that

box strBoxName = new box(xPos,yPos,boxName,false);



This will create a variable named strBoxName, which will have nothing to do with the string strBoxName. So, when your loop gets to this line for the second time, you get the error since strBoxName is already defined by the first iteration of the loop.

May I suggest, use a 2D array of box objects and each time, create a new box at [verCounter][horCounter].

cheers
14 years ago
Parameter names do not matter. As long as the return type, function name, and parameter type as the same, you are on the safe side.
14 years ago
what's the speed of this operation compared to having the applet connecting directly to the database through JDBC ( not having in mind the security restrictions imposed on the applet)?
14 years ago
Hi,

I am planning to create an online multiplayer game, using a Java applet. I do not want to use JDBC inside my applet, nor use servlets, so I turned to good ol' PHP.

The problem is, I don't know how to retrieve the results from a PHP query to my SQL database, and store them in my applet variables.

Any help or sample code would be great.

Thanks,
Alex
14 years ago