示例#1
0
文件: Player.py 项目: vemel/fofix
def updatePlayer(player, pref):
    a = _playerDB.execute('SELECT * FROM `players` WHERE `name` = ?', [player]).fetchone()
    try:
        a = a[0]
    except:
        a = None
    if a is not None:
        _playerDB.execute('UPDATE `players` SET `name` = ?, `lefty` = ?, `drumflip` = ?, `autokick` = ?, `assist` = ?, `twochord` = ?, `necktype` = ?, `neck` = ?, \
                       `part` = 0, `difficulty` = 2, `upname` = ?, `control` = 0, `changed` = 1, `loaded` = 1 WHERE `name` = ?', pref + [player])
        if player != pref[0]:
            VFS.rename(_makePlayerIniName(player), _makePlayerIniName(pref[0]))
    else:
        _playerDB.execute('INSERT INTO `players` VALUES (?, ?, ?, ?, ?, ?, ?, ?, 0, 2, ?, 0, 1, 1)', pref)
    _playerDB.commit()
    savePlayers()
    loadPlayers()
示例#2
0
文件: Player.py 项目: vemel/fofix
def renameControl(control, newname):
    VFS.rename(_makeControllerIniName(control), _makeControllerIniName(newname))
    for i in range(4):
        if Config.get("game", "control%d" % i) == control:
            Config.set("game", "control%d" % i, newname)
    loadControls()