Page 1 of 1

gg_convert = gg4: winners [TODO]

PostPosted: Sat Nov 08, 2008 3:14 pm
by Lob
Hi Guys,

Just a quick question regarding gg_convert.

I notice that gg3 winners can be converted but gg4 winners is not completed as of yet.

How long do you anticipate it will be until this part of the convert is completed.

I only ask as i have been looking forward to Gungame 5 but it would cause mayhem if my devoted players all lost their ranks.

I suspect this would be the case with a lot of other Servers too.

Thanks

- Lob

PostPosted: Sat Nov 08, 2008 10:05 pm
by XE_ManUp
I would imagine since GunGame4 uses SQLite to store the winners that this shouldn't be too hard to do. Saul is the one that has coded gg_convert, so I will have to see what he says.

PostPosted: Sat Nov 08, 2008 11:26 pm
by Saul
I have no experience(AT ALL) in SQL. If someone could do the code to do a loop through the SQL data in the file, I will happily code the rest.

Re:

PostPosted: Sun Nov 09, 2008 12:05 am
by XE_ManUp
Saul wrote:I have no experience(AT ALL) in SQL. If someone could do the code to do a loop through the SQL data in the file, I will happily code the rest.

I need a GG4 winners database. Could someone provide me one so I could test it out? ;)

*cough* *hint* *cough*

PostPosted: Sun Nov 09, 2008 12:20 am
by Don
Here you go:

Re: gg_convert = gg4: winners [TODO]

PostPosted: Sun Nov 09, 2008 12:41 am
by Lob
Thanks very much Guys.

Your efforts are greatly appreciated. ;)

- Lob

PostPosted: Thu Nov 13, 2008 8:27 am
by Fragenstein
I was just gonna submit a post regarding updating the GG4 winner database to GG5. Any update on this?

Re:

PostPosted: Thu Nov 13, 2008 9:19 am
by XE_ManUp
Fragenstein wrote:I was just gonna submit a post regarding updating the GG4 winner database to GG5. Any update on this?

I have been gone for the past 6 days due to work. I haven't had a chance to mess with it yet. As soon as I get a chance, I will get this done.

PostPosted: Wed Nov 19, 2008 7:39 pm
by PitBull
I'm currently writing on a GG4 converter. I think it's finished, I will try it tomorrow. If it's working, I will upload the code. Sc0pE already offered me to include the code into the gg_converter for GG3. Would be great ;)

PostPosted: Wed Nov 19, 2008 9:47 pm
by Saul
Awesome! You mind posting the code here first so we can have a look?

Re:

PostPosted: Thu Nov 20, 2008 12:22 am
by Fragenstein
PitBull wrote:I'm currently writing on a GG4 converter. I think it's finished, I will try it tomorrow. If it's working, I will upload the code. Sc0pE already offered me to include the code into the gg_converter for GG3. Would be great ;)


Sweet! :P

Re:

PostPosted: Thu Nov 20, 2008 4:47 pm
by PitBull
Saul wrote:Awesome! You mind posting the code here first so we can have a look?

The important part of code is this one:
def convert():
    es.sql('open', 'gg_database', '|gungame4/db')
    es.sql('query', 'gg_database', 'gg4c_db', 'SELECT * FROM gg_players')
    es.sql('close', 'gg_database')
   
    for steamid in gg4c_db['steamid']:
        dict_winners[steamid]['name'] = gg4c_db['name']
        dict_winners[steamid]['wins'] = gg4c_db['wins']

I don't know if I have a error in reasoning, but I think it should work. I'm currently setting up a test server. Could take about 1-2 hours.

Best Regards, PitBull

//EDIT: I tried it as above, but it doesn't work. I'm currently trying some other methods. I will answer again when I made it ;)
//EDIT2: I opened a new topic for that. Go here!

PostPosted: Fri Nov 21, 2008 6:21 pm
by Warren
We have added a GunGame4 converter based off of that code you started PitBull. Thanks for the help!

http://code.google.com/p/gungame-python ... tail?r=553

PostPosted: Fri Nov 21, 2008 6:28 pm
by PitBull
I'm glad that it is now working. I'm also very impressed how you realised it. Nice ;)

~PitBull

PostPosted: Sat Nov 22, 2008 11:26 am
by Saul
Nice one Sc0pE. The only thing I disagree with is the: try: except: clause. I'm sure we can come up with a better alternative that just catching all errors.

PostPosted: Sat Nov 22, 2008 5:30 pm
by Lob
Good Work Guys

Thanks

- Lob

Re:

PostPosted: Sat Nov 22, 2008 5:54 pm
by Warren
Saul wrote:Nice one Sc0pE. The only thing I disagree with is the: try: except: clause. I'm sure we can come up with a better alternative that just catching all errors.

I agree. Some players in the GG4 Database aren't real players, for example they didn't even have a steamid set up, so it just spammed errors for those other parts of the DB that weren't players.

PostPosted: Sat Nov 22, 2008 6:10 pm
by Warren
It turns out that the:
if not wins:
    continue

section gets rid of these not-real-people and doesn't spam any errors.

I am committing r555.