/// <summary> /// 向BS汇报GS的状态 /// </summary> private ErrorCode MsgHandleReportGsInfo(byte[] data, int offset, int size, int msgID) { if (!BS.instance.bsConfig.allGsInfo.TryGetValue(this.logicID, out OneGsInfo gsInfo)) { return(ErrorCode.GSNotFound); } GSToBS.ReportAllClientInf msg = new GSToBS.ReportAllClientInf(); msg.MergeFrom(data, offset, size); gsInfo.gs_gc_count = msg.TokenlistSize; return(ErrorCode.Success); }
/// <summary> /// 向负载均衡服务器报告网关服务器的状态 /// </summary> public ErrorCode ReportGsInfo(long time) { if (this._nextReportTime > time) { return(ErrorCode.Success); } this._nextReportTime = time + 2000; GSToBS.ReportAllClientInf sMsg = new GSToBS.ReportAllClientInf(); sMsg.TokenlistSize = ( uint )this._userTokenList.Count; GS.instance.SendMsgToSession(SessionType.ClientG2B, sMsg, ( int )GSToBS.MsgID.EMsgToBsfromGsReportAllClientInfo); return(ErrorCode.Success); }