public GetBaseInfo ( ) : |
||
return |
//更改成员职位 public void ChangeMemberPlace(uint legion_id, String play_name, short place) { Legion legion = GetLegion(legion_id); for (int i = 0; i < legion.GetBaseInfo().list_member.Count; i++) { if (legion.GetBaseInfo().list_member[i].members_name == play_name) { legion.GetBaseInfo().list_member[i].rank = place; break; } } }
//退出军团 public void QuitLegion(PlayerObject play) { Legion legion = play.GetLegionSystem().GetLegion(); if (legion == null) { return; } uint legion_id = legion.GetBaseInfo().id; play.GetLegionSystem().SetLegion(null, true); int player_id = play.GetBaseAttr().player_id; for (int i = 0; i < legion.GetBaseInfo().list_member.Count; i++) { if (legion.GetBaseInfo().list_member[i].members_name == play.GetName()) { legion.GetBaseInfo().list_member[i].id = 0; break; } } this.UpdateLegionInfo(legion_id, player_id); }
public void UpdateLegionInfo(uint legion_id, int player_id) { if (!mDicLegion.ContainsKey(legion_id)) { return; } Legion info = mDicLegion[legion_id]; //发送给dbserver 更新军团数据 LegionOption option = new LegionOption(); option.SetUpdateTag(); option.player_id = player_id; option.mInfo = info.GetBaseInfo(); DBServer.Instance().GetDBClient().SendData(option.GetBuffer()); }
//军团添加成员 public void AddMember(uint legion_id, PlayerObject play) { //已经有军团了 if (play.GetLegionSystem().IsHaveLegion()) { return; } Legion legion = GetLegion(legion_id); if (legion == null) { return; } LegionMember member = new LegionMember(); member.members_name = play.GetName(); member.money = 0; member.rank = GameBase.Config.Define.LEGION_PLACE_PUTONGTUANYUAN; legion.GetBaseInfo().list_member.Add(member); play.GetLegionSystem().SetLegion(legion, true); UpdateLegionInfo(legion_id, play.GetBaseAttr().player_id); }
public LegionMember GetMember(String name) { for (int i = 0; i < legion.GetBaseInfo().list_member.Count; i++) { if (legion.GetBaseInfo().list_member[i].members_name == name) { return(legion.GetBaseInfo().list_member[i]); } } return(null); }