本文整理汇总了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()
示例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')
示例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')
示例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()
示例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)
示例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')
示例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'
示例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'
示例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'
示例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'
示例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'
示例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))
示例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)
示例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')
示例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")