(@NotNull String account, @NotNull String clientId, @NotNull String linkName, long linkSid)
| 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 { |
no test coverage detected