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

Method sendError

ZezeJava/ZezeJava/src/main/java/Zeze/Arch/Online.java:516–543  ·  view source on GitHub ↗
(@NotNull String account, @NotNull String clientId,
						  @NotNull String linkName, long linkSid)

Source from the content-addressed store, hash-verified

514 }
515
516 public long sendError(@NotNull String account, @NotNull String clientId,
517 @NotNull String linkName, long linkSid) throws Exception {
518 // todo 这个版本的处理没有经过考验,需要参考Game.Online。
519
520 var online = getOrAddOnline(account);
521 var loginOnline = online.getLogins().getOrAdd(clientId);
522 // skip not owner: 仅仅检查LinkSid是不充分的。后面继续检查LoginVersion。
523 var link = loginOnline.getLink();
524 if (!link.getLinkName().equals(linkName) || link.getLinkSid() != linkSid)
525 return 0;
526
527 var local = _tlocal.get(account);
528 if (local != null) {
529 var loginLocal = local.getLogins().get(clientId);
530 if (loginLocal != null) {
531 loginOnline.setLink(new BLink(link.getLinkName(), link.getLinkSid(), eLinkBroken));
532 if (loginOnline.getLoginVersion() != loginLocal.getLoginVersion()) {
533 var ret = removeLocalAndTrigger(account, clientId); // 本机数据已经过时,马上删除。
534 if (ret != 0)
535 logger.info("sendError removeLocalAndTrigger ret{}", ret);
536 }
537 }
538 }
539
540 // shorter use
541 DelayLogout.logout(new BDelayLogoutCustom(account, clientId, loginOnline.getLoginVersion()));
542 return 0;
543 }
544
545 public long linkBroken(@NotNull String account, @NotNull String clientId,
546 @NotNull String linkName, long linkSid) throws Exception {

Callers 3

triggerLinkBrokenMethod · 0.95
processErrorSidsMethod · 0.95
sendDirectMethod · 0.95

Calls 12

getOrAddOnlineMethod · 0.95
removeLocalAndTriggerMethod · 0.95
logoutMethod · 0.95
getLinkMethod · 0.65
equalsMethod · 0.65
getLinkNameMethod · 0.65
getLinkSidMethod · 0.65
getMethod · 0.65
getLoginVersionMethod · 0.65
getOrAddMethod · 0.45
getLoginsMethod · 0.45
setLinkMethod · 0.45

Tested by

no test coverage detected