public int StopSealRecordSort(StopSealRecord x, StopSealRecord y) { if (x.Time > y.Time) { return(-1); } return(1); }
//封号或者解封 public static void StopSealOrRelieve(long userId, bool isStopSeal, string explain) { Session userSession = Game.Scene.GetComponent <NetInnerSessionComponent>().Get(AppType.User); //直接封号 StopSealRecord stopSealRecord = new StopSealRecord(); stopSealRecord.StopSealUserId = userId; stopSealRecord.IsStopSeal = isStopSeal; stopSealRecord.Explain = explain; userSession.Call(new C2U_SetIsStopSeal() { StopSeal = stopSealRecord }); }
public static async Task StopSealOperate(this UserComponent userComponent, StopSealRecord stopSealRecord, IResponse iResponse) { List <AccountInfo> accountInfos = await userComponent.dbProxyComponent.Query <AccountInfo>(coount => coount.UserId == stopSealRecord.StopSealUserId); if (accountInfos.Count > 0) { accountInfos[0].IsStopSeal = stopSealRecord.IsStopSeal; await userComponent.dbProxyComponent.Save(accountInfos[0]); } else { iResponse.Message = "用户不存在"; } stopSealRecord.Time = TimeTool.GetCurrenTimeStamp(); await userComponent.dbProxyComponent.Save(stopSealRecord); }
//发送封号解封消息 public async void CallStopSealAndReliveMessage(bool isStopSweal, string remark) { StopSealRecord stopSealRecord = new StopSealRecord(); stopSealRecord.IsStopSeal = isStopSweal; stopSealRecord.Explain = remark; stopSealRecord.StopSealUserId = AdministratorComponent.Ins.ExamineUser.UserId; C2U_SetIsStopSeal c2USetIsStop = new C2U_SetIsStopSeal(); c2USetIsStop.StopSeal = stopSealRecord; U2C_SetIsStopSeal u2CSetIsStopSeal = (U2C_SetIsStopSeal)await SessionComponent.Instance.AdministratorCall(c2USetIsStop); if (!string.IsNullOrEmpty(u2CSetIsStopSeal.Message)) { UIComponent.GetUiView <NormalHintPanelComponent>().ShowHintPanel(u2CSetIsStopSeal.Message); } else { UIComponent.GetUiView <NormalHintPanelComponent>().ShowHintPanel("操作成功"); } }