public void DB_Load(LEGIONINFO info) { mDicLegion.Clear(); for (int i = 0; i < info.list_item.Count; i++) { Legion obj = new Legion(); obj.SetBaseInfo(info.list_item[i]); mDicLegion[info.list_item[i].id] = obj; } Log.Instance().WriteLog("从DBserver加载军团数据库成功!"); }
//创建军团返回 public void CreateLegion_Ret(CreateLegion_Ret info) { LegionInfo le = null; for (int i = 0; i < mListTemp.Count; i++) { if (mListTemp[i].leader_id == info.play_id) { le = mListTemp[i]; le.id = (uint)info.legion_id; mListTemp.Remove(le); break; } } if (info == null || info.ret == 0 || le == null) { return; } PlayerObject play = UserEngine.Instance().FindPlayerObjectToPlayerId(info.play_id); if (play == null) { return; } //加入军团长 LegionMember member = new LegionMember(); member.boChange = true; member.members_name = play.GetName(); member.money = info.money; member.id = info.boss_id; member.rank = GameBase.Config.Define.LEGION_PLACE_JUNTUANZHANG; le.list_member.Add(member); Legion l = new Legion(); l.SetBaseInfo(le); mDicLegion[le.id] = l; play.GetLegionSystem().SetLegion(l, true); }
//创建军团返回 public void CreateLegion_Ret(CreateLegion_Ret info) { LegionInfo le = null; for(int i = 0;i < mListTemp.Count;i++) { if (mListTemp[i].leader_id == info.play_id) { le = mListTemp[i]; le.id = (uint)info.legion_id; mListTemp.Remove(le); break; } } if(info == null || info.ret ==0 || le == null)return; PlayerObject play = UserEngine.Instance().FindPlayerObjectToPlayerId(info.play_id); if (play == null) return; //加入军团长 LegionMember member = new LegionMember(); member.boChange = true; member.members_name = play.GetName(); member.money = info.money; member.id = info.boss_id; member.rank = GameBase.Config.Define.LEGION_PLACE_JUNTUANZHANG; le.list_member.Add(member); Legion l = new Legion(); l.SetBaseInfo(le); mDicLegion[le.id] = l; play.GetLegionSystem().SetLegion(l,true); }