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

Method sendAccounts

ZezeJava/ZezeJava/src/main/java/Zeze/Arch/Online.java:1262–1281  ·  view source on GitHub ↗
(@NotNull Collection<String> accounts, long typeId, @NotNull Binary fullEncodedProtocol)

Source from the content-addressed store, hash-verified

1260 }
1261
1262 public int sendAccounts(@NotNull Collection<String> accounts, long typeId, @NotNull Binary fullEncodedProtocol) { // OnlineSend sender
1263 int accountCount = accounts.size();
1264 if (accountCount == 1) {
1265 var it = accounts.iterator();
1266 if (it.hasNext()) // 不确定accounts是否稳定,所以还是判断一下保险
1267 return sendAccountDirect(it.next(), typeId, fullEncodedProtocol, false);
1268 } else if (accountCount > 1) {
1269 return sendAccountsDirect(accounts instanceof Set ? accounts : new HashSet<>(accounts),
1270 typeId, fullEncodedProtocol, false);
1271// var p = providerApp.zeze.newProcedure(() -> {
1272// sendAccountsEmbed(accounts, typeId, fullEncodedProtocol, sender);
1273// return Procedure.Success;
1274// }, "Online.sendAccounts");
1275// if (accounts.size() > 1)
1276// Task.executeUnsafe(p);
1277// else
1278// providerApp.zeze.getTaskOneByOneByKey().executeCyclicBarrier(accounts, p, null, DispatchMode.Normal);
1279 }
1280 return 0;
1281 }
1282
1283 /**
1284 * 给账号所有的登录终端发送消息。

Callers 2

Calls 13

sendAccountDirectMethod · 0.95
sendAccountsDirectMethod · 0.95
canLogProtocolMethod · 0.95
logMethod · 0.95
setLengthMethod · 0.80
sizeMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getTypeIdMethod · 0.65
encodeMethod · 0.65
iteratorMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected