Advertisement
    SHARE
    TWEET
    Guest User

    Untitled

    a guest
    Oct 5th, 2012
    288
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    1. // initial data loading
    2. var lastupdated = 0;
    3. function refreshData() {
    4. database.leaderboards.tables.get({filter: { created: {$gte: lastupdated}}}, function(error, tables) {
    5. if(error) {
    6. console.log("SCORETABLES failed to retrieve results: " + error);
    7. setTimeout(refreshData, 1000);
    8. return;
    9. }
    10. console.log("SCORETABLES loaded " + tables.length + " new tables");
    11. if(tables.length > 0) {
    12. for(var i=0; i<tables.length; i++) {
    13. var table = tables[i];
    14. tablelist[table.swfid + table._id] = table;
    15. tablelist[table.swfid + table.name] = table;
    16. if(!table.created) {
    17. table.created = datetime.now - 1000;
    18. collection.update({_id: table._id}, table, {}, function(error, result) { });
    19. }
    20. }
    21. lastupdated = tables[tables.length-1].created;
    22. }
    23. setTimeout(refreshData, 30000);
    24. });
    25. }
    26. refreshData();
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Advertisement
    Public Pastes
    Advertisement
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /