using System; using System.Collections.Generic; using System.Net.Sockets; namespace ET { [ActorMessageHandler] public class C2M_GetSkillHandler : AMActorLocationRpcHandler { protected override async ETTask Run(Unit unit, C2M_GetSkill request, M2C_GetSkill response, Action reply) { UnitSkillComponent unitSkillComponent = unit.GetComponent(); if (unitSkillComponent==null) { Log.Error("unitSkillComponent == null"); reply(); return; } foreach (UnitSkill item in unitSkillComponent.GetLearnedSkills()) { SkillInfo skillInfo = new SkillInfo() { SkillId = (int)item.Id, SkillLevel = item.Level }; response.SkillInfoLsit.Add(skillInfo); } foreach (UnitSkill item in unitSkillComponent.GetUnlearnedSkills()) { SkillInfo skillInfo = new SkillInfo() { SkillId = (int)item.Id, SkillLevel = item.Level }; response.SkillInfoLsit.Add(skillInfo); } UserSetting setting = unit.GetComponent(); if (setting == null) { Log.Error("setting == null"); reply(); return; } LinkedList arr = setting.GetAutoSkills(); foreach (int item in arr) { response.AutoSkillList.Add(item); } reply(); await ETTask.CompletedTask; } } }