'Perform a step. This is called repeatedly by the runner and
causes the client to issue commands to the server.  This holds
all "intelligence" of the dummy client.'

def step(self):

    global NLOGGED_IN
    rand = random.random()
    if (not self._cmdlist):
        if (not self._loggedin):
            if (rand < CHANCE_OF_LOGIN):
                self._cmdlist = list(makeiter(self._login(self)))
                NLOGGED_IN += 1
                print(('connecting    client    %s    (%i/%i)...' % (self.key, NLOGGED_IN, NCLIENTS)))
                self._loggedin = True
            else:
                return
        else:
            crand = random.random()
            cfunc = [func for (cprob, func) in self._actions if (cprob >= crand)][0]
            self._cmdlist = list(makeiter(cfunc(self)))
    if (rand < CHANCE_OF_ACTION):
        self.sendLine(str(self._cmdlist.pop(0)))
        self.istep += 1
