コード例 #1
0
ファイル: Server.py プロジェクト: sprocter/wcsapp
def handleHeadsUpMatch(match):
    newMatch = DBEntry()
    newMatch.matchtype = 'bracket'
    newMatch.scheduleid = lastSchedule.id
    newMatch.player1name = getStr(match, 'player1')
    newMatch.player2name = getStr(match, 'player2')
    newMatch.player1race = getStr(match, 'player1race')
    newMatch.player2race = getStr(match, 'player2race')
    newMatch.player1flag = getStr(match, 'player1flag')
    newMatch.player2flag = getStr(match, 'player2flag')
    newMatch.player1wins, newMatch.player2wins = handleGame(match)
    if match.has('winner') and getInt(match, 'winner') > 0:
        newMatch.winner = getInt(match, 'winner')
    else:
        newMatch.winner = None
    matches.append(newMatch)
コード例 #2
0
ファイル: Server.py プロジェクト: DenisKealy/wcsapp
def handleMatch(match, matchTitle):
    newMatch = DBEntry()
    newMatch.matchtype = "group"
    newMatch.scheduleid = lastSchedule.id
    newMatch.player1name = getStr(match, "player1")
    newMatch.player2name = getStr(match, "player2")
    newMatch.player1race = getStr(match, "player1race")
    newMatch.player2race = getStr(match, "player2race")
    newMatch.player1flag = "-"
    newMatch.player2flag = "-"
    p1wins, p2wins = handleGame(match)
    newMatch.player1wins = p1wins
    newMatch.player2wins = p2wins
    newMatch.winner = getInt(match, "winner")
    matches.append(newMatch)
コード例 #3
0
ファイル: Server.py プロジェクト: DenisKealy/wcsapp
def handleBracketEntry(entry, prefix1, prefix2, prefixg, title):
    if entry.has(prefixg + 'details'):
        bracketMatchSummary = entry.get(prefixg + 'details').value.filter_templates(matches=r'BracketMatchSummary')[0]
        handleScheduleEntry(bracketMatchSummary, title, 
                            unicode(entry.get(prefix1[:2]).value).strip() if entry.has(prefix1[:2]) else unicode(entry.name).strip())
        handleGame(bracketMatchSummary)
    newMatch = DBEntry()
    newMatch.matchtype = 'bracket'
    newMatch.scheduleid = lastSchedule.id
    newMatch.player1name = getStr(entry, prefix1)
    newMatch.player2name = getStr(entry, prefix2)
    newMatch.player1race = getStr(entry, prefix1 + 'race')
    newMatch.player2race = getStr(entry, prefix2 + 'race')
    newMatch.player1flag = getStr(entry, prefix1 + 'flag')
    newMatch.player2flag = getStr(entry, prefix2 + 'flag')
    newMatch.player1wins = getStr(entry, prefix1 + 'score')
    newMatch.player2wins = getStr(entry, prefix2 + 'score')
    if entry.has(prefix1 + 'win') and getInt(entry, prefix1 + 'win') > 0:
        newMatch.winner = 1
    elif entry.has(prefix2 + 'win') and getInt(entry, prefix2 + 'win') > 0:
        newMatch.winner = 2
    else:
        newMatch.winner = None
    matches.append(newMatch)