Thread: Storing shops in a mysql database...

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 Storing shops in a mysql database... 
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Anyone have any suggestions on how you could do it? The only way I know is by creating 30 od columns for item and amount but that could be a waste of space because some shops only have a few items
    Visit Rune Miracle Here
    Reply With Quote  
     

  2. #2  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    663
    Rep Power
    5000
    Using a mysql table for shops would be pointless really.

    for player stock store them as an object itself, for main stock use something like an xml loader?
    Reply With Quote  
     

  3. #3  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Quote Originally Posted by Michael View Post
    Using a mysql table for shops would be pointless really.

    for player stock store them as an object itself, for main stock use something like an xml loader?
    I am going to save the default stock in a sql table. The table will never be updated by the server, it will only load the information on startup instead cfg files.
    Visit Rune Miracle Here
    Reply With Quote  
     

  4. #4  
     

    Vastiko's Avatar
    Join Date
    Dec 2006
    Posts
    5,700
    Thanks given
    300
    Thanks received
    663
    Rep Power
    5000
    Quote Originally Posted by q a z7o View Post
    I am going to save the default stock in a sql table. The table will never be updated by the server, it will only load the information on startup instead cfg files.
    Ahh okay in that case fine slightly over complicating things but meh
    Reply With Quote  
     

  5. #5  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Quote Originally Posted by Michael View Post
    Ahh okay in that case fine slightly over complicating things but meh
    Yeah I am importing everything into a database for easyier editing. Things like itemDefinitions and npcDefinitions I load using binary so its real hard to edit. Now its real easy because its in a database.
    Visit Rune Miracle Here
    Reply With Quote  
     

  6. #6  
    Member
    Boomer's Avatar
    Join Date
    Sep 2006
    Posts
    1,282
    Thanks given
    309
    Thanks received
    795
    Rep Power
    1111
    I'd suggest learning how to use SQL before actually using it.


    Osiris ||| FightScape | InnerFantasy | PkIsle | Paragon | Enkrona | 2006Scape
    Reply With Quote  
     

  7. #7  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Quote Originally Posted by Boomer View Post
    I'd suggest learning how to use SQL before actually using it.
    I have learn't the basic of it. I already have a few tables holding all item and npc definitions so thats good enough for me.
    Visit Rune Miracle Here
    Reply With Quote  
     

  8. #8  
    Registered Member

    Join Date
    Oct 2007
    Posts
    1,017
    Thanks given
    1
    Thanks received
    3
    Rep Power
    562
    Like being said, storing shops in SQL won't benefit you much, but since you're almost doing everything in SQL, it is a reason to store them into.

    What I actually prefer is using some simple format, till your server will be public, and I'll most likely convert it to a binary format.
    <William.D | Perfectworld> before
    Reply With Quote  
     

  9. #9  
    Valar Morghulis

    Laxika's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    2,813
    Thanks given
    1,804
    Thanks received
    274
    Rep Power
    2128
    make a new table with this columbs:

    shopId
    itemId
    itemAmount

    and u can store with this. Make a new row for every item in the shops. (Not the best, better to use XML for this but it's work.)
    Reply With Quote  
     

  10. #10  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    30
    Posts
    1,357
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    The reason why I want to do this in mysql is so that I can update/add single shops whilst the server is online without loading the entire spawns or restarting.

    I have a solution at the moment what works but It isn't the best. I store the default shop info in mysql such as name, general, currency and then I have another field stock which uses the same syntax as our current cfg files. The server loads this field and splits it by spaces.
    Visit Rune Miracle Here
    Reply With Quote  
     

Page 1 of 2 12 LastLast

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
  •