```
refactor(common/rpc): 修改服务引用从blazing到config模块 将RPC服务中的blservice引用替换为config服务, 统一使用config.NewServerService()进行服务器信息获取。 feat(blazing): 实现新的会话生成机制 - 添加Gensession方法,基于accountID、UUID生成唯一会话标识 - 会话ID由accountID(4字节) + UUID(16字节)组成,编码为十六进制字符串 - 更新登录控制器使用新的会话生成方式 fix(pet_info): 添加宠物信息空值检查 在切换宠物背包仓库时,当宠物信息查询结果为空时, 返回系统错误避免空指针异常。
This commit is contained in:
@@ -78,13 +78,32 @@ func (s *ServerService) GetServer() []model.ServerList {
|
||||
return item
|
||||
|
||||
}
|
||||
func (s *ServerService) GetServerByID(id uint32) model.ServerList {
|
||||
var item model.ServerList
|
||||
dbm(s.Model).Where("online_id", id).Scan(&item)
|
||||
|
||||
return item
|
||||
func (s *ServerService) SetServerID(OnlineID uint16, Port uint16) error {
|
||||
|
||||
m := cool.DBM(s.Model).Where("online_id", OnlineID)
|
||||
|
||||
var tttt model.ServerList
|
||||
m.Scan(&tttt)
|
||||
tttt.Port = Port
|
||||
tttt.OnlineID = OnlineID
|
||||
|
||||
m.Save(tttt)
|
||||
// s.CleanCache()
|
||||
return nil
|
||||
|
||||
}
|
||||
func (s *ServerService) GetServerID(OnlineID uint16) model.ServerList {
|
||||
var tttt model.ServerList
|
||||
cool.DBM(s.Model).Where("online_id", OnlineID).Scan(&tttt)
|
||||
|
||||
return tttt
|
||||
|
||||
}
|
||||
|
||||
// func (s *ServerService) CleanCache() {
|
||||
// g.DB().GetCore().ClearCache(context.TODO(), s.Model.TableName())
|
||||
// }
|
||||
func (s *ServerService) SetServerScreen(id uint16, name string) {
|
||||
|
||||
dbm(s.Model).Where("online_id", id).Data("old_screen", name).Update()
|
||||
|
||||
Reference in New Issue
Block a user