'Return a MSDP- or GMCP-valid subnegotiation across the protocol.
Args:
cmdname (str): OOB-command name.
args, kwargs (any): Arguments to OOB command.'

def data_out(self, cmdname, *args, **kwargs):

    kwargs.pop('options', None)
    if self.MSDP:
        msdp_cmdname = cmdname
        encoded_oob = self.encode_msdp(msdp_cmdname, *args, **kwargs)
        self.protocol._write((((((IAC + SB) + MSDP) + encoded_oob) + IAC) + SE))
    if self.GMCP:
        if (cmdname in EVENNIA_TO_GMCP):
            gmcp_cmdname = EVENNIA_TO_GMCP[cmdname]
        else:
            gmcp_cmdname = 'Custom.Cmd'
        encoded_oob = self.encode_gmcp(gmcp_cmdname, *args, **kwargs)
        self.protocol._write((((((IAC + SB) + GMCP) + encoded_oob) + IAC) + SE))
