Thread: Best way of saving (more efficient, no process, proper way, no rollbacks)

Results 1 to 7 of 7
  1. #1 Best way of saving (more efficient, no process, proper way, no rollbacks) 
    ⚓Manic-Owner⚓


    Join Date
    Nov 2007
    Posts
    2,711
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    Okay so this is the proper way of saving, no rollbacks, and fix alot of dupes in deltascape. Works on all bases though.


    Step 1:

    First of all remove all savegame(true); or savegame(false); in client class except for the one in the destruct method. Remove it from dieing, dropping, etc. Also remove your gay process saving.

    Also if you do not have the savegame method in your destruct method, add it. But it should be there.

    Step 2:

    Open up Playerhandler class and then go to PlayerHandler() {.

    Under it add
    Code:
    Runtime.getRuntime().addShutdownHook(new Thread()
                    {
                            public void run()
                            {
                                    for (int i = 0; i < maxPlayers; i++)
                                            if(players[i] != null)
                                                    ((Client)players[i]).savegame(false);
                            }
                    });

    Now you got fullproof saving.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Pilldom's Avatar
    Join Date
    Sep 2007
    Posts
    1,298
    Thanks given
    24
    Thanks received
    221
    Rep Power
    164
    What is the first line doing exactly?
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Pilldom's Avatar
    Join Date
    Sep 2007
    Posts
    1,298
    Thanks given
    24
    Thanks received
    221
    Rep Power
    164
    O ok gotcha
    Attached image
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Much easier, simpler, and correct.
    Code:
    try {
      //process
    } finally {
      //save
    }
    EDIT: Why the fk would you leech something this simple?.. You're very sad bro.
    Reply With Quote  
     

  5. #5  
    ⚓Manic-Owner⚓


    Join Date
    Nov 2007
    Posts
    2,711
    Thanks given
    47
    Thanks received
    9
    Rep Power
    650
    Quote Originally Posted by Colby View Post
    Much easier, simpler, and correct.
    Code:
    try {
      //process
    } finally {
      //save
    }
    EDIT: Why the fk would you leech something this simple?.. You're very sad bro.
    I didn't leech rofl. It's basically a shutdown hook with the save method in it, maybe similar, but not leeched.
    Reply With Quote  
     

  6. #6  
    Registered Member

    Join Date
    Jun 2007
    Posts
    2,237
    Thanks given
    267
    Thanks received
    411
    Rep Power
    1283
    It doesn't always execute so not really fullproof.
    Don't worry, Be happy.
    Reply With Quote  
     

  7. #7  
    Galileo
    Guest
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

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