Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
MySQL module in PY

 
Post new topic   Reply to topic Printable version
 View previous topic  Race Post :: Post <py> turretwar  View next topic  
Author Message
UKillMe
Guest


Offline

PostPosted: Sun Oct 23, 2005 7:08 am    Post subject: MySQL module in PY Reply to topic Reply with quote

Hiya,

Trying to write a module that uses the I_RELDB interface from the mysql module to do some basic querying on a mysql server, but I'm running into a problem where it can't evaluate the I_RELDB name in

db = get_interface(I_RELDB)

after doing a

from asss import *

I've tried importing from "reldb" and from "mysql" and it says there are no modules with those names. Help?
Back to top
i88gerbils
Oldbie Server Help


Gender:Gender:Male
Joined: Dec 13 2002
Posts: 423
Location: OH
Offline

PostPosted: Sun Oct 23, 2005 11:49 am    Post subject: Reply to topic Reply with quote

Hmm, I don't see anything in reldb.h that notes it supports Python.
_________________
Oldbie Server Help
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website Yahoo Messenger
UKillMe
Guest


Offline

PostPosted: Sun Oct 23, 2005 12:08 pm    Post subject: Reply to topic Reply with quote

Well I've just started messing around with ASSS so I'm not all that familiar with it. I didn't realize that I could only use some of the interfaces in Py. Can anyone confirm?
Back to top
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Sun Oct 23, 2005 10:44 pm    Post subject: Reply to topic Reply with quote

Yes, not all interfaces are available in python. They need special directives to the glue generating script, in comments. See game.h for example. The python stuff didn't used to support callbacks, which the reldb interface uses, so it wasn't possible, but it might be now. I'll look into it. If you want, you can file a bug, so I don't forget.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
UKillMe
Guest


Offline

PostPosted: Sun Oct 23, 2005 10:48 pm    Post subject: Reply to topic Reply with quote

Cool, thanks a lot Grel.
Back to top
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Mon Oct 24, 2005 1:53 am    Post subject: Reply to topic Reply with quote

Done. This is available in the latest source. The catch is that the parameter substitutions in Query don't work, so I added an explicit EscapeString function. It would be relatively easy to wrap Query and EscapeString in a library function that duplicates the parameter substitution feature.

But: I shouldn't leave without asking what you're using mysql for. If you're storing information about players, or arenas, or small global state, you should be using the persistent data feature instead. You'll get better integration into the rest of the server, automatic serialization, and automatic history, with much less code to write.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Guest



Offline

PostPosted: Mon Oct 24, 2005 2:14 am    Post subject: Reply to topic Reply with quote

It's a module to sign players up in the database for HZ's league site, which is a MySQL server sa_tongue.gif
Back to top
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Mon Oct 24, 2005 1:32 pm    Post subject: Reply to topic Reply with quote

Ok, I'd consider that a legitimate use for mysql.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Custom Projects All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 127 page(s) served in previous 5 minutes.

phpBB Created this page in 0.117864 seconds : 33 queries executed (36.9%): GZIP compression disabled