Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 03-05-2016, 03:20 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 133,540
Kyttias is on a distinguished road
Default

Oh... hmmm! That's done on Pokéfarm, too...

So let's see... three eggs, when one is taken three things should be done:
  • See if that egg is still available (by checking against timestamp), if true, continue.
  • Store a 'claimed' timestamp when the egg is successfully picked up.
  • Reshuffle the eggs (include the two unclaimed and add a random third).

The three random eggs are shuffled server-side and stored in the database. When the page loads, it'll access the database and pull up the shuffled set of eggs with the most recent 'creation' timestamp. The data will also be stored with a 'claimed' timestamp, which will be filled moments before a new row is created upon a new shuffle.

Two other things to consider:

We don't want to store an infinite number of shuffled egg sets in the database, so to save on database space will will also look for the row with the oldest 'claimed' timestamp and remove it while creating a new one.

We also don't necessary want eggs to stagnate. Considerations will have to be made about that. Ordinarily we'd want the two eggs that weren't claimed to stay there for the next refresh... but what if we want to force these eggs to change? I think a good time to do this would be test how long it's been since that egg set was created. If it took more than an hour for one of the three to be claimed, randomize all three eggs going into the next draw.

Is this all heading in the right direction?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:41 PM.

Currently Active Users: 3669 (0 members and 3669 guests)
Threads: 4,081, Posts: 32,032, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636