Questfrage !

01/16/2013 23:42 .Onlyx3#1
Hi

Wir sind grade dabei das Prestigesystem nachzubauen.
Es geht alles soweit bis auf die wichtigste Sache..

Das Resetten auf Level 1 !

Zum Test haben wir diese Quest benutzt
PHP Code:
quest PrestigeTest begin
    state start begin
        when 20061.chat
."PrestigeTest" with pc.is_gm() begin
            
if select("Test Starten","Abbrechen") == 1 then
                local name 
pc.get_name()
                
mysql_query("UPDATE account.account SET availDt = NOW() + INTERVAL 30 MINUTE WHERE id = (SELECT account_id FROM player.player WHERE name='"..name.."');")
                
mysql_query("UPDATE player.player SET level=1 WHERE name='"..name.."';")
                
cmdchat("exit")
            
end
        end
    end
end 
Man wird per Quest 30 Minuten gebannt und nach 30 Minuten automatisch entbannt. Die Quest setzt auch das Level auf 1 was ich auch sehe wenn ich in die Datenbank gehe. Das Ding ist nur, das der Server das Level kurz danach wieder auf 150 (Maxlevel) setzt obwohl ich nicht mit dem Char eingeloggt bin..
Kann mir einer eklären warum er es nicht auf Level 1 lässt sondern wieder aufs Maxlevel setzt?
Das Level 1 setzen geht ja, nur es setzt es halt nach paar Minuten wieder auf 150..

Danke
01/16/2013 23:58 Sintiax#2
[Only registered and activated users can see links. Click Here To Register...]
Frag da nach.
01/17/2013 00:11 .Onlyx3#3
Die Quest an sich ist ja nicht Fehlerhaft sie funktioniert ja.
Vieleicht fehlt nur ne Function oder so^^
Und in dem Thread geht eh alles unter..
07/17/2014 15:08 [SA]Vanya#4
Same Prob ^^

Same Prob ^^
07/17/2014 15:36 [SA]Tears aka.[BlackBite]#5
Old Thread dont push it... The Problem is the Db Cache, decrease the the db core cache time and make a mysql event which has a higher update time then the db core cache. means: set per quest a integer in the player table, for example: (Update player.player set prestige_wait = 1 where prestige wait = 0) and then configure the mysql event. if your db core cache time is 5 minutes then let the mysql event set the level after 6 minutes.

sense of the mysql event?
here is the answer: If you get kicked and your account is locked for 30 minutes the db cache has the information that your player is still level 150, and it overwrite the level that was setted by the quest.

Best Solution: Set the DB Cache Time to 2 Minutes, lock the account for 20 minutes and set the mysql event cycle to 10 minutes or 8 minutes. AND remember to set the prestige_wait = 1 to 0 (it is possible in the mysql event too)