On Dec 31, 2004, at 12:21 PM, LMSpam at neuropop dot com wrote:
I'm using mySQL as the engine for my web site - it keeps user
preferences as well as conducts the searches for matches. So I'm
thinking...
How is the Client app communicating with the MySQL server? PHP?
Server-side RB app? Or is your Client app interfacing directly with
the MySQL server?
Add a "bananas" column to a user's profile - either a list of who
they've awarded bananas to or who has awarded them bananas, still
undecided....
How do bananas affect status?
I would have a separate table with two columns... Giver and Receiver
(maybe a time stamp too). Then it doesn't really matter who it the
table belongs to, since you would use PlayerIDs for both the Giver and
the Receiver.
Then when the player wants to know who they gave bananas to, your SQL
would be something like:
SELECT Receiver FROM Bananas WHERE Giver=389103
And for seeing who gave you bananas, it would be:
SELECT Giver FROM Bananas WHERE Receiver=538921
Then, when a player joins, read that list into its properties and when
an "Award a Banana" message comes to the server, filter it out if the
awardee has already gotten a banana from the sender. Sending back a
message of "You already gave them a banana"
If you want to allow people to give multiple bananas after a set period
of time passes, then:
SELECT TimeStamp FROM Bananas WHERE Giver=389103 AND Receiver=538921
And then compare all of the time-stamps to see if they are eligible to
receive another one. Of course if you don't get any records returned
then the player can accept the banana.
This banana table could get very large with a number of players -- at
least Pow(numofplayers, numofplayers) -- so you might want to consider
"expiring" the old bananas after 'x' days.
It then becomes a question of the speed of "instr" or "StrComp" and of
course, executing the initial SQL query?
Since the queries above are all based on Integer IDs, there would be no
string comparison going on. That would be fastest.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|