Exemplo n.º 1
0
 def GroupMasterRoutine(self):
     # add localhost to host list to receive commands on master player as well
     self.memberHosts.append('127.0.0.1')
     self.actionHandler.AddHost('127.0.0.1', True)
     # send member request broadcast
     msgData = messages.getMessage(GROUP_MEMBER_REQUEST, ["-s", str(self.groupName)])
     udpbroadcaster.sendBroadcast(msgData, True)
Exemplo n.º 2
0
 def GroupMasterRoutine(self):
     # add localhost to host list to receive commands on master player as well
     self.memberHosts.append('127.0.0.1')
     self.actionHandler.AddHost('127.0.0.1', True)
     # send member request broadcast
     msgData = messages.getMessage(GROUP_MEMBER_REQUEST,
                                   ["-s", str(self.groupName)])
     udpbroadcaster.sendBroadcast(msgData, True)
Exemplo n.º 3
0
    def __init__(self, config):
        self.groupName = config["group"]
        self.memberCount = 0
        self.groupMasterName = config["group_master_name"]
        self.groupMaster = config["group_master"] == 1
        self.actions = config["actions"]
        self.memberHosts = []

        self.masterHost = ""

        if self.groupMaster:
            print "INITIALIZING GroupActionHandler WITH ACTIONS: ", self.actions
            # init action handler thread
            self.actionHandler = GroupActionHandler(self.actions)
            self.actionHandler.daemon = True
            self.actionHandler.start()
            self.GroupMasterRoutine()
        else:
            # player is a group member --> broadcast acknowledge with request flag set to false in case master is already online
            byRequest = "0"
            msgData = messages.getMessage(GROUP_MEMBER_ACKNOWLEDGE, ["-s", str(self.groupName), "-i", byRequest])
            udpbroadcaster.sendBroadcast(msgData)
Exemplo n.º 4
0
    def __init__(self, config):
        self.groupName = config["group"]
        self.memberCount = 0
        self.groupMasterName = config["group_master_name"]
        self.groupMaster = config["group_master"] == 1
        self.actions = config["actions"]
        self.memberHosts = []

        self.masterHost = ""

        if self.groupMaster:
            print "INITIALIZING GroupActionHandler WITH ACTIONS: ", self.actions
            # init action handler thread
            self.actionHandler = GroupActionHandler(self.actions)
            self.actionHandler.daemon = True
            self.actionHandler.start()
            self.GroupMasterRoutine()
        else:
            # player is a group member --> broadcast acknowledge with request flag set to false in case master is already online
            byRequest = "0"
            msgData = messages.getMessage(
                GROUP_MEMBER_ACKNOWLEDGE,
                ["-s", str(self.groupName), "-i", byRequest])
            udpbroadcaster.sendBroadcast(msgData)