Esempio n. 1
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#  Bradley M. Kuhn <*****@*****.**>
#
from pokerengine.pokerengineconfig import Config
from pokerengine import log as engine_log
log = engine_log.get_child('pokerprizes')


class PokerPrizes:
    """PokerPrizesVirtual base class for PokerPrizes"""

    log = log.get_child('PokerPrizes')

    def __init__(self,
                 buy_in_amount,
                 player_count=0,
                 guarantee_amount=0,
                 config_dirs=None):
        self.buy_in = buy_in_amount
        self.player_count = player_count
        self.guarantee_amount = guarantee_amount
Esempio n. 2
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#
import os
from os.path import exists, expanduser, abspath, isfile
from pokerengine.version import Version, version
from pokerengine import log as engine_log
log = engine_log.get_child('config')
import re

import libxml2
import libxslt


class Config:

    upgrades_repository = None
    upgrade_dry_run = False

    def __init__(self, dirs):
        self.path = None
        self.header = None
        self.doc = None
Esempio n. 3
0
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#
# 
from types import StringType
import re
from pokerengine import version_number
from pokerengine import log as engine_log
log = engine_log.get_child('version')

class Version:

    version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)$', re.VERBOSE)
    upgrade_re = re.compile(r'.*?(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)', re.VERBOSE)

    log = log.get_child('Version')

    def __init__ (self, vstring=None):
        if vstring:
            self.parse(vstring)

    def __repr__ (self):
        return "%s ('%s')" % (self.__class__.__name__, str(self))
Esempio n. 4
0
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#
import os
from os.path import exists, expanduser, abspath, isfile
from pokerengine.version import Version, version
from pokerengine import log as engine_log
log = engine_log.get_child('config')
import re

import libxml2
import libxslt

class Config:

    upgrades_repository = None
    upgrade_dry_run = False

    def __init__(self, dirs):
        self.path = None
        self.header = None
        self.doc = None
        self.dirs = [ expanduser(dir) for dir in dirs ]
Esempio n. 5
0
from math import ceil
from types import StringType
from pprint import pformat
import time, random


def tournament_seconds():
    return time.time()


shuffler = random

from pokerengine.pokergame import PokerGameServer
from pokerengine import pokerprizes
from pokerengine import log as engine_log
log = engine_log.get_child('pokertournament')

TOURNAMENT_STATE_ANNOUNCED = "announced"
TOURNAMENT_STATE_REGISTERING = "registering"
TOURNAMENT_STATE_RUNNING = "running"
TOURNAMENT_STATE_BREAK_WAIT = "breakwait"
TOURNAMENT_STATE_BREAK = "break"
TOURNAMENT_STATE_COMPLETE = "complete"
TOURNAMENT_STATE_CANCELED = "canceled"
TOURNAMENT_STATE_LOADING = "loading"

TOURNAMENT_REBUY_ERROR_TIMEOUT = "timeout"
TOURNAMENT_REBUY_ERROR_USER = "******"
TOURNAMENT_REBUY_ERROR_MONEY = "money"
TOURNAMENT_REBUY_ERROR_OTHER = "other"
Esempio n. 6
0
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#
#
from types import StringType
import re
from pokerengine import version_number
from pokerengine import log as engine_log

log = engine_log.get_child('version')


class Version:

    version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)$', re.VERBOSE)
    upgrade_re = re.compile(r'.*?(\d+\.\d+\.\d+)-(\d+\.\d+\.\d+)', re.VERBOSE)

    log = log.get_child('Version')

    def __init__(self, vstring=None):
        if vstring:
            self.parse(vstring)

    def __repr__(self):
        return "%s ('%s')" % (self.__class__.__name__, str(self))
#  Bradley M. Kuhn <*****@*****.**>
#
from math import ceil
from types import StringType
from pprint import pformat
import time, random

def tournament_seconds():
    return time.time()

shuffler = random

from pokerengine.pokergame import PokerGameServer
from pokerengine import pokerprizes
from pokerengine import log as engine_log
log = engine_log.get_child('pokertournament')

TOURNAMENT_STATE_ANNOUNCED = "announced"
TOURNAMENT_STATE_REGISTERING = "registering"
TOURNAMENT_STATE_RUNNING = "running"
TOURNAMENT_STATE_BREAK_WAIT = "breakwait"
TOURNAMENT_STATE_BREAK = "break"
TOURNAMENT_STATE_COMPLETE = "complete"
TOURNAMENT_STATE_CANCELED = "canceled"
            
def equalizeCandidates(games):
    #
    # Games less than 70% full are willing to steal players from other
    # games. Games that are more than 70% full and that are not
    # running are willing to provide players to others.
    #
Esempio n. 8
0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA.
#
# Authors:
#  Loic Dachary <*****@*****.**>
#  Bradley M. Kuhn <*****@*****.**>
#
from pokerengine.pokerengineconfig import Config
from pokerengine import log as engine_log
log = engine_log.get_child('pokerprizes')

class PokerPrizes:
    """PokerPrizesVirtual base class for PokerPrizes"""

    log = log.get_child('PokerPrizes')

    def __init__(self, buy_in_amount, player_count = 0, guarantee_amount = 0, config_dirs = None):
        self.buy_in = buy_in_amount
        self.player_count = player_count
        self.guarantee_amount = guarantee_amount

    def addPlayer(self):
        self.player_count += 1

    def removePlayer(self):