public int Call_GetGuide(GuideInfoRequest request) { var player = CurrentSession.GetBind <Player>(); GuideInfoResponse response = new GuideInfoResponse(); response.success = true; response.id = player.Id; response.guide = 1000;// player.Guide; CurrentSession.SendAsync(response); return(0); }
public int Call_SetGuide(GuideDoneRequest request) { var player = CurrentSession.GetBind <Player>(); player.Guide = request.gindex; _db.SaveChanges(); GuideDoneResponse response = new GuideDoneResponse(); response.success = true; response.gindex = player.Guide; CurrentSession.SendAsync(response); return(0); }
public int Call_GetPlayerRes(ResRequest request) { var player = CurrentSession.GetBind <Player>(); ResResponse response = new ResResponse(); response.success = true; response.pid = player.Id; response.level = player.Level; response.nickyName = player.NickName; response.icon = player.Icon; response.exp = player.Exp; response.renameCnt = player.RenameNumb; response.vip = player.VIP; //检查每日刷新 if (player.LastDayRefreshTime.Date != DateTime.Today) { //需要刷新 OnPlayerEverydayRefresh(player); player.LastDayRefreshTime = DateTime.Today; _db.SaveChanges(); } response.resInfos = new List <ResInfo>(); for (int ct = 1; ct <= CurrencyType.MAX_TYPE; ct++) { response.resInfos.Add(new ResInfo() { type = ct, count = player.Wallet.GetCurrency(ct) }); } //一些配置表的内容 response.nextExp = _dlevels[player.Level].exp; response.resistMaxWave = 1; response.preExp = player.Level == 1 ? 0: _dlevels[player.Level - 1].exp; CurrentSession.SendAsync(response); return(0); }