| 12345678910111213141516171819202122232425262728293031 | package outboundimport (	"github.com/v2ray/v2ray-core/common/log"	v2net "github.com/v2ray/v2ray-core/common/net"	"github.com/v2ray/v2ray-core/proxy/vmess"	"github.com/v2ray/v2ray-core/proxy/vmess/command")func (this *VMessOutboundHandler) handleSwitchAccount(cmd *command.SwitchAccount) {	user := vmess.NewUser(vmess.NewID(cmd.ID), cmd.Level, cmd.AlterIds.Value())	dest := v2net.TCPDestination(cmd.Host, cmd.Port)	this.receiverManager.AddDetour(NewReceiver(dest, user), cmd.ValidMin)}func (this *VMessOutboundHandler) handleCommand(cmdId byte, data []byte) {	cmd, err := command.CreateResponseCommand(cmdId)	if err != nil {		log.Warning("VMessOut: Unknown response command (", cmdId, "): ", err)		return	}	if err := cmd.Unmarshal(data); err != nil {		log.Warning("VMessOut: Failed to parse response command: ", err)		return	}	switch typedCommand := cmd.(type) {	case *command.SwitchAccount:		this.handleSwitchAccount(typedCommand)	default:	}}
 |