Exemplo n.º 1
0
    def __init__(self, *args, **kwargs):
        print "Starting server ..."
        self.id = 0
        self.objects_id = 0
        Server.__init__(self, *args, **kwargs)
        self.UDPconnector = ServerUDP(*args, **kwargs)
        self.UDPconnector.SetTarget(self)

        self.clock = pygame.time.Clock()
        self.players = dict()

        self.spectators = []
        self.playingA = []
        self.playingB = []
        self.max_side = 1

        self.game = Game_handler((900, 600), "Head soccer server 0.1")
        self.game.add_pitch(self.NextObjectsId(), self.NextObjectsId(),
                            self.NextObjectsId())
        self.game.SetTarget(self)
        self.play = True
        self.start = False
        self.scoreA = 0
        self.scoreB = 0
        self.time = 0
        self.ball = None
        self.timeREF = 0
        self.status = "playing"
        self.lastGoal = 0
        self.CentralMessage = "Waiting for players ..."
        self.SizeCentral = 30
Exemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     """Initialize the MazeServer at server start."""
     Server.__init__(self, *args, **kwargs)
     # start with an empty dict of connected clients
     self.clients = {}
     self.maze_rows = None
     print('MazeServer launched')
Exemplo n.º 3
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.players = WeakKeyDictionary()
     self.players_order = WeakKeyDictionary()
     self.current_index = 0
     self.clock = pygame.time.Clock()
     print('Server launched')
Exemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     pygame.init()
     self.players = WeakKeyDictionary()
     self.renderables = []
     self.timer = time.Clock()
     print 'Server launched'
Exemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     print('in server init')
     self.players = []
     self.rooms = []
     self.player_id = -1
     print('Server launched')
Exemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.clients = []
     self.run = False
     pygame.init()
     self.screen = pygame.display.set_mode((128, 128))
     print('Server launched')
Exemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     #Call the super constructor
     Server.__init__(self, *args, **kwargs)
     #Create the objects to hold our game ID and list of running games
     self.games = []
     self.queue = None
     self.gameIndex = 0
Exemplo n.º 8
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.players = []
     self.start_time = 'NA'
     self.timer_last = 'NA'
     self.timer_channel = 'NA'
     self.channels = []
