Documentation
¶
Index ¶
- Constants
- Variables
- func AddArenaBattleRank(rank int64) bool
- func AddEnterTicket(accountServerId, yostarUID int64, ticker string) bool
- func AddSession(x *Session) bool
- func AddYostarMail(mail *dbstruct.YostarMail) bool
- func CheckArenaBattle(ticker *time.Ticker, attackRank, defenceRank int64)
- func CheckArenaBattleRank(rank int64) bool
- func Close()
- func DelAllYostarMail() error
- func DelArenaBattleRank(rank int64) bool
- func DelEnterTicket(ticker string) bool
- func DelSession(accountServerId int64) bool
- func DelYostarClan(serverId int64) bool
- func DelYostarMail(mailId int64) error
- func GetAllEnterTicketInfo() map[string]*TicketInfo
- func GetAllSession() map[int64]*Session
- func GetAllYostarClan() map[int64]*YostarClan
- func GetYostarMail() map[int64]*dbstruct.YostarMail
- func InitEnterSet()
- func TaskUpDiskPlayerData() bool
- func UpAllPlayerBin()
- type AccountFriend
- type ArenaInfo
- type ArenaUser
- type ClanAccount
- type EnterSet
- type Mission
- type Session
- func (x *Session) AddMissionByCompleteConditionType(info *sro.CategoryMissionInfo)
- func (x *Session) AddPlayerHash(k int64, v any) bool
- func (x *Session) DelPlayerHash(k int64) bool
- func (x *Session) FinishMission(t proto.MissionCompleteConditionType, num int64, parameter []int64)
- func (x *Session) GenArenaUserList(seasonId int64)
- func (x *Session) GetArenaInfo() *ArenaInfo
- func (x *Session) GetArenaUserByIndex(index int32) *ArenaUser
- func (x *Session) GetArenaUserList() []*ArenaUser
- func (x *Session) GetBattleArenaUser() *ArenaUser
- func (x *Session) GetCharacterByKeyId(k int64) *sro.CharacterInfo
- func (x *Session) GetEquipmentByKeyId(k int64) *sro.EquipmentInfo
- func (x *Session) GetFriendInfo() *AccountFriend
- func (x *Session) GetItemByKeyId(k int64) *sro.ItemInfo
- func (x *Session) GetMission() *Mission
- func (x *Session) GetMissionByCompleteConditionType() map[string]map[int64]*sro.MissionInfo
- func (x *Session) GetMissionSync() map[int64]*sro.MissionInfo
- func (x *Session) GetPbBinData() []byte
- func (x *Session) GetYostarGame() *dbstruct.YostarGame
- func (x *Session) MissionReward(info *sro.MissionInfo)
- func (x *Session) NewMissionSync()
- func (x *Session) SetBattleArenaUser(au *ArenaUser)
- type TicketInfo
- type Toast
- type YostarClan
- func (x *YostarClan) AddAccount(uid int64, socialGrade int32) bool
- func (x *YostarClan) AddApplicantAccount(uid int64) bool
- func (x *YostarClan) GetAllAccount() map[int64]*ClanAccount
- func (x *YostarClan) GetAllApplicantAccount() map[int64]*ClanAccount
- func (x *YostarClan) GetClanAccount(uid int64) *ClanAccount
- func (x *YostarClan) GetMemberCount() int64
- func (x *YostarClan) GetYostarClan() *dbstruct.YostarClan
- func (x *YostarClan) RemoveAccount(uid int64) bool
- func (x *YostarClan) RemoveApplicantAccount(uid int64)
- func (x *YostarClan) SetJoinOption(joinOption int32) bool
- func (x *YostarClan) SetNotice(notice string) bool
- func (x *YostarClan) SetPresident(uid int64) bool
- func (x *YostarClan) UpDate() error
Constants ¶
View Source
const (
ClanMaxMemberCount = 50 // 社团最大成员数量
)
Variables ¶
View Source
var MaxCachePlayerTime = 10 // 最大玩家缓存时间 单位:分钟
View Source
var MaxCacheYostarClanTime = 30 // 最大玩家缓存时间 单位:分
View Source
var MaxPlayerNum int64 = 0 // 最大在线玩家
Functions ¶
func AddArenaBattleRank ¶
AddArenaBattleRank 将排名添加到战斗进行中的列表
func AddEnterTicket ¶
AddEnterTicket 添加EnterTicket
func AddYostarMail ¶
func AddYostarMail(mail *dbstruct.YostarMail) bool
func CheckArenaBattle ¶
CheckArenaBattle 检查战斗是否结束/释放锁!!!!!!!!
func CheckArenaBattleRank ¶
CheckArenaBattleRank 判断角色是否正在战斗中
func DelAllYostarMail ¶
func DelAllYostarMail() error
func DelEnterTicket ¶
DelEnterTicket 删除Ticket,如果此Ticket存在返回true,不存在返回false
func DelYostarClan ¶
func DelYostarMail ¶
func GetAllEnterTicketInfo ¶
func GetAllEnterTicketInfo() map[string]*TicketInfo
GetAllEnterTicketInfo 获取全部登录信息
func GetYostarMail ¶
func GetYostarMail() map[int64]*dbstruct.YostarMail
func InitEnterSet ¶
func InitEnterSet()
func TaskUpDiskPlayerData ¶
func TaskUpDiskPlayerData() bool
TaskUpDiskPlayerData 将磁盘中的二进制玩家数据写入数据库中
Types ¶
type AccountFriend ¶
type AccountFriend struct {
Uid int64 `json:"uid"`
AutoAcceptFriendRequest bool `json:"auto_accept_friend_request"` // 是否自动同意好友申请
FriendList map[int64]bool `json:"friend_list"` // 好友列表
ReceivedList map[int64]bool `json:"received_list"` // 被申请好友列表
SendReceivedList map[int64]bool `json:"send_received_list"` // 发送的好友申请列表
BlockedList map[int64]bool `json:"blocked_list"` // 黑名单列表
}
func (*AccountFriend) GetFriendList ¶
func (x *AccountFriend) GetFriendList() map[int64]bool
func (*AccountFriend) GetYostarFriend ¶
func (x *AccountFriend) GetYostarFriend() *dbstruct.YostarFriend
GetYostarFriend 预处理db数据
type ClanAccount ¶
type ClanAccount struct {
Uid int64 `json:"uid"`
SocialGrade int32 `json:"socialGrade"` // 职位
JoinTime int64 `json:"joinTime"` // 加入时间
LastLoginTime int64 `json:"lastLoginTime"` // 上次访问时间
AttendanceCount int64 `json:"attendanceCount"` // 出席天数
ApplicantTime int64 `json:"applicantTime"` // 申请时间
}
func (*ClanAccount) GetAttendanceCount ¶
func (x *ClanAccount) GetAttendanceCount() int64
func (*ClanAccount) GetJoinDate ¶
func (x *ClanAccount) GetJoinDate() mx.MxTime
func (*ClanAccount) GetLastLoginTime ¶
func (x *ClanAccount) GetLastLoginTime() mx.MxTime
func (*ClanAccount) GetSocialGrade ¶
func (x *ClanAccount) GetSocialGrade() int32
func (*ClanAccount) SetLastLoginTime ¶
func (x *ClanAccount) SetLastLoginTime()
type EnterSet ¶
type EnterSet struct {
SessionMap map[int64]*Session // 玩家信息-缓存
EnterTicketMap map[string]*TicketInfo // 登录通行证字典-缓存
MailMap map[int64]*dbstruct.YostarMail // 全服邮件
YostarClan map[int64]*YostarClan // 全部缓存社团
YostarClanHash map[string]int64
}
type Mission ¶
type Mission struct {
MissionByCompleteConditionType map[string]map[int64]*sro.MissionInfo
SyncMission map[int64]*sro.MissionInfo // 待同步的任务列表
}
func (*Mission) AddMissionSync ¶
func (x *Mission) AddMissionSync(info *sro.MissionInfo)
func (*Mission) MissionFinishNum ¶
func (x *Mission) MissionFinishNum(t proto.MissionCompleteConditionType, bin *sro.MissionInfo, num int64)
计数类型的完成条件
type Session ¶
type Session struct {
AccountServerId int64
YostarUID int64
MxToken string
ActiveTime time.Time // 上次活跃时间
LastUpTime time.Time // 上次保存时间
AccountState proto.AccountState
PlayerBin *sro.PlayerBin // 玩家数据
Actions map[proto.ServerNotificationFlag]bool
AccountFriend *AccountFriend
Mission *Mission
Toast []*Toast
PlayerHash map[int64]any
Error proto.WebAPIErrorCode
// contains filtered or unexported fields
}
func GetSessionByAccountServerId ¶
GetSessionByAccountServerId 获取指定在线玩家
func GetSessionBySessionKey ¶
func GetSessionBySessionKey(sessionKey *proto.SessionKey) *Session
GetSessionBySessionKey 获取指定在线玩家
func GetSessionByUid ¶
GetSessionByUid 此接口的用处是拉取玩家数据,包括在数据库中的
func NewSession ¶
func (*Session) AddMissionByCompleteConditionType ¶
func (x *Session) AddMissionByCompleteConditionType(info *sro.CategoryMissionInfo)
func (*Session) AddPlayerHash ¶
AddPlayerHash 写入数据到哈希表中
func (*Session) DelPlayerHash ¶
func (*Session) FinishMission ¶
func (x *Session) FinishMission(t proto.MissionCompleteConditionType, num int64, parameter []int64)
func (*Session) GenArenaUserList ¶
GenArenaUserList 生成预战斗三人表
func (*Session) GetArenaInfo ¶
func (*Session) GetArenaUserByIndex ¶
func (*Session) GetArenaUserList ¶
func (*Session) GetBattleArenaUser ¶
func (*Session) GetCharacterByKeyId ¶
func (x *Session) GetCharacterByKeyId(k int64) *sro.CharacterInfo
func (*Session) GetEquipmentByKeyId ¶
func (x *Session) GetEquipmentByKeyId(k int64) *sro.EquipmentInfo
func (*Session) GetFriendInfo ¶
func (x *Session) GetFriendInfo() *AccountFriend
func (*Session) GetMission ¶
func (*Session) GetMissionByCompleteConditionType ¶
func (x *Session) GetMissionByCompleteConditionType() map[string]map[int64]*sro.MissionInfo
func (*Session) GetMissionSync ¶
func (x *Session) GetMissionSync() map[int64]*sro.MissionInfo
func (*Session) GetYostarGame ¶
func (x *Session) GetYostarGame() *dbstruct.YostarGame
GetYostarGame 将玩家数据转成数据库格式
func (*Session) MissionReward ¶
func (x *Session) MissionReward(info *sro.MissionInfo)
func (*Session) NewMissionSync ¶
func (x *Session) NewMissionSync()
func (*Session) SetBattleArenaUser ¶
type TicketInfo ¶
func GetEnterTicketInfo ¶
func GetEnterTicketInfo(ticker string) *TicketInfo
GetEnterTicketInfo 通过ticker获取登录信息
type YostarClan ¶
type YostarClan struct {
ServerId int64 `json:"serverId"`
ActiveTime time.Time `json:"-"` // 上次活跃时间
LastUpTime time.Time `json:"-"` // 上次保存时间
ClanName string `json:"clanName"`
AllAccount map[int64]*ClanAccount `json:"allAccount"` // 账号id
President int64 `json:"president"` // 主席账号id
JoinOption int32 `json:"joinOption"`
Notice string `json:"notice"`
ApplicantAccount map[int64]*ClanAccount `json:"applicantAccount"` // 申请者
}
func DbGetYostarClan ¶
func DbGetYostarClan(ycId int64) (*YostarClan, error)
DbGetYostarClan 从db拉取数据
func DbGetYostarClanByClanName ¶
func DbGetYostarClanByClanName(clanName string) (*YostarClan, error)
DbGetYostarClanByClanName 从db拉取数据
func GetYostarClanByClanName ¶
func GetYostarClanByClanName(clanName string) *YostarClan
func GetYostarClanByServerId ¶
func GetYostarClanByServerId(ycId int64) (yc *YostarClan)
GetYostarClanByServerId 拉取社团消息
func (*YostarClan) AddAccount ¶
func (x *YostarClan) AddAccount(uid int64, socialGrade int32) bool
func (*YostarClan) AddApplicantAccount ¶
func (x *YostarClan) AddApplicantAccount(uid int64) bool
func (*YostarClan) GetAllAccount ¶
func (x *YostarClan) GetAllAccount() map[int64]*ClanAccount
func (*YostarClan) GetAllApplicantAccount ¶
func (x *YostarClan) GetAllApplicantAccount() map[int64]*ClanAccount
func (*YostarClan) GetClanAccount ¶
func (x *YostarClan) GetClanAccount(uid int64) *ClanAccount
func (*YostarClan) GetMemberCount ¶
func (x *YostarClan) GetMemberCount() int64
func (*YostarClan) GetYostarClan ¶
func (x *YostarClan) GetYostarClan() *dbstruct.YostarClan
GetYostarClan 预处理db数据
func (*YostarClan) RemoveAccount ¶
func (x *YostarClan) RemoveAccount(uid int64) bool
func (*YostarClan) RemoveApplicantAccount ¶
func (x *YostarClan) RemoveApplicantAccount(uid int64)
func (*YostarClan) SetJoinOption ¶
func (x *YostarClan) SetJoinOption(joinOption int32) bool
func (*YostarClan) SetNotice ¶
func (x *YostarClan) SetNotice(notice string) bool
func (*YostarClan) SetPresident ¶
func (x *YostarClan) SetPresident(uid int64) bool
Click to show internal directories.
Click to hide internal directories.