From ecd609ffc0145500bbe1829e1698a2593ac07289 Mon Sep 17 00:00:00 2001 From: yangduo Date: Wed, 26 Jun 2024 20:34:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=8E=A9=E5=AE=B6=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/admin/common.js | 48 +++++++++++++++++++++++ server/adminserver/api/v1/system/enter.go | 1 + server/adminserver/app/app.go | 9 +++++ server/adminserver/common/types.go | 23 ++++++++++- server/adminserver/router/routermgr.go | 2 + server/adminserver/router/system/enter.go | 1 + third_party/f5 | 2 +- third_party/q5 | 2 +- 8 files changed, 85 insertions(+), 3 deletions(-) diff --git a/doc/admin/common.js b/doc/admin/common.js index df3b77ad..bcec7a4d 100644 --- a/doc/admin/common.js +++ b/doc/admin/common.js @@ -92,3 +92,51 @@ exports.UserGroupMember = class { } }; + +exports.Player = class { + constructor() + { + this.fields = [ + ['account_id', '', '用户id'], + ['channel', '', '渠道id'], + ['name', '', '用户名'], + ['sex', 0, '性别'], + ['head_id', 0, '头像id'], + ['head_frame', 0, '头像框id'], + ['level', 0, '等级'], + ['exp', 0, '经验'], + ['rank', 0, '段位'], + ['history_best_rank', 0, '历史最高段位'], + ['score', 0, '积分'], + ['history_best_score', 0, '历史最高积分'], + ['elo', 0, '隐藏elo积分'], + ['bceg', 0, '治理代币'], + ['gold', 0, '金币'], + ['diamond', 0, '钻石'], + ['hero_id', 0, '当前上阵英雄id'], + ['first_fight', 0, '是否首战'], + ['last_season_id', 0, '最后一次赛季id'], + ['activated', 0, '是否已激活'], + ['rename_count', 0, '改名次数'], + ['activatetime', 0, '激活时间'], + ['already_guide', 0, '已引导'], + ['pve_instance_id', 0, '已过pve副本id'], + ['like_count', 0, '被点赞次数'], + ['head_list', '', '拥有的头像列表'], + ['head_frame_list', '', '拥有的头像框列表'], + ['consume_gold', 0, '消费金币数'], + ['score_modifytime', 0, '积分修改时间'], + ['best_rank_modifytime', 0, 'bestrank修改时间'], + ['createtime', 0, '创建时间'], + ['last_login_time', 0, '上次登录时间'], + ['is_gain_item', 0, '是否获取免费item道具'], + ['guild_id', '', '工会id'], + ['guild_job', 0, '工会职位'], + ['guild_name', '', '工会名称'], + ['ring_id', 0, '戒指id'], + ['parachute', 0, '降落伞id'], + ['star_num', 0, '星星数(成长任务)'], + ['address', '', '钱包地址'], + ] + } +} diff --git a/server/adminserver/api/v1/system/enter.go b/server/adminserver/api/v1/system/enter.go index 080cd1f2..965623e3 100644 --- a/server/adminserver/api/v1/system/enter.go +++ b/server/adminserver/api/v1/system/enter.go @@ -8,4 +8,5 @@ type ApiGroup struct { UserGroupApi GroupMemberApi BattleServerApi + PlayerApi } diff --git a/server/adminserver/app/app.go b/server/adminserver/app/app.go index 9a6b962e..1c1fe310 100644 --- a/server/adminserver/app/app.go +++ b/server/adminserver/app/app.go @@ -102,6 +102,15 @@ func (this *app) registerDataSources() { mt.Table.MailDb.GetById(0).GetDatabase(), 1, ) + f5.GetGoStyleDb().RegisterDataSource( + constant.GAME_DB, + mt.Table.GameDb.GetById(0).GetHost(), + mt.Table.GameDb.GetById(0).GetPort(), + mt.Table.GameDb.GetById(0).GetUser(), + mt.Table.GameDb.GetById(0).GetPasswd(), + mt.Table.GameDb.GetById(0).GetDatabase(), + 1, + ) } func (this *app) AddSession(accountId string) string { diff --git a/server/adminserver/common/types.go b/server/adminserver/common/types.go index 13c6e70e..c877b047 100644 --- a/server/adminserver/common/types.go +++ b/server/adminserver/common/types.go @@ -1,13 +1,34 @@ package common +import ( + "f5" + "q5" +) + type Attachment struct { - ItemId int32 `json:"itemid"` + ItemId int32 `json:"itemid"` ItemNum int32 `json:"itemnum"` } +type StreamPagination struct { + NextCursor string `json:"next_cursor"` + PreviousCursor string `json:"previous_cursor"` + Remaining int32 `json:"remaining"` +} + type App interface { Run(func(), func()) AddSession(accountId string) string GetSessionAccountId(accountId string) string RemoveSession(accountId string) } + +func (this *StreamPagination) FillPage(page *f5.StreamPagination) { + if page.NextCursor != 0 { + this.NextCursor = q5.ToString(page.NextCursor) + } + if page.PreviousCursor != 0 { + this.PreviousCursor = q5.ToString(page.PreviousCursor) + } + this.Remaining = page.Remaining +} diff --git a/server/adminserver/router/routermgr.go b/server/adminserver/router/routermgr.go index 5a89fafe..41f77d3d 100644 --- a/server/adminserver/router/routermgr.go +++ b/server/adminserver/router/routermgr.go @@ -3,6 +3,7 @@ package router import ( "f5" "main/middleware" + //. "main/global" "main/router/system" ) @@ -23,6 +24,7 @@ func (this *routerMgr) Init() { this.system.InitUserGroupRouter(priGroup) this.system.InitGroupMemberRouter(priGroup) this.system.InitBattleServerRouter(priGroup) + this.system.InitPlayerRouter(priGroup) f5.GetSysLog().Info("routerMgr.init") } diff --git a/server/adminserver/router/system/enter.go b/server/adminserver/router/system/enter.go index f72f0146..f873f2eb 100644 --- a/server/adminserver/router/system/enter.go +++ b/server/adminserver/router/system/enter.go @@ -8,4 +8,5 @@ type RouterGroup struct { UserGroupRoute GroupMemberRoute BattleServerRoute + PlayerRouter } diff --git a/third_party/f5 b/third_party/f5 index 693a5ab7..bf49efd5 160000 --- a/third_party/f5 +++ b/third_party/f5 @@ -1 +1 @@ -Subproject commit 693a5ab7b0d3e7cadd206ebfd29a9df5fca3ea48 +Subproject commit bf49efd5a029a9e0749019c03fb4295dd89bf350 diff --git a/third_party/q5 b/third_party/q5 index 8877d9e0..763b161e 160000 --- a/third_party/q5 +++ b/third_party/q5 @@ -1 +1 @@ -Subproject commit 8877d9e02aff92bdf726954501109ce474d51f25 +Subproject commit 763b161e26e76046ee7614852ccdd4a360f15237