Exemplo n.º 9
0
    def __init__(self, untracked=False, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        # Internal
        self.untracked = untracked
        self.user_channels = []
        self.initialize_new_game = True
        self.ready_count = 0
        self.ordered_names = []
        self.paused = False

        # In game specific
        self.waiting_for_user = False
        self.should_deal_hand = True
        self.next_to_bid_first = 0

        # Public (with hand display caveat)
        self.boardstate = {
            'activity': "bid",
            'reverse_sort': False,
            'next_to_act': 0,
            'hand_num': 1,
            'trump_card': None,
            'led_card': None,
            'players': dict(),
            'score_history': {},
            'messages': list()
        }

        print("Server launched")
Exemplo n.º 10
0
 def __init__(self, *args, **kwargs):
     # ведет отсчет ID для назначения их новым подключениям
     self.id = 0
     Server.__init__(self, *args, **kwargs)
     # создать словарь для хранения иформации об игроках:
     self.players = dict()
     print('Server launched')
Exemplo n.º 11
0
	def __init__(self, *args, **kwargs):
		Server.__init__(self, *args, **kwargs)
		self.id = 0 	#counter for assigning IDs to connected clients
		self.players = WeakKeyDictionary()
		self.name = sys.argv[2]
		self.passwordHash = {"none":"none"}

		path = [str("log/server/" + self.name + "/"), str("serverData/" + self.name + "/")]

		for pathname in path:
			try:
				os.makedirs(pathname)
			except OSError:
				if not os.path.isdir(pathname):
					raise

		self.printl('')
		self.printl('----------------------')
		self.printl('GenericServer launched')
		self.printl('----------------------')
		self.printl('>> Welcome to ' + str(self.name))
		self.printl('')

		#print self.passwordHash
		self.openPasswordHash()
Exemplo n.º 12
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.playerIdToPlayerChannel = dict()
     self.playerIdToRoom = dict()
     self.counter = 0
     self.nextId = 0
     self.playerIdToUsername = dict()
Exemplo n.º 13
0
	def __init__(self, game, *args, **kwargs):
		Server.__init__(self, *args, **kwargs)
		self.game = game
		self.client = None
		self.my_color = ['White', 'Black'][random.randint(0, 1)]
		self.game_started = False
		print('Server launched')
Exemplo n.º 14
0
    def __init__(self, *args, **kwargs):

        Server.__init__(self, *args, **kwargs) # call the super constructor
        print "Created the game server"
        self.games = []
        self.queue = None # Every odd'th player will wait in the queue for a pair player
        self.gameIndex = 0 # how many games the server handles
Exemplo n.º 15
0
    def __init__(self,*args,**kwargs):

        Server.__init__(self,*args,**kwargs)
        Log.Print("Starting server...")

        self.ip = kwargs["localaddr"][0]
        self.port = kwargs["localaddr"][1]
        self.svr_name = raw_input("Server name: ")
        while not MySQL.AddServer(self.svr_name,self.ip):
            Log.Print("Name allready exists")
            self.svr_name = raw_input("New name: ")
        MySQL.CheckDeadServers()
        ##### START UDP #####
        self.UDPconnector = ServerUDP(*args,**kwargs)
        self.UDPconnector.SetTarget(self)
        self.UDPconnector.SetPing(config.ping_server)

        self.id = 0
        self.mode = "Quickmatchs server"
        self.max_players = 10
        self.name = "Newtonis's server"
        self.clients = dict()
        self.players = dict()
        self.gameWorlds = dict()
        self.dictOrder = []

        self.play = True
        #self.commandsThread = threading.Thread(target=self.CommandThreadDef,name="Commands thread")
        #self.commandsThread.start()
        self.Add5Rooms()
        self.last_time_sql_updated = time.time()
Exemplo n.º 16
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.id_inc = 0
     
     self.clients = []
     self.entities = []
     
     # Entities that can be hit.
     self.collided = []
     
     # Entites that hit.
     self.colliders = []
     
     # Static Objects in space.
     # Functions for the entities.
     self.functions = {
         'new_id': self.get_id,
         'add_entity': self.add_entity,
         'remove_entity': self.remove_entity,
         'system_size': SYSTEM_SIZE,
     }
     
     # A Planet to respawn at:
     planet = Entity(self.functions)
     planet.type = 'planet'
     self.entities.append(planet)
Exemplo n.º 17
0
	def __init__(self, *args, **kwargs):
		Server.__init__(self, *args, **kwargs)
		api.server = self
		api.send_message = self.send_message
		api.send_message_to_all = self.send_message_to_all
		api.exec_chat_command = self.exec_chat_command

		self.players = WeakKeyDictionary()
		self.waiting_for_join = WeakKeyDictionary()

		self.player_stats = {'active': True}
		self.player_stats_max = {}

		self.chat_commands = api.chat_commands
		api.register_chat_command('help', self.command_help)

		self.players_count = 0

		self.object_classes = api.object_classes
		self.tile_classes = api.tile_classes

		self.install_mods()

		self.world = None
		self.load_world('default_world')

		self.last_time = sys_time()

		print("Server launched")
		start_new_thread(self.command_input, ())
Exemplo n.º 18
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.clients = []
     self.run = False
     self.idZombie = 0
     pygame.init()
     self.screen = pygame.display.set_mode((128, 128))
     print('Server launched')
Exemplo n.º 19
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.clients = WeakKeyDictionary()
     # [[room_full_flag, ready_state, player_who_get_first_turn],
     # [board1, board2, player_owns_board1, player_owns_board2], status, player1, player2]
     # room_full_flag=1 means room is full
     self.client_pairs = []
     print 'Server launched'
Exemplo n.º 20
0
 def __init__(self, *args, **kwargs):
     print('Creating Server')
     Server.__init__(self, *args, **kwargs)
     self.players_map = []
     self.floaters = []
     self.gamerooms = []
     self.disconnected = []
     self.users = []
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.players = {}
     self.responses = Queue()
     self.stop_threads = False
     self.loop = threading.Thread(target=self.keep_pumping)
     self.loop.daemon = True
     self.loop.start()
Exemplo n.º 22
0
 def __init__(self, *args, **kwargs):
     self.id = 0
     Server.__init__(self, *args, **kwargs)
     self.games = []
     self.queue = None
     self.currentIndex=0
     self.players = []
     print('Server launched')
Exemplo n.º 23
0
 def __init__(self, *args, **kwargs):
     self.id = 0
     Server.__init__(self, *args, **kwargs)
     self.p1 = None
     self.p2 = None
     self.ready = False
     self.waiting_player_list = deque()  # Make a FIFO queue for waiting clients (no limit to waiting clients)
     print 'Server launched'
Exemplo n.º 24
0
 def __init__(self):
     self.ip,self.port = "localhost",1998
     self.id = 0
     self.clients = dict()
     self.right_last = 0
     self.left_last = 0
     self.columns = []
     self.columns_active = dict()
     Server.__init__(self,localaddr=(self.ip,self.port))
Exemplo n.º 25
0
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)

        # Objects to hold in-case of multi instance;
        self.games = []
        self.queue = None
        self.gameIndex = 0

        self.velocity = 5
