Server Help

ASSS Questions - Recommended Database?

corvey - Wed Apr 04, 2007 11:54 pm
Post subject: Recommended Database?
I need to know which database method is prefered for my module. Would it be MYSQL, or ASSS builtin database? I need to store and retrieve hundreds of planets data for players to access and manipulate. I would prefer this be all on the server side to avoid potential cheating.

Which database would be easier to implement PLANETS, INVENTORY, PLAYERS, SHIPS, etc..

My guess is MySQL, and I will have to read up on it. How hard would it be to integrate this into ASSS for what I need?

I would also need to make an external program to be able to access planet data so that the statistics can be updated by a defined hour. Population will have to grow you know biggrin.gif
Mine GO BOOM - Thu Apr 05, 2007 2:18 am
Post subject: Re: Recommended Database?
corvey wrote:
I would also need to make an external program to be able to access planet data so that the statistics can be updated by a defined hour.

If you plan on using this data in anything other than just ASSS, I'd recommend using SQL over anything else internal. Depending on the language you use, SQL can be very simple or annoying to add into your code.
corvey - Thu Apr 05, 2007 2:40 am
Post subject: Re: Recommended Database?
Mine GO BOOM wrote:
If you plan on using this data in anything other than just ASSS, I'd recommend using SQL over anything else internal. Depending on the language you use, SQL can be very simple or annoying to add into your code.



The only thing I can think of is a program to access the collected data so it can be manipulated daily, like population and stuff on the planet. I also would like to make web stats afterwards. I will need to be able to access that data somehow. Other than that it will be an ASSS only project, and that's where this module is meant to be! I will have no use for the code in anything else, it's a one time deal.
k0zy - Thu Apr 05, 2007 4:30 am
Post subject:
I'd go with MySQL.
If you're planing on having web stats later this will probably be the easyiest way.

You could also look at PostgreSQL which has a better implementation of stored procedures, triggers and transactions.
It's not something you might want to use now, but it's a fine thing to look into if you plan on doing more database related stuff later on.
corvey - Thu Apr 05, 2007 7:48 am
Post subject:
I already have ASSS and MySQL talking, but it doesn't have much of a GUI interface to help, yes, MySQL Administrator GUI tool is installed and it isn't much help either, it's just kinda THERE, not much to do with it, and ASSS installed it's own stuff in there to get itself going. I don't know much about MySQL, but I would like to learn a little bit to get me going.


Any suggestions on how to receive from and send to MySQL database through a homemade module for ASSS?? Please be specific and detailed.
Doc Flabby - Thu Apr 05, 2007 11:45 am
Post subject:
GUI for mysql http://www.heidisql.com/
steigerwald - Thu Apr 05, 2007 12:04 pm
Post subject:
try phpmyadmin
Cyan~Fire - Thu Apr 05, 2007 2:11 pm
Post subject:
I'd take a real client over phpMyAdmin any day.
k0zy - Thu Apr 05, 2007 4:22 pm
Post subject:
There's an official MySQL gui.

http://www.mysql.com/products/tools/administrator/
http://dev.mysql.com/downloads/gui-tools/5.0.html
BDwinsAlt - Thu Apr 05, 2007 5:01 pm
Post subject:
I would also suggest MySQL. A few basic commands is all you really need to know for it anyways. I didn't know there was a GUI for it besides phpMyAdmin.
Dr Brain - Thu Apr 05, 2007 5:22 pm
Post subject:
The fact that there's already a mysql module makes it a no-brainer.
Animate Dreams - Thu Apr 05, 2007 5:26 pm
Post subject:
Yeah, if you're going to use mysql, you probably shouldn't bother with a GUI at all. Since your program is going to have to access everything, you'll have to know how to do it manually anyway. It might be nice to play around and experiment with, but when it comes down to making the actual module, you'll have to do it all through commands, so it's probably best just to do it that way. Maybe a GUI would help you tell if you were doing it right a bit easier, though. I'm not sure, I don't really know anything about databases yet. >_>
BDwinsAlt - Thu Apr 05, 2007 7:02 pm
Post subject:
Here are some sample commands you can try out.

If your on windows go into the start menu> programs> mysql*> and click on the admin thing.

If your on linux you can just type: mysql -p dataBaseName
then just type in the password for it.

After you get the prompt "mysql>" then go ahead and try these commands.

