package comm import ( "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" ) type ( //红点接口 IReddot interface { Reddot(session IUserSession, rid ...ReddotType) (reddot map[ReddotType]bool) } //任务完成 ITaskComplete interface { TaskComplete(session IUserSession, taskid int32) } //功能开启通知 IOpenCmdNotice interface { OpenCmdNotice(session IUserSession, key string) } ) /* 业务模块 对外接口定义处 */ type ( ISys interface { IsAccess(funcName string, uid string) (code pb.ErrorCode) ValidCond(uid string, conf *cfg.GameOpencondData) string } //邮件业务模块对外接口定义 提供给其他模块使用的 Imail interface { SendMailByCid(session IUserSession, cid string, res []*pb.UserAssets) bool SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服 IReddot } //道具背包接口 IItems interface { //查询用户背包物品数量 QueryItemAmount(uId string, itemid string) (amount uint32) //查询用户背包多个物品数量 QueryItemsAmount(uId string, itemid ...string) (result map[string]uint32) ///添加单个物品到背包 (可以加物品和减物品) AddItem(session IUserSession, itemid string, addnum int32, bPush bool) (code pb.ErrorCode) ///添加多个物品到背包 (可以加物品和减物品) AddItems(session IUserSession, items map[string]int32, bPush bool) (change []*pb.DB_UserItemData, code pb.ErrorCode) ///清理道具 CleanItems(session IUserSession) (code pb.ErrorCode) ///购买统一入场券 BuyUnifiedTicket(session IUserSession, buynum int32) (code pb.ErrorCode) ///刷新恢复入场券 RecoverTicket(session IUserSession) (code pb.ErrorCode) } //英雄 IHero interface { //查询用户卡片数量 QueryHeroAmount(uId string, heroCfgId string) (amount uint32) // 批量创建英雄 CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode) // 获取英雄 // heroId 英雄ID GetHeroByObjID(uid, heroId string) (*pb.DBHero, pb.ErrorCode) // 佩戴装备 UpdateEquipment(session IUserSession, hero *pb.DBHero, equip []*pb.DB_Equipment) (code pb.ErrorCode) //获取玩家英雄列表 GetHeroList(uid string) []*pb.DBHero //清理玩家英雄数据 CleanData(uid string) // 获取指定星级等级的英雄 GetSpecifiedHero(session IUserSession, heroConfId string, star, lv int32) (code pb.ErrorCode) // 英雄加经验 AddHeroExp(session IUserSession, heroObjID string, exp int32) (curAddExp int32, code pb.ErrorCode) // 英雄练功 KungFuHero(session IUserSession, heroObjID string, bKongfu bool, kongfuUid string) (code pb.ErrorCode) //Create Monster CreateMonster(heroCid string, star, lv int32) (hero *pb.DBHero) // 跨服查询英雄详细信息 QueryCrossHeroinfo(oid string) (hero *pb.DBHero, err error) GetHeroListByUse(uid string) []*pb.DBHero // 非初始状态的英雄列表 // 推送属性变化 PushHeroProperty(session IUserSession, heros []*pb.DBHero) (err error) // 充值了多少钱 RechargeMoney(uid string, money int32) // 多少天没登录 NoLoginDay(uid string, day int32) // 拥有N个X级英雄 CheckLvNum(uid string, lv int32) int32 // 激活X个英雄图鉴 GetTujianHeroNum(uid string) int32 //拥有觉醒至A级的B星英雄N个 Rtype123 CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 // 获取所有满星满级满觉醒的英雄 GetAllMaxHero(session IUserSession) (code pb.ErrorCode) // 教习登记 RegisterInstructor(session IUserSession, heroOid []string, registerId int32) (code pb.ErrorCode) // 跨服查询英雄详细信息 QueryCrossMultipleHeroinfo(oid []string) (hero []*pb.DBHero, err error) } //玩家 IUser interface { //获取本服用户数据 GetUser(uid string) *pb.DBUser //获取用户回话 GetUserSession(uid string) *pb.CacheUser //查询用户属性值 例如 金币 经验 QueryAttributeValue(uid string, attr string) (value int64) //添加/减少属性值 第四个参数控制是否推送给前端 AddAttributeValue(session IUserSession, attr string, add int32, bPush bool) (code pb.ErrorCode) // 批量处理 AddAttributeValues(session IUserSession, attrs map[string]int32, bPush bool) (code pb.ErrorCode) //用户改变事件 EventUserChanged(session IUserSession) EventUserVipChanged(session IUserSession) //获取用户expand GetUserExpand(uid string) (result *pb.DBUserExpand, err error) //更新用户expand ChangeUserExpand(uid string, value map[string]interface{}) error // 本服在线玩家列表 UserOnlineList() ([]*pb.CacheUser, error) //是否在线 IsOnline(uid string) bool // 跨服在线玩家列表 CrossUserOnlineList() ([]*pb.CacheUser, error) // 跨服用户会话 CrossUserSession(uid string) *pb.CacheUser // 跨服搜索玩家 CrossSearchUser(nickname string) ([]*pb.DBUser, error) // 搜索远程用户 SearchRmoteUser(nickname string) ([]*pb.DBUser, error) // 检查是不是新获得的英雄 CheckTujianHero(session IUserSession, heros []string) []bool // bingo设置玩家等级 BingoSetUserLv(session IUserSession, lv int32) error BingoSetUserVipLv(session IUserSession, lv int32) error } //武器模块 IEquipment interface { //查询服务资源数量 db id QueryEquipment(uid string, Id string) (equipment *pb.DB_Equipment, code pb.ErrorCode) //查询服务资源数量 参数武器配置id QueryEquipmentAmount(uid string, equipmentId string) (amount uint32) //添加新武器 AddNewEquipments(session IUserSession, cIds map[string]uint32, bPush bool) (change []*pb.DB_Equipment, code pb.ErrorCode) //添加所有装备 AddAllEquipments(session IUserSession) (code pb.ErrorCode) //创建装备 NewEquipment(uid, cid string) (code pb.ErrorCode, equip *pb.DB_Equipment) //添加装备 AddEquipment(session IUserSession, equip *pb.DB_Equipment) (code pb.ErrorCode) //出售装备 SellEquipments(session IUserSession, equs []string) (code pb.ErrorCode, atno []*pb.UserAtno) //回收装备接口 RecycleEquipments(session IUserSession, equs []string, discount int32) (code pb.ErrorCode, atno []*pb.UserAtno) //获得可操作用户装备列表 GetActionableEquipments(uid string) (code pb.ErrorCode, eruips []*pb.DB_Equipment) //获取可用套装 (铁匠铺使用) GetActionableSuit(uid string) (code pb.ErrorCode, Suit []int32) // 随机获得一件N级的装备装备 /* suiteId: 套装id pos: 位置(-1 表示随机位置 大于0 表示获得指定位置 ) lv: 装备等级 */ GetForgeEquip(session IUserSession, suiteId int32, pos int32, lv int32, dyweight []int32) (eruip *pb.DB_Equipment, code pb.ErrorCode) } IMline interface { ModifyMlineDataByNanduID(session IUserSession, id int32) (code pb.ErrorCode) /// 查询章节ID GetUserMlineData(uid string, chapterType int32) (chapterId int32) // 校验主线是否通关 CheckCommpleteStage(uid string, stageId int32) (b bool) ///红点 IReddot } //任务 ITask interface { //初始化 日常/周常/成就 InitTaskAll(uid string) // 初始化指定的任务 InitTaskByTag(uid string, taskTag TaskTag) //清空任务 ResetTask(uid string, taskTag TaskTag) // 清理玩家任务数据 CleanData(uid string) // 获取当前任务 GetTaskById(uid string, taskTag, taskId int32) *pb.TaskData // 获取已完成的日任务列表 GetTaskDayFinished(uid string) []*pb.TaskData ///红点 IReddot } // 随机任务 IRtask interface { // 条件校验 CheckCondi(uid string, condiId int32) (code pb.ErrorCode) // 远程任务条件校验 RemoteCheckCondi(uid string, condiId int32, rsp *pb.DBRtaskRecord) error // 删除任务条件数据 RemoveCondi(uid string, condiId int32) error // 更新任务条件数据 ChangeCondi(uid string, data map[int32]*pb.RtaskData) error //任务批量触发 TriggerTask(uid string, taskParams ...*TaskParam) // 获取任务条件记录 GetCondiData(uid string) *pb.DBRtaskRecord } //好友 IFriend interface { // 重置点赞列表和每日友情点 ResetFriend(uid string) // 获取好友数量 GetFriendCount(uid string) int32 // 获取好友列表 GetFriendList(uid string) []string // 使用好友助战英雄 好友ID:friendId UseAssistHero(uid, friendId string) (*pb.DBHero, error) // 切磋结束通知 QiecuoFinishNotify(redUid, matchId string) error } //聊天系统 IChat interface { //推送消息到世界频道 SendWorldChat(msg *pb.DBChat) (code pb.ErrorCode) //推送聊天消息到工会 SendUnionChat(msg *pb.DBChat) (code pb.ErrorCode) //推送消息到用户 SendUserChat(msg *pb.DBChat) (code pb.ErrorCode) //广播系统消息 SendSysChatToWorld(ctype ChatSystemType, appenddata interface{}, value0, value1 int32, agrs ...string) (code pb.ErrorCode) //广播系统消息 SendSysChatToUser(session IUserSession, ctype ChatSystemType, value0, value1 int32, agrs ...string) (code pb.ErrorCode) } //战斗系统 IBattle interface { //创建eve战斗 CreateEveBattle(session IUserSession, req *pb.BattleEVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///创建pve战斗 CreatePveBattle(session IUserSession, req *pb.BattlePVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///创建pvb战斗 CreatePvbBattle(session IUserSession, req *pb.BattlePVBReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///创建pvp战斗 CreatePvpBattle(session IUserSession, req *pb.BattlePVPReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///同步pvp战斗 CreateRtPvpBattle(req *pb.BattleRTPVPReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///连续pve战斗 CreateLPVEBattle(session IUserSession, req *pb.BattleLPVEReq) (code pb.ErrorCode, record *pb.DBBattleRecord) ///获取战斗详情 GetBattleInfo(req *pb.BattleGetInfoReq) (code pb.ErrorCode, resp *pb.BattleGetInfoResp) ///创建战斗角色 CreateRolesByFormat(fid int32) (captain int32, roles []*pb.BattleRole, code pb.ErrorCode) ///创建战斗角色 CreateRolesByHeros(heros []*pb.DBHero) (roles []*pb.BattleRole, code pb.ErrorCode) ///创建战斗服务 CreateBattleServer(req *pb.BattleInfo) (code pb.ErrorCode) ///战斗指令输入 InCmdBattle(req *pb.BattleInCmdReq) (code pb.ErrorCode) ///战斗认输请求 ConcedeBattle(req *pb.BattleConcedeReq) (code pb.ErrorCode) //校验战报 CheckBattleReport(session IUserSession, report *pb.BattleReport) (code pb.ErrorCode, iswin bool) } IGm interface { CreateCmd(session IUserSession, cmd string) (code pb.ErrorCode) } // 修改爬塔 IPagoda interface { ModifyPagodaFloor(session IUserSession, level int32) (code pb.ErrorCode) ModifySeasonPagodaFloor(session IUserSession, level int32) (code pb.ErrorCode) CheckUserBasePagodaInfo(uid string) (data *pb.DBPagodaRecord) // 查询玩家最佳通关记录 // Check Rtype84 Rtype85 Rtype86 CheckPagodaMaxFloor(uid string, pagodaType int32) int32 // 查询塔通关难度type 1 表示普通塔 2 赛季塔 ///红点 IReddot } IHeroFetter interface { ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (code pb.ErrorCode) // 修改羁绊信息 QueryHeroFetter(uid string) (data []*pb.DBHeroFetter) // 查询所有的羁绊信息 AddHeroFetterData(uid string, heroConfId string) (code pb.ErrorCode) // 创建一条羁绊信息 SendRpcAddHero(uid string, heroConfId string, serverTag string) (err error) // 获取 某个阵营的羁绊数据 QueryFavorabilityByRace(uid string, race int32) int32 } //月子秘境 IMoonFantasy interface { //触发月之秘境 Trigger(session IUserSession, source *pb.BattleReport) //GM触发月之秘境 TriggerMF(session IUserSession, Boosid string) (err error) } IViking interface { CompleteAllLevel(session IUserSession) (code pb.ErrorCode) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) // 查询玩家最佳通关记录 IReddot // 自动购买门票 AutoBuyTicket(session IUserSession, bossId, difficulty int32) (code pb.ErrorCode) // 自动战斗 战斗信息 AutoBattleInfo(session IUserSession, battle *pb.BattleFormation, bossId, difficulty int32) (code pb.ErrorCode, battleInfo *pb.BattleInfo) AutoBattleOver(session IUserSession, Report *pb.BattleReport, autoBattle *pb.DBAutoBattle) (code pb.ErrorCode, atno []*pb.UserAtno) CheckBattelParameter(session IUserSession, battle *pb.BattleFormation, bossid, difficulty int32) (code pb.ErrorCode) } IHunting interface { CompleteAllLevel(session IUserSession) (code pb.ErrorCode) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录 IReddot } // 公会 ISociaty interface { GetSociaty(uid string) *pb.DBSociaty // 会长弹劾处理 ProcessAccuse(uid, sociatyId string) // 获取我的公会成员 MembersByUid(uid string) (list []*pb.SociatyMemberInfo) // 获取公会成员 MembersBySociatyId(sociatyId string) (list []*pb.SociatyMemberInfo) // 设置工会经验 BingoSetExp(session IUserSession, exp int32) error // 设置工会活跃度 BingoSetActivity(session IUserSession, activity int32) error // 任务条件达成通知 TaskcondNotify(uid, sociatyId string, condId int32) error // 红点 IReddot } //星座图 IHoroscope interface { //计算新作图属性 ComputeHeroNumeric(uid string, hero ...*pb.DBHero) ///红点 IReddot } IPrivilege interface { // 创建一个新的特权卡 Delivery(session IUserSession, pId string) (code pb.ErrorCode, items []*pb.UserAssets) // 续费特权卡 RenewPrivilegeCard(session IUserSession, cId string) (code pb.ErrorCode) // 检查特权 参数 计费点 返回值 是否有特权 CheckPrivilege(session IUserSession, cId string) bool // 检查每日特权邮件 CheckDailyPrivilegeMail(session IUserSession) // 获得vip AddVipData(session IUserSession, oldVip, newVip int32) // 查询所有特权 key 对应comm.PrivilegeType1类型 CheckAllPrivilege(session IUserSession) map[int32]*pb.PrivilegeList // 通过特权类型获取特权对应的增加数量 GetCountByPrivilegeId(uid string, pType int32) (count int32) } //武馆 IMartialhall interface { ///红点 IReddot } // 世界任务 IWorldtask interface { // 任务条件达成通知 // Deprecated // TaskcondNotify(session IUserSession, condId int32) error TaskCondFinishNotify(session IUserSession, condId int32) error // bingo所有任务 BingoAllTask(session IUserSession) error // bingo任务 BingoJumpTask(session IUserSession, groupId, rtaskId int32) error // 查询我的世界任务 GetMyWorldtask(uid string) *pb.DBWorldtask } // 支线剧情任务 ILinestory interface { // 任务完成通知 TaskFinishNotify(uid string, taskId, groupId int32) error } //竞技场 IArena interface { ///红点 IReddot //设置用户积分 SetUserIntegral(session IUserSession, Integral int32) (err error) //获取匹配战斗角色列表 GetMatcheBattleRoles(uid string) (captain int32, rules []*pb.BattleRole, err error) } IGourmet interface { ///红点 IReddot } ILibrary interface { //与N个英雄好感度等级达到A CheckRtype132(uid string, num int32, lv int32) bool //与指定英雄好感度等级达到N CheckRtype133(uid string, heroId string, lv int32) bool // 任务完成通知 TaskFinishNotify(uid string, taskId, fetterId int32) error } // 个人成长任务 IGrowtask interface { BingoAllGrowTask(session IUserSession) error } //支付模块 IPay interface { //模拟发货 ModulePayDelivery(session IUserSession, Productid string, Price int32) (code pb.ErrorCode) } //支付发货 IPayDelivery interface { Delivery(session IUserSession, pid string) (code pb.ErrorCode, items []*pb.UserAssets) } //实时Pvp IPvp interface { //查询战斗数 QueryBattle(id string) (battle *pb.DBPvpBattle, err error) //创建实时Pvp CreatePvp(red, blue *pb.PvpUserInfo, ptype pb.PvpType) (battleId string, code pb.ErrorCode) //推送战斗输出指令 PvpOutCmdPush(out *pb.PvpOutCmdPush) //推送战斗结束 PvpFinishPush(out *pb.BattleFinishPush) } ISmithy interface { CheckActivateAtlasCollect(uid string, id string) } IPandaAtlas interface { CheckActivatePandaAtlasCollect(uid string, id string) } //练功房 IPractice interface { ITaskComplete IOpenCmdNotice //添加武馆资源 AddItems(session IUserSession, items map[string]int32, bPush bool) (code pb.ErrorCode) //pvp切磋结果通知 ChallengeResults(bid, red, bule string, winSide int32) } ITools interface { GetGroupDataByLottery(lotteryId int32, vipLv int32, lv int32) (items []*cfg.Gameatn) GetGlobalConf() *cfg.GameGlobalData GetPriceGroupCost(pricegroupId int32, purchase int32) (res []*cfg.Gameatn) } IReputation interface { // 声望升级 返回声望等级 Upgrade(session IUserSession, raceType int32, fv int32) (lv int32) } )