internal void SetItemInfo(NGuildApplyInfo item) { this.Info = item; Name.text = this.Info.Name; @class.text = this.Info.Class.ToString(); level.text = this.Info.Level.ToString(); }
/// <summary> /// 发送加入公会审批 /// </summary> /// <param name="accept"></param> /// <param name="apply"></param> public void SendGuildJoinApply(bool accept, NGuildApplyInfo apply) { Debug.Log("SendGuildJoinApply"); NetMessage message = new NetMessage(); message.Request = new NetMessageRequest(); message.Request.guildJoinRes = new GuildJoinResponse(); message.Request.guildJoinRes.Result = Result.Success; message.Request.guildJoinRes.Apply = apply; message.Request.guildJoinRes.Apply.Result = accept ? ApplyResult.Accept : ApplyResult.Reject; NetClient.Instance.SendMessage(message); }
public void SetItemInfo(NGuildApplyInfo item) { this.Info = item; if (this.nickname != null) { this.nickname.text = this.Info.Name; } if (this.@class != null) { [email protected] = this.Info.Class.ToString(); } if (this.level != null) { this.level.text = this.Info.Level.ToString(); } }
internal bool JoinAppove(NGuildApplyInfo apply) { var oldApply = this.Data.Applies.FirstOrDefault(v => v.CharacterId == apply.characterId && v.Result == 0); if (oldApply == null) { return(false); } oldApply.Result = (int)apply.Result; if (apply.Result == ApplyResult.Accept) { this.AddMember(apply.characterId, apply.Name, apply.Class, apply.Level, GuildTitle.None); } DBService.Instance.Save(); this.timestamp = TimeUtil.timestamp; return(true); }
/// <summary> /// 加入公会申请 /// </summary> /// <param name="apply"></param> /// <returns></returns> internal bool JoinApply(NGuildApplyInfo apply) { var oldApply = this.Data.Applies.FirstOrDefault(v => v.CharacterId == apply.characterId); if (oldApply != null) { return(false); } var dbApply = DBService.Instance.Entities.GuildApplies.Create(); dbApply.GuildId = apply.GuildId; dbApply.CharacterId = apply.characterId; dbApply.Name = apply.Name; dbApply.Class = apply.Class; dbApply.Level = apply.Level; dbApply.ApplyTime = DateTime.Now; DBService.Instance.Entities.GuildApplies.Add(dbApply); this.Data.Applies.Add(dbApply); DBService.Instance.Save(); this.timestamp = TimeUtil.timestamp; return(true); }