Code: Show/Hide

SHOW databases;
USE database_name;   // [E.X.: Use asss]
SHOW tables;
SELECT * FROM table_name;
// Notice there will be an output of everything in that table or it will say it is empty.
//  Now find the names that come up with a list of data under it.
SELECT what_you_found FROM table_name;
SELECT * FROM table_name WHERE what_you_found = 'something';
// It will return empty or show you everything about that area.


Code: Show/Hide

// Here is an example
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| TCPBiller          |
| asss               |
| auth               |
| members            |
| mysql              |
| php                |
| tcpbiller          |
+--------------------+
8 rows in set (0.00 sec)

mysql> use auth
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+----------------+
| Tables_in_auth |
+----------------+
| user           |
+----------------+
1 row in set (0.00 sec)

mysql> SELECT * FROM user;
+-----------+----------------------------------+
| name      | pass                             |
+-----------+----------------------------------+
| brad      | 958636f23559f431b8bd2e605fdbc2f5 |
| wkbmarine | 323a57bff1764b0e680478bdb006682a |
+-----------+----------------------------------+
2 rows in set (0.02 sec)

mysql> SELECT name  FROM user;
+-----------+
| name      |
+-----------+
| brad      |
| wkbmarine |
+-----------+
2 rows in set (0.00 sec)

mysql> SELECT * FROM user where name = 'brad';
+------+----------------------------------+
| name | pass                             |
+------+----------------------------------+
| brad | 958636f23559f431b8bd2e605fdbc2f5 |
+------+----------------------------------+
1 row in set (0.00 sec)

mysql> SELECT * FROM user where name = 'bra33d';
Empty set (0.00 sec)



If you can understand how this work then you can easily update/add rows. Just google it.
Muskrat - Fri Apr 06, 2007 2:52 am
Post subject:
Ugh I HATE MySQL and Normalization! Taking Database Theory and Practice was probably the worst mistake of my life...
corvey - Sat Apr 07, 2007 6:28 am
Post subject:
Doc Flabby wrote:
GUI for mysql http://www.heidisql.com/


Thanks man! it's great!



I also found Navicat for MySQL, and it looks sweet..

Does anyone have or know of a open source module for the ASSS server that connects to MySQL database so I can see how it enters and retrieves data through C? It would shave some time off an already long and lonely project if I can see the format icon_smile.gif

Or if you happen to know the answer and would be so kind as to explain the format, or perhaps know of a link with the precise information I'm looking for, I would appreciate it.



Thanks
Dr Brain - Sat Apr 07, 2007 9:03 am
Post subject:
Uh, have you looked at the built in one I talked about in my post? Database:mysql?
corvey - Sat Apr 07, 2007 3:36 pm
Post subject:
Dr Brain wrote:
The fact that there's already a mysql module makes it a no-brainer.


Dr Brain wrote:
Uh, have you looked at the built in one I talked about in my post? Database:mysql?



Care to make a real reference statement? If this first post is what your talking about, I am not amused.
Mine GO BOOM - Sat Apr 07, 2007 4:12 pm
Post subject:
corvey wrote:
Care to make a real reference statement? If this first post is what your talking about, I am not amused.

Searching the ASSS source files for MySQL results in src/database/mysql.c which is the included MySQL module he is talking about.
corvey - Sat Apr 07, 2007 4:29 pm
Post subject:
ok, I'm sorry for sounding or looking ignorant to you. MySQL.C is not what I'm talking about. Please allow me to rephrase the question for the correct answer.

Does anyone have a game module coded in C for the ASSS server that uses MYSQL for it's database so that I may see for an example how they implement it into their code?
BDwinsAlt - Sat Apr 07, 2007 8:19 pm
Post subject:
Have you tried Alias.c (located in the same folder as mysql.c)?
That is a great example of how asss uses mysql.
corvey - Mon Apr 09, 2007 7:43 am
Post subject:
BDwinsAlt wrote:
Have you tried Alias.c (located in the same folder as mysql.c)?
That is a great example of how asss uses mysql.



I'm investigating it now. Thanks for the pointer BDwinsAlt
CypherJF - Mon Apr 09, 2007 6:38 pm
Post subject:
I didn't really read above but the best MySQL client I've found yet to date is SQLYog (it's free / community edition). Windows only, I believe.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group