当前位置: 首页>>代码示例>>Python>>正文


Python Server.Server类代码示例

本文整理汇总了Python中PodSixNet.Server.Server的典型用法代码示例。如果您正苦于以下问题:Python Server类的具体用法?Python Server怎么用?Python Server使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    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()
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:31,代码来源:server.py

示例2: __init__

 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')
开发者ID:tborisova,项目名称:hackfmi4,代码行数:7,代码来源:game_of_luck_server.py

示例3: __init__

	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')
开发者ID:xpchess,项目名称:xpchess,代码行数:7,代码来源:NetServer.py

示例4: __init__

	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()
开发者ID:buckets1337,项目名称:GenericChat,代码行数:25,代码来源:GenericServer.py

示例5: __init__

 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)
开发者ID:Magnie,项目名称:simplydogfighting,代码行数:26,代码来源:server.py

示例6: __init__

 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')
开发者ID:GuillaumeDEDET,项目名称:tower_defense,代码行数:7,代码来源:server.py

示例7: __init__

 def __init__(self, *args, **kwargs):
     Server.__init__(self, *args, **kwargs)
     pygame.init()
     self.players = WeakKeyDictionary()
     self.renderables = []
     self.timer = time.Clock()
     print 'Server launched'
开发者ID:Paradxil,项目名称:Tron_Multiplayer,代码行数:7,代码来源:Game.py

示例8: __init__

 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'
开发者ID:Raizan,项目名称:battleship,代码行数:8,代码来源:Server.py

示例9: __init__

 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'
开发者ID:jamesmack,项目名称:tiny-space-battles,代码行数:8,代码来源:server.py

示例10: __init__

	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'
开发者ID:mcgillij,项目名称:REZD,代码行数:9,代码来源:GameServer.py

示例11: __init__

    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'
开发者ID:simonbroggi,项目名称:schneehasen,代码行数:9,代码来源:WhiteRabbitMaster.py

示例12: __init__

 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))
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:9,代码来源:log_engine.py

示例13: __init__

    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)
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:9,代码来源:friendly_server.py

示例14: __init__

 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')
开发者ID:tborisova,项目名称:dont-get-annoyed-buddy,代码行数:9,代码来源:server.py

示例15: __init__

    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")
开发者ID:simonbroggi,项目名称:SchneeEulen,代码行数:9,代码来源:snowly-master.py


注:本文中的PodSixNet.Server.Server类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。