MCPcopy Create free account
hub / github.com/e2wugui/zeze / bindDynamic

Method bindDynamic

ZezeJava/ZezeJava/src/main/java/Zeze/Arch/Online.java:1838–1860  ·  view source on GitHub ↗
(@NotNull String account, @NotNull String clientId, int... moduleIds)

Source from the content-addressed store, hash-verified

1836 }
1837
1838 public boolean bindDynamic(@NotNull String account, @NotNull String clientId, int... moduleIds) {
1839 var bean = getOnline(account);
1840 if (null == bean)
1841 return false;
1842 var login = bean.getLogins().get(clientId);
1843 if (null == login)
1844 return false;
1845
1846 var link = login.getLink();
1847
1848 Transaction.whileCommit(() -> {
1849 var bind = new Zeze.Builtin.Provider.Bind();
1850 var connector = providerApp.providerService.getLinks().get(link.getLinkName());
1851 var socket = connector.getSocket();
1852 bind.Argument.getLinkSids().add(link.getLinkSid());
1853 for (var moduleId : moduleIds) {
1854 bind.Argument.getModules().put(moduleId, new BModule.Data(
1855 BModule.ChoiceTypeDefault, BModule.ConfigTypeDynamic));
1856 }
1857 bind.SendForWait(socket);
1858 });
1859 return true;
1860 }
1861}

Callers

nothing calls this directly

Calls 14

getOnlineMethod · 0.95
whileCommitMethod · 0.95
getLinksMethod · 0.80
getMethod · 0.65
getLinkMethod · 0.65
getLinkNameMethod · 0.65
addMethod · 0.65
getLinkSidMethod · 0.65
putMethod · 0.65
getLoginsMethod · 0.45
getSocketMethod · 0.45
getLinkSidsMethod · 0.45

Tested by

no test coverage detected