public void UpdateSkillAtPlayerInfo(PlayerInfoSkill skill) { var ctx = adaptor.Update(dataId); ctx .WriteField("Skill", skill) ; updateQueue.Add(ctx); }
public void UpdateSkillAtPlayerInfo(PlayerInfoSkill skill) { const string dataId = "UPDATE `mem_player` SET `Skill`=?2 WHERE `Pid`=?1"; var ctx = adaptor.Update(dataId); ctx .WriteField("Pid", (UInt64)key) .WriteField("Skill", skill) ; updateQueue.Add(ctx); }
public async Task <PlayerInfoSkill> LoadSkillAtPlayerInfoAsync() { var val = new PlayerInfoSkill(); var reader = await adaptor.Query(dataId, "Skill"); if (reader == null) { return(null); } val = reader.ReadField <PlayerInfoSkill>("Skill"); return(val); }
public async Task <PlayerInfoSkill> LoadSkillAtPlayerInfoAsync() { const string sql = "SELECT `Skill` FROM `mem_player` WHERE `Pid` = ?1"; var val = new PlayerInfoSkill(); var reader = await adaptor.Query(sql, (UInt64)key); if (reader == null) { return(null); } val = reader.ReadField <PlayerInfoSkill>("Skill"); reader.Dispose(); return(val); }
public async Task <bool> AskLearnSkill(ulong pid, uint skillId) { if (!await CheckValid(pid)) { return(false); } using (var accesser = await Program.CacheService.GetPlayerInfoAccesser(pid)) { var infoSkill = await accesser.LoadSkillAtPlayerInfoAsync(); Console.WriteLine("LogicServiceImpl.AskLearnSkill load InfoSkill complete pid={0}", pid); if (infoSkill == null) { Console.WriteLine("LogicServiceImpl.AskLearnSkill InfoSkill is null pid={0}", pid); infoSkill = new PlayerInfoSkill() { SkillList = new List <uint>() }; } if (infoSkill.SkillList == null) { infoSkill.SkillList = new List <uint>(); } infoSkill.SkillList.Add(skillId); accesser.UpdateSkillAtPlayerInfo(infoSkill); await accesser.SubmitChanges(); Program.Logic2CliService.Forward(sessionId).ServerMessageOk(); return(true); } }