/// <summary> /// 创建实例 /// </summary> public static FuncSetTitleRoleGroupRequest create(int funcID, long groupID, long playerID, int title) { FuncSetTitleRoleGroupRequest re = (FuncSetTitleRoleGroupRequest)BytesControl.createRequest(dataID); re.funcID = funcID; re.groupID = groupID; re.playerID = playerID; re.title = title; return(re); }
/** 设置职位 */ public void setTitle(long memberID, int title) { int canSetTitle = RoleGroupTitleConfig.get(_selfData.title).canSetTitle; if (canSetTitle <= 0 || canSetTitle > title) { me.warnLog("设置职位时,没有权限", _selfData.title, title); return; } PlayerRoleGroupMemberData member = getMember(memberID); if (member == null) { me.warnLog("设置职位时,找不到目标成员", memberID); return; } if (member.title == RoleGroupTitleType.Leader || title == RoleGroupTitleType.Leader) { me.warnLog("设置职位时,不能设置队长", memberID, title); return; } if (member.title < canSetTitle) { me.warnLog("设置职位时,没有权限2", _selfData.title, member.title); return; } if (member.title == title) { me.warnLog("设置职位时,当前已是该职位", _selfData.title, member.title); return; } int num = RoleGroupTitleConfig.get(title).num; //超过数目 if (num > 0 && _memberTitleCount.get(title) >= num) { me.warnLog("设置职位时,超过容纳数目", title); return; } me.send(FuncSetTitleRoleGroupRequest.create(_funcID, groupID, memberID, title)); }