Hello all, long time no write. :-) (I havn't posted to the list for a very very long time, over a year I think.) I've been considering changing the player files to use msql instead of the existing way of using plain files. Before I decide to start, I figured I'd get some more input from you people. What I am going to do is give you lots of info about it in the format of convincing you that you should use msql. (This is how it turned out that I wrote it, and I do not want to rewrite the whold thing. Now, msql is a database program for unix (unrelated to the sql of microsoft) that is a little smaller and simpler than a regular database program. (mini sql) I figure that it will be easier to use than the files since all you do is connect to the database and send a single query for the info, you don't need to parse anything or do anything like that. ex: select Name,Level,Class from pfile where Id = '1' select * from pfile where Name like '%oyn%' and Class = 'W' select Name from pfile where Class = 'M' You can customize the query very easily and it will return the information in an easy to use format. In these examples the first will return the Name, Level, and Class of any player that has an id of 1. The secon will return all of the information in the player file for the players that have oyn in there name and have a class that is warrior. The third will return the Name of every player that has a class of Mage. It is very easy to update the info too: update pfile set Name = 'Cyan' where Name = 'Cyon' and Id = '1' update pfile set Class = 'Warrior' where Class = 'W' update pfile set Desc = '' where Desc like '%f***%' or Desc like '%s***%' This would change any players name to Cyan where the name is currently Cyon and has an id of 1. The second would change any class that is W to Warrior, and the third would remove any description that includes the two swear words that aren't listed :-) With the ability of the msql database, it would be very easy search for information, update a players information (change it) and even update the pfile itself. All you need to do is type msqldump, save the information that it prints, enter the database and use the create table command and you can completely redo the database. Then, when the database is ready to have the info put back in, all you would do is copy and paste the msqldump stuff back into the database and it will put the info back in automatically. Now, that is a litte harder than the ASCII pfiles, but it is almost as easy, and is much easier than the other type of files. Also, with the database, you can have as many connections to it as you want and it will process all of them in order. What this means is that you can enter the database from outside the mud and make changes to it, even at the exact second that the mud is doing something with it. Next, using the database, any changes that you want to make take place instantly and you can make any change you want. Also, the database itself takes care of field length, so some of that could be removed from the mud code. Also, if the msql is being used for the pfiles, it could just as easily be used for everything else, such as mail, boards, and the world. One very good thing if it was used with the worlds would be that it would be much easier to keep everything in order and any changes would take place instantly instead of having to reload stuff. Not a huge gain, but pretty good. Now, one big question that I have is which is faster. I do not have any good way to compare it other than to have two stock muds and have one with msql and one without. This is possible, but I do not feel like spending tons and tons of time changing the code to find out it is very slow. I know that it is pretty fast since it is used in BestWeb for all the information we need to save. (All the customer info, payments, user info, etc.) Ok, I think that this is everything about the database that would help. I would very much appreciate any input whatsoever about whether or not this would be worthwhile. Thanks! Mark Dickey +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST