//创建军团 public void CreateLegion(LegionInfo info, int player_id) { int legion_id = Data.CreateLegion(info); CreateLegion_Ret ret = new CreateLegion_Ret(); if (legion_id != -1) { ret.ret = 1; } ret.play_id = player_id; ret.legion_id = legion_id; info.id = (uint)legion_id; mDicInfo[info.id] = info; LegionMember member = new LegionMember(); member.money = info.money; member.members_name = info.leader_name; member.rank = GameBase.Config.Define.LEGION_PLACE_JUNTUANZHANG; member.money = info.money; //初始化的贡献度 AddLegionMembers(info.id, member); ret.money = info.money; ret.boss_id = member.id; SessionManager.Instance().SendMapServer(0, ret.GetBuffer()); }
//创建军团返回 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); }