![]() |
[FIX] Cache cannot load week playtime
The warning message cache spams when a user without time data logs in:
Quote:
I wrote this in about 2 minutes and didnt bother to make it quick to run, because you only need to do it once. It takes about 5 minutes on SQL 2000 and 15 seconds on 2005. Code:
Declare @acc intEdit: This should leave current time data which already exists in tact, SQL errors and continues when a duplicate row is detected in INSERT. |
cool if it works. yea.
|
How it to put?
|
Run it in Query Analyzer (2000) or just a new query in management studio (2005).
|
Simply to execute SQL inquiry
Or it needs to be executed on lin2db or lin2world? |
I specified the Db object in the script itself, so you don't have to set a target, but if you really want to target Lin2World.
|
this is PROCEDURES? if YES, to what prosedres copy??
|
Just run it once, easy as that.
|
so this there will be one time, and it is necessary automatically
|
works great, thnx author zzhhooshh :)
|
Unless you end up with over 150,000 accounts, yeah, just need it once.
|
why don't u add a single insert statement to account creation scripts?
filling 150k lines into the db is . . . not really useful |
It would produce the same thing either way, this is a fix for a current issue, putting an insert line in the account creation script will only help for newly created accounts. Let alone that creating 150k rows assures the problem is solved for that number of accounts, which not many servers achieve anyways.
|
How to correct these mistakes?
http://img240.imageshack.us/img240/3487/err3hf.jpg |
Get a faster machine / database server? Optimize your database and data? That isn't an error, it's a warning message telling you that the query it ran took longer than your set max sql execution time. If you don't like them you can raise the value of that setting in cache's ini.
13 seconds for an item amount change? You should really consider upgrading or having a look into that issue. |
try this, it will insert missing lines into lin2world for all accounts that are defined in lin2db (maybe u have to change the script to fit your db structure)
[php:1:72ff948c5c]. INSERT INTO lin2world.dbo.time_data SELECT a.uid, '2004-01-01', 0 FROM lin2db.dbo.user_account a LEFT OUTER JOIN time_data t ON a.uid = t.account_id WHERE (t.account_id IS NULL) [/php:1:72ff948c5c] |
Generally the accounts are in numericial order, so the original post is the simplest way to do it, but yeah thanks for the feedback.
|
There are entries in this table,
because the server safes the lastlogout date and total playtime in this table. Why generating so much errors? ;) Filling only nescessary lines is exactly the same like an huge bulk insert? ok... |
[][][]
|
so u prefer to fix a bug with creating a lot of useless data?
instead fixing the root of the bug itself? btw - yes, I know what my script is doing and yes... your script CAN'T overwrite data... but it spits out a huge amount of error messages |
after i putted this On my DB... it f****ed UP all my server... when it shows me the message [Account.cpp] etc. i get disconnect....:(
and sometimes..... all server crashes.... or it crash`es before loading the NPC`s...:( damn! someone knows how to fix it? |
| All times are GMT. The time now is 16:20. |