Exemplo n.º 26
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.players = WeakKeyDictionary()
     self.available_classes = [RedPlayer('R'), BluePlayer('B'), GreenPlayer('G'), YellowPlayer('Y')]
     self.player_to_class = {}
     self.game_started = False
     self.current_player_dice = 0
     self.player_now_should_be_prompt_to_pick_a_pawn = True
     print('Server launched')
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        self.clients = []
        self.run = False
        pygame.init()
        self.shot_group = pygame.sprite.RenderClear()

        self.screen = pygame.display.set_mode((128, 128))
        print('Server launched')
Exemplo n.º 28
0
 def __init__(self, *args, **kwargs):
     self.playing = True
     self.log = []
     self.showLog = True
     self.AddLog("Starting server ...")
     self.id = 0
     self.player = dict()
     self.rooms = dict()
     Server.__init__(self, *args, **kwargs)
    def __init__(self,*args,**kwargs):
        self.playing = True
        self.log = []
        self.showLog = True
        self.AddLog("Starting server ...")
        self.id = 0
        self.player  = dict()
	self.rooms   = dict()
        Server.__init__(self,*args,**kwargs)
Exemplo n.º 30
0
    def __init__(self, server='localhost', port=31425):
        Server.__init__(self, localaddr=(server, port))
        self.clients = WeakKeyDictionary()
        self.client_count = 0

        self.games = {}
        self.game_count = 0

        self.new_game()
Exemplo n.º 31
0
    def __init__(self, *args, **kwargs):
        self.conf = kwargs["conf"]
        self.id = self.conf.CLIENT_ID
        del kwargs["conf"]
        logging.debug("using master.conf from %s", self.conf)

        Server.__init__(self, *args, **kwargs)
        self.clients = WeakKeyDictionary()
        logging.debug("Server launched")
Exemplo n.º 32
0
	def __init__(self, *args, **kwargs):
		self.id = 0
		Server.__init__(self, *args, **kwargs)
		self.players = WeakKeyDictionary()
		self.cards = WeakKeyDictionary()
		self.tokens = WeakKeyDictionary()
		self.acts = WeakKeyDictionary()
		self.mss = WeakKeyDictionary()
		print 'Server launched'
Exemplo n.º 33
0
    def __init__(self, *args, **kwargs):
        self.id = conf.CLIENT_ID
        self.conf = kwargs['conf']
        del kwargs['conf']
        print 'master.conf',self.conf

        Server.__init__(self, *args, **kwargs)
        self.clients = WeakKeyDictionary()
        print 'Server launched'
