PDA

View Full Version : Snaplinks


TheShadow
09-23-2011, 02:36 PM
As my site has almost 10k adoptables (and that number is soon to explode), people are wanting to use snaplinks to do their clicks. The thing is, something is too slow to calculate the number of crescents(our site currency) properly. For every 10 tabs opened with snaplinks, 6/7 aren't being counted.

Is this just a matter of server resources? or is there something we can alter in the code?

Hall of Famer
09-23-2011, 03:16 PM
umm this is an interesting situation you are in, mind showing me a screenshot of the error you are getting? I believe this is doable, just a bit tedious to achieve. Also my site has 15k+ adoptables and does not suffer any of the problems you mentioned. Perhaps the easiest option for you is to upgrade your hosting package if you run on a cheap shared server.

PTGigi
09-23-2011, 10:07 PM
Actually I've noticed this too! (I just keep forgetting to mention it o-o)

Most Mys sites I go on (actually all of them I think) have this problem I've noticed D:

Pkmns, SilvAdopts, DarkLab, and one other I tried Snaplinks on all don't count the cash most of the time D: It just "updates" the cash to the old number (so say I had 20 moneyz, if I click on an adoptable I would get to 21 moneyz, BUT if I snaplink 10 adoptables instead of raising to 30 moneyz it might raise to 21-22 moneyz)

Oh well, good-old fashioned CTRL+Click still works o3o

Niku
09-24-2011, 02:34 AM
Do you guys know if the problem is the webhost or the is it in the script itself? A few of our users have reported this, and I'm really curious to find out why this happens.

Pyrkagias
09-24-2011, 07:21 AM
It happened to me too....

TheShadow
09-25-2011, 11:08 PM
I don't know exactly what my server situation is, but I pay $120 a month. If I'm sharing a server, I doubt it's with many people. Especially with the rate that we use bandwidth. I don't know if we have the best of CPU/RAM, but it shouldn't be that bad.

As far as the error, there's no error message. It just doesn't add it correctly. Snaplinks opens a lot of tabs at once, so they load at once. But somehow it isn't fast enough to call in the number in between each load.

Right now I have it set to give out between 150-250 crescents. I should after snaplinking 11 adopts have around 2200 added, or at least 1650.

You have 2166360 Crecents.

You have earned 176 Crecents for leveling up this adoptable.
You now have 2166536 Crecents

You have earned 237 Crecents for leveling up this adoptable.
You now have 2166597 Crecents

You have earned 228 Crecents for leveling up this adoptable.
You now have 2166588 Crecents

You have earned 170 Crecents for leveling up this adoptable.
You now have 2166530 Crecents

You have earned 238 Crecents for leveling up this adoptable.
You now have 2166598 Crecents

You have earned 229 Crecents for leveling up this adoptable.
You now have 2166589 Crecents

You have earned 192 Crecents for leveling up this adoptable.
You now have 2166728 Crecents

You have earned 174 Crecents for leveling up this adoptable.
You now have 2166762 Crecents

You have earned 190 Crecents for leveling up this adoptable.
You now have 2166788 Crecents

You have earned 198 Crecents for leveling up this adoptable.
You now have 2166926 Crecents

You have earned 200 Crecents for leveling up this adoptable.
You now have 2166988 Crecents

You have 2166762 Crecents.

I should had gotten 2232. Instead I got 402.

So, what it's doing is this:

2166360 > 2166536 Crecents

2166360 > 2166597 Crecents

2166360 > 2166588 Crecents

2166360 > 2166530 Crecents

2166360 > 2166598 Crecents

2166360 > 2166589 Crecents

2166536(finally updated from the first click) > 2166728 Crecents

2166536 > 2166762 Crecents <-somehow this is the number I end up having D:

2166536 > 2166788 Crecents

2166728 (updated from the result 3 clicks ago) > 2166926 Crecents

2166728 > 2166988 Crecents


2/11 is not a good ratio D: I doubt that my hosting is that horrible.

TheShadow
09-30-2011, 11:24 PM
Any update on this?

TheShadow
11-07-2011, 10:46 PM
This problem is now affecting regular clicks done with ctrl + click. These are my server stats (I do not share a server):

CPU SPEED: 2X2.4 GHz
BUS SPEED: 1066 MHz FSB
CACHE: 4MB

» 4GB RAM
» 500GB Seagate ES HDD
» 3000GB Bandwidth

I highly, highly doubt this is a problem with server resources, and until it's fixed my whole currency system is defunct. I am willing to pay for a fix asap. :c

PokePets
11-08-2011, 10:23 AM
Maybe you can change your levelup page so that users need to click first on train me or so? Example;
http://www.clickcritters.com/feed/4922397

TheShadow
11-08-2011, 12:38 PM
That is a workaround, but it ignores a very big problem that is getting worse and I'm obviously not the only person with =/

Hall of Famer
11-08-2011, 04:30 PM
Umm now this is strange, your hosting package is not much worse than BMR's MA, so it should be good enough to handle an individual site.

TheShadow
11-08-2011, 11:14 PM
Which is why I'm inclined to think it's not a server issue. It's now starting to affect adopts getting clicks as well, so pretty much everything is breaking down :c

I'm offering a $50 reward to whomever helps us fix this. It's a very serious issue D:

PokePets
11-09-2011, 06:04 AM
What about updating the money 1x a day?
New field: Clicksdonetoday end then cronjob:
$rand (1,5)
$newmoney = clicksdonetoday x $rand
Update users money set money to $money + $newmoney

Just a fast example

Csar
11-13-2011, 02:15 PM
Which is why I'm inclined to think it's not a server issue. It's now starting to affect adopts getting clicks as well, so pretty much everything is breaking down :c

Maybe the problem is caused by mysql queues... Just try this:

Go to levelup.php [145] there should be 2 lines like this:


$newamount = $GLOBALS['money'] + $reward;
runquery("UPDATE {$GLOBALS['prefix']}users SET `money` = '{$newamount}' WHERE `username` = '{$loggedinname}'");

Try replacing with this:

$newamount = $GLOBALS['money'] + $reward;
runquery("UPDATE {$GLOBALS['prefix']}users SET `money` = `money`+{$reward} WHERE `username` = '{$loggedinname}'");

This will probably cause Mysql to just increase instead of overwriting. Worth a try?

EDIT: Is money a string? If so it'll probably not work... Hope it isn't like this. Otherwise you'll have to try adding a field that is called "lock" and that is changed to 1 at the beginning of the script and changed to 0 at the end. We'll also have to add some code to detect if the lock is activated and "sleep" 0.1 seconds and repeat the query...

TheShadow
11-16-2011, 11:38 PM
Csar's solution works wonderfully. ^________^ Thank you so much ♥ (Please PM me your paypal?)

SilverDragonTears
12-02-2011, 12:19 AM
I can't find this in my levelup.php....