Thread: Advice on Saving to Database

Results 1 to 7 of 7
  1. #1 Advice on Saving to Database 
    Registered Member
    Join Date
    Mar 2014
    Posts
    30
    Thanks given
    9
    Thanks received
    1
    Discord
    View profile
    Rep Power
    11
    Hey,

    Looking for which saving model I plan on following for rsps project I've been working on. Currently, I save everything attached to the character (that needs saving) during any changes made. It might be my pc but I noticed stutters because the saving also triggers each time the character's position is updated (ex: running/walking).

    In terms of performance, is it better to save periodically or only on logout instead? I was worried a larger scale of saving during position updates (for example) could be a nuisance. Could I only save the position to the database instead of the entire account instead, though?

    Appreciate any opinions on this subject.

    Many thanks
    Reply With Quote  
     

  2. #2  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    33
    Posts
    12,558
    Thanks given
    183
    Thanks received
    6,198
    Discord
    View profile
    Rep Power
    5000
    You don't need to save the position every step bro. Just save the entire account when it logs out.

    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2014
    Posts
    30
    Thanks given
    9
    Thanks received
    1
    Discord
    View profile
    Rep Power
    11
    Quote Originally Posted by Luke132 View Post
    You don't need to save the position every step bro. Just save the entire account when it logs out.
    Alright, was going off some post that suggested mmo's saving on position updates or critical changes such as inventories. Appreciate the advice.
    Reply With Quote  
     

  4. #4  
    Respected Member


    Luke132's Avatar
    Join Date
    Dec 2007
    Age
    33
    Posts
    12,558
    Thanks given
    183
    Thanks received
    6,198
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Karil Votek View Post
    Alright, was going off some post that suggested mmo's saving on position updates or critical changes such as inventories. Appreciate the advice.
    Save intermittently all online accounts every X minutes though, but you don't need to save after every change, that would just hog all your resources. and certainly not after every walking step.

    Reply With Quote  
     

  5. #5  
    Donator

    .css's Avatar
    Join Date
    Dec 2018
    Age
    27
    Posts
    347
    Thanks given
    53
    Thanks received
    117
    Discord
    View profile
    Rep Power
    117
    imo i wouldn't (most-likely) store player passwords in a db. only account attributes. sensitive info should be on a flat file local to the game server.
    Want an example of why not to store db passwords? me and impulser did a nasty deed to ss that lead them to freaking out.

    However; only save to db on essential callings. movement is a terrible idea even thinking about it in general. Only communicate when it's truly needed, especially in bulk.



    An open source #633 revision server

    Zed#3343
    Reply With Quote  
     

  6. #6  
    zen2
    Corey's Avatar
    Join Date
    Feb 2012
    Age
    24
    Posts
    1,418
    Thanks given
    1,126
    Thanks received
    1,572
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by .css View Post
    imo i wouldn't (most-likely) store player passwords in a db. only account attributes. sensitive info should be on a flat file local to the game server.
    Want an example of why not to store db passwords? me and impulser did a nasty deed to ss that lead them to freaking out.

    However; only save to db on essential callings. movement is a terrible idea even thinking about it in general. Only communicate when it's truly needed, especially in bulk.
    Weird advice

    No reason not to store passwords in a database, as long as they're properly hashed (see here). Less complexity and that way you can lay the groundwork for multiple worlds and logging in via the website to view your profile or whatever.
    As Luke said save all your players intermittently, but do it staggered. You don't suddenly want tens or hundreds of accounts being saved at the same time. If you only ever save on logout if your server suddenly dies players could lose hours of progress.
    Reply With Quote  
     

  7. Thankful users:


  8. #7  
    Renown Programmer

    Bartvh's Avatar
    Join Date
    May 2017
    Posts
    372
    Thanks given
    89
    Thanks received
    206
    Discord
    View profile
    Rep Power
    497
    Periodic is better, if you do on logout stuff might get duped if your server ever crashes.
    Guthix Open Source Emulation Framework
    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

Similar Threads

  1. Replies: 1
    Last Post: 01-04-2016, 05:19 PM
  2. Replies: 1
    Last Post: 11-28-2015, 11:36 PM
  3. Advice On What Computer To Get
    By Cookin in forum Hardware
    Replies: 15
    Last Post: 10-20-2015, 03:07 AM
  4. Replies: 5
    Last Post: 01-14-2013, 06:45 PM
  5. Any advice on how to fix this error?
    By Lonely pk in forum Help
    Replies: 5
    Last Post: 07-17-2012, 01:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •