(int overload, int online, int onlineNew)
| 111 | } |
| 112 | |
| 113 | public void report(int overload, int online, int onlineNew) { |
| 114 | var load = new BLoad.Data(); |
| 115 | |
| 116 | load.setOverload(overload); |
| 117 | load.setOnline(online); |
| 118 | load.setProposeMaxOnline(getLoadConfig().getProposeMaxOnline()); |
| 119 | load.setOnlineNew(onlineNew); |
| 120 | load.setMaxOnlineNew(getLoadConfig().getMaxOnlineNew()); |
| 121 | var bb = ByteBuffer.Allocate(256); |
| 122 | load.encode(bb); |
| 123 | |
| 124 | // 下面两个报告原则上可以只报告一个。 |
| 125 | // 当启用LoginQueue,原来的load报告可以去掉了。 |
| 126 | // 为了兼容,先保留。 |
| 127 | |
| 128 | // 向ServiceManager报告load |
| 129 | var loadServer = new BServerLoad(); |
| 130 | loadServer.ip = getServiceIp(); |
| 131 | loadServer.port = getServicePort(); |
| 132 | loadServer.param = new Binary(bb); |
| 133 | |
| 134 | //noinspection DataFlowIssue |
| 135 | this.zeze.getServiceManager().setServerLoad(loadServer); |
| 136 | |
| 137 | // 向LoginQueueServer报告load。 |
| 138 | if (loginQueueAgent != null) |
| 139 | reportLoginQueueLoad(loginQueueAgent, load); |
| 140 | } |
| 141 | |
| 142 | // LinkdLoad 需要重载。 |
| 143 | protected void reportLoginQueueLoad(LoginQueueAgent loginQueueAgent, BLoad.Data load) { |
no test coverage detected