Exemplo n.º 34
0
 def __init__(self):
     self.ip, self.port = "localhost", 1998
     self.id = 0
     self.clients = dict()
     self.right_last = 0
     self.left_last = 0
     self.columns = []
     self.columns_active = dict()
     Server.__init__(self, localaddr=(self.ip, self.port))
Exemplo n.º 35
0
    def __init__(self, *args, **kwargs):
        self.id = 0
        Server.__init__(self, *args, **kwargs)
        self.p1 = None
        self.p2 = None
        self.ready = False
        # Make a FIFO queue for waiting clients (no limit to waiting clients)
        self.waiting_player_list = deque()

        print('Server launched')
Exemplo n.º 36
0
	def __init__(self, *args, **kwargs):
		Server.__init__(self, *args, **kwargs)
		
		self.gameChannels ={} #Dictionary mapping channels to their account name.
		#It's named gameChannels because PodSix uses channels.
		self.loginChannels = [] #List of channels that haven't logged in yet.
		
		self.playerEntities = {} ##Temporary list of player entities.
		
		print 'Server launched'
Exemplo n.º 37
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.players = WeakKeyDictionary()
     self.games = []  ## lista que contiene todos los juegos en curso
     self.queue = None
     self.currentgame = 0
     self.activegames = 0
     #self.currentplayer =0
     print 'Server launched'
     self.start = False
Exemplo n.º 38
0
 def __init__(self, *args, **kwargs):
     #Init. the server
     Server.__init__(self, *args, **kwargs)
     # initialise an empty array of players
     self.players = []
     print("Server initialised")
     # empty array of players ready
     self.playersready = []
     #setting up an array to store the scores of the players
     self.currentscores = [0, 0, 0]
     #an array to store the actions of the player each round
     self.actions = []
     #a parallel array to store the numbers of the players with their actions
     self.actionsplayer = []
     #setting up the co-ordinates
     self.square = random_squares()
     #stores whether the clients are all ready
     self.allready = False
     #rob flag
     self.robflag = False
     #stores the player chosen to be attacked
     self.playerattack = None
     #stores the player attacking
     self.playerattacking = None
     #kill flag
     self.killflag = False
     #the action of the player
     self.playeraction = None
     #present flag
     self.presentflag = None
     #setting up an array to store the bank scores
     self.bank = [0, 0, 0]
     #mag. flag
     self.magflag = False
     #stores individual scores
     self.playerscore = None
     #an array to tell when all the clients are ready for the next round
     self.loopagain = []
     #swap flag
     self.swapflag = False
     #used in the swap subroutine
     self.temp = None
     #used to send a summary of what has happened in the round
     self.sum = [[], [], [], [], []]
     # Setting up the shield array
     self.shield = [False, False, False]
     # Setting up the mirror array
     self.mirror = [False, False, False]
     #use when the player being attacked has a mirror
     self.newtobeattacked = None
     self.newattacker = None
     #wild card flag
     self.wildflag = False
     #used to store the action chosen by the player with a wild card
     self.wildaction = None
Exemplo n.º 39
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.clients = []
     self.run = False
     self.fin = False
     self.counter = -1200
     pygame.init()
     self.platforme_sprite = pygame.sprite.RenderClear()
     self.screen = pygame.display.set_mode((128, 128))
     self.platforme()
     print('Server launched')
Exemplo n.º 40
0
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)

        self.gameChannels = {
        }  #Dictionary mapping channels to their account name.
        #It's named gameChannels because PodSix uses channels.
        self.loginChannels = []  #List of channels that haven't logged in yet.

        self.playerEntities = {}  ##Temporary list of player entities.

        print 'Server launched'
Exemplo n.º 41
0
 def __init__(self, *args, **kwargs):
     """Initialize the server."""
     Server.__init__(self, *args, **kwargs)
     
     self.start = False
     self.wait_to_start = -1
     self.quit = 0
     self.host = None
     self.players = []
     
     self.address, self.port = kwargs['localaddr']
     print "Server started at", self.address, "at port", str(self.port)
Exemplo n.º 42
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.clients = []
     self.entities = []
     
     # Entities that can be hit.
     self.collided = []
     
     # Entites that hit.
     self.colliders = []
     
     self.id_inc = 0
Exemplo n.º 43
0
 def __init__(self, untracked=False, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.users = []
     self.name_to_user = dict()
     self.ready_count = 0
     self.hand_num = 1
     self.scores = dict()
     self.next_to_play_idx = 0
     self.gb = None
     self.should_resume = False
     self.untracked = untracked
     print("Server launched")
Exemplo n.º 44
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     self.nb_joueur = 0
     self.ids = {}
     self.clients = []
     self.joueurs = pygame.sprite.Group()
     self.tirs = pygame.sprite.Group()
     print('Server launched')
     self.clock = pygame.time.Clock()
     #definiriton de le la fenetre
     self.screen = pygame.display.set_mode((50, 50))
     self.carte = None
     self.temp_jeu = 0
Exemplo n.º 45
0
 def __init__(self, *args, **kwargs):
     #self.playerObjects = []
     #Puts all connections in this map
     self.players = WeakKeyDictionary()
     self.regions = {}
     
     #Makes the regions from scratch
     self.MH = MonsterHandler()
     self.generateWorld()
         
     Server.__init__(self, *args, **kwargs)
     print 'Server launched'
     printCastle()
Exemplo n.º 46
0
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        self.id = 0
        self.players = WeakKeyDictionary()
        print "Server Launched"

        self.usersdb = UsersDB()

        self.boards = {}
        self.gamesCount = 0
        # self.usersdb.firstRun()

        self.outstandingContactRequests = []
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        self.players = WeakKeyDictionary()
        self.numTeams = 0

        self.games = []
        self.queue = None
        self.finished = []
        self.curindex = -1

        self.tournamentQ = []

        print 'Server Launched'
Exemplo n.º 48
0
 def __init__(self, host, port):
     arcade.View.__init__(self)
     arcade.set_background_color(arcade.csscolor.INDIGO)
     self.playerList = None
     self.laserList = None
     self.asetroidList = None
     self.channelList = []
     self.phyEngine = []
     self.fireSound = arcade.load_sound(":resources:sounds/hurt5.wav")
     self.hitsound = arcade.load_sound(":resources:sounds/hit3.wav")
     self.asteroidCount = 6
     self.threshold = 3
     Server.__init__(self, localaddr=(host, port))
Exemplo n.º 49
0
 def __init__(self, model, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     
     self.model = model
     # if self.start is True the game is working 
     self.start = False
     self.story = False
     # time before strating the game in milliseconds
     self.wait_to_start = -1
     # addresss and port at which server is started
     address, port = kwargs['localaddr']
     
     print 'Server started at', address, 'at port', str(port)
     print 'Now you can start the clients'
Exemplo n.º 50
0
    def __init__(self, *args, **kwargs):

        self.id = 0
        Server.__init__(self, *args, **kwargs)
        self.p1 = None
        self.p2 = None
        self.planet_list = pygame.sprite.Group()
        self.ready = False
        temp = Planet(Vec(370, 220), 130)
        self.planet_list.add(temp)
        self.weapon_list = []
        self.player_list = pygame.sprite.Group()
        self.waiting_player_list = deque()
        print('server launched')
Exemplo n.º 51
0
 def __init__(self, localaddr, ruleset, startinground):
     """This overrides the library server init
     It's a place to do any 'on launch' actions for the server
     """
     Server.__init__(self, localaddr=localaddr)
     ServerState.__init__(self, ruleset)
     self.ruleset = ruleset
     self.starting_round = int(startinground)
     self.players = []
     self.in_round = False
     self.game_over = False
     if self.rules.Shared_Board:
         self.visible_cards_now = {}
     print('Server launched')
Exemplo n.º 52
0
	def __init__(self, *args, **kwargs):
		Server.__init__(self, *args, **kwargs)
		# list of all currently connected clients
		self.clients = []
		# list of all known client IDs
		self.clientData = self.LoadClientData()
		# the highest level ID we know about
		self.lastLevelID = 0
		# load all level histories from the json files
		self.levels = self.LoadLevels()
		self.SetSaved(self.levels.keys())
		# non-secret per-session IDs
		self.ids = 0
		# log the start of the server process
		self.Log('LAUNCH: Infinite8BitPlatformer server listening on ' + ":".join([str(i) for i in kwargs['localaddr']]))
Exemplo n.º 53
0
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        pygame.display.set_caption("Server")
        self.screen = pygame.display.set_mode(outils.SIZE_SERVEUR)

        self.briques = Briques()
        for i in range(10,outils.SCREEN_WIDTH,120):
            self.brique = Brique((i, outils.SCREEN_HEIGHT/2))
            self.briques.add(self.brique)
        self.clients = Bars()
        self.balle = Ball()
        self.endGame = 0
        self.spriteJ1 = pygame.sprite.RenderClear()
        self.spriteJ2 = pygame.sprite.RenderClear()
        # self.run = False
        pygame.init()
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        self.curversion = 1
        self.players = WeakKeyDictionary()
        self.numTeams = 0

        self.games = []
        self.queue = None
        self.finished = []
        self.curindex = -1

        self.tGames = [None, None]
        self.tournamentQ = []
        self.count = -1
        self.tournamentMode = False
        self.tournamentStat = dict()

        print 'Server Launched'
Exemplo n.º 55
0
 def __init__(self, evManager):
 
     host, port = config_get_hostport()
     Server.__init__(self, localaddr=(host, port))
             
     self._em = evManager
     self._em.reg_cb(TickEvent, self.on_tick)
     
     
     self.accept_connections = False # start accepting when model is ready
     
     self.chan_to_name = WeakKeyDictionary() #maps channel to name
     self.name_to_chan = WeakValueDictionary() #maps name to channel        
     #WeakKeyDictionary's key is garbage collected and removed from dictionary 
     # when used nowhere else but in the dict's mapping
     
     self.model = None # set by model later on
     
     self.log.debug('Server Network up')
Exemplo n.º 56
0
    def __init__(self, *args, **kwargs):
        Server.__init__(self, *args, **kwargs)
        self.players = WeakKeyDictionary()

        self.last_tick = 0

        self.game_paused = True

        # Use configuration helper to get game parameters
        game_parameters = self.configuration_helper()

        self.tick_duration = game_parameters['engine_parameters']['tick_duration']

        self.game = engine.MapWarfare(game_parameters)
        # Create a wxPython app
        self.wx_app = wx.App(
            #redirect=True,filename="server_crash_log.txt"
        )
        self.init_user_interface()
Exemplo n.º 57
0
 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     
     # Game state
     self.state = [-1 for x in range(9)]
     self.turn = 0
     
     self.users = {} # maps user names to Chat instances
     
     self.timeout = 0
     self.running = True
     
     self.players = []
     
     self._next_update = time.time()
     self._update_delay = screen_lib.set_fps(self, 30)
     
     self.address, self.port = kwargs['localaddr']
     print('Server started at {} at port {}'.format(self.address, str(self.port)))
Exemplo n.º 58
0
 def __init__(self, *args, **kwargs):
     pygame.init()
     Server.__init__(self, *args, **kwargs)
     self.players = WeakKeyDictionary()
     self.players_order = WeakKeyDictionary()
     self.current_index = 0
     self.ball = Ball(*CENTER)
     self.pointer = Pointer()
     self.score = 0
     self.difficulty = 3
     self.highscore = 0
     self.paused = False
     self.subrect = self.ball.image.get_rect()
     self.subrect.width = 84
     self.subrect.height = 83
     self.newimg = self.ball.image
     self.tries = TRIES
     self.game_over = False
     print('Server launched')