Documentation ¶
Index ¶
- Constants
- Variables
- func AddAttributeTeam(self PropMap, AttributeTeam []*PB.AttributeType)
- func AddAttributeType(self *PB.ClassAttributeType, new *PB.ClassAttributeType)
- func AddPropMods(self *PB.PropMods, m *PB.PropMods)
- func AddProps(self *PB.ClassAttributeType, Type, id int32, num float32)
- func GetMyRank(req *PB.GS_GetRank) (res *PB.GS_GetRank_R)
- func GetNextRankSortTs() int64
- func GetRankType(RankType PB.RankType) string
- func InitRank()
- func ModBase(self *PB.PropMods, id int32, v float32)
- func ModBasePct(self *PB.PropMods, id int32, v float32)
- func ModExt(self *PB.PropMods, id int32, v float32)
- func NewPropMods() *PB.PropMods
- func RankAdd()
- func RankOpen()
- func RankReset()
- func RankSave(req *PB.GS_SetRank)
- func RankSort()
- func SubPropMods(self *PB.PropMods, m *PB.PropMods)
- type A_rank
- type ClassProp
- type OneRank
- type Player
- func (self *Player) AccOnlineDur()
- func (self *Player) AddExp(v int64) bool
- func (self *Player) AddGiftCodeLog(s string)
- func (self *Player) BindGuild(gldid string)
- func (self *Player) BuyCount(counter_id int32, num int32) int32
- func (self *Player) CalcHeroesProps(sendUpdate bool)
- func (self *Player) CalcProp(Calc bool) *PB.ClassAttributeType
- func (self *Player) CalcTeamProps(sendUpdate bool)
- func (self *Player) ChangeName(name string, f func(bool))
- func (self *Player) CheckGmailDeliverCond(cond string) bool
- func (self *Player) CreateBattlePlayer() *PB.BattlePlayer
- func (self *Player) CreateMainHero(id int32) *hero.MainHero
- func (self *Player) DB() *db.Database
- func (self *Player) Drop(args ...interface{}) (ret []int32)
- func (self *Player) GetAct() *act.Act
- func (self *Player) GetActPersonalStage(actid int32) int32
- func (self *Player) GetActRawData(actid int32) interface{}
- func (self *Player) GetAtkPower() int32
- func (self *Player) GetBag() *comp.Bag
- func (self *Player) GetBill() *bill.Bill
- func (self *Player) GetBillSumDiam() int32
- func (self *Player) GetClientData() *PB.GS_UserInfo
- func (self *Player) GetCloud() *cloud.Cloud
- func (self *Player) GetCounter() *counter.Counter
- func (self *Player) GetCreateTs() time.Time
- func (self *Player) GetDevId() string
- func (self *Player) GetExp() int64
- func (self *Player) GetFashions() *hero.FashionMap
- func (self *Player) GetFields() *comp.Fields
- func (self *Player) GetFigure() int32
- func (self *Player) GetFigureStore() *comp.FigureStore
- func (self *Player) GetGiftCode() []string
- func (self *Player) GetGuild() *guild.Guild
- func (self *Player) GetGuildBuildingLv(id int32) int32
- func (self *Player) GetGuildId() string
- func (self *Player) GetGuildName() string
- func (self *Player) GetGuildRank() int32
- func (self *Player) GetHFrame() int32
- func (self *Player) GetHFrameStore() *comp.HFrameStore
- func (self *Player) GetHead() int32
- func (self *Player) GetHeadStore() *comp.HeadStore
- func (self *Player) GetHeroes() *hero.Heroes
- func (self *Player) GetId() string
- func (self *Player) GetLevel() int32
- func (self *Player) GetMailBox() *mail.MailBox
- func (self *Player) GetMainHero() *hero.MainHero
- func (self *Player) GetMisc() *misc.Misc
- func (self *Player) GetName() string
- func (self *Player) GetOfflineTs() time.Time
- func (self *Player) GetOnlineDur() int32
- func (self *Player) GetPlat() string
- func (self *Player) GetSdk() string
- func (self *Player) GetShop() *shop.Shop
- func (self *Player) GetShopBuyCnt(shopid, itemid int32) int32
- func (self *Player) GetSvr() string
- func (self *Player) GetSvrId() int32
- func (self *Player) GetTask(tasktype int32, args ...interface{}) (ret *PB.Unit)
- func (self *Player) GetTeam() map[int32]int32
- func (self *Player) GetTutorial() *tutorial.Tutorial
- func (self *Player) GetUser() *User
- func (self *Player) GetVip() *vip.Vip
- func (self *Player) GetVipLevel() int32
- func (self *Player) GetWorld() *world.World
- func (self *Player) HeartBeat()
- func (self *Player) InGuild() bool
- func (self *Player) IsCardValid(typeid int32) bool
- func (self *Player) IsOnline() bool
- func (self *Player) Logout()
- func (self *Player) OnLevelup(new_lv int32)
- func (self *Player) OnOffline()
- func (self *Player) OnOnline()
- func (self *Player) Reconnect(sessionKey uint64)
- func (self *Player) Reset_Daily()
- func (self *Player) Reset_GetTime() time.Time
- func (self *Player) Reset_SetTime(ts time.Time)
- func (self *Player) SendMail(mid int32, attachment []*comp.Object, dict map[string]string)
- func (self *Player) SendMsg(message PB.Message)
- func (self *Player) SendMsgWithoutQueue(message PB.Message)
- func (self *Player) SetActPersonalStage(actid int32, v int32)
- func (self *Player) User() *User
- type PropMap
- type Rank_rec
- type SocketGW
- type SocketRt
- type User
Constants ¶
View Source
const ( C_prop_min_pct_id = 1000 C_prop_min_aggregate_id = 3000 C_prop_pct_plus_id = 1000 )
属性Id 规则
- 固定点属性: fixed = value [1, 99]
- 百分比加成属性: pct = fixed + 1000 [1001, 1099]
- 聚集加成属性: agr = fixed(pct) + 3000 + count*100 [3001, 4999]
View Source
const ( PROP_PAtk = 10 // 物理攻击 PROP_MAtk = 11 // 魔法攻击 PROP_MDef = 13 // 魔法防御 PROP_PDef = 14 // 物理防御 PROP_Hp = 16 // 生命 PROP_Magic = 17 // 魔法值 PROP_MSpeed = 19 // 移动速度 PROP_DefDuce = 33 // 无视防御 PROP_Hit = 34 // 命中值 PROP_Dodge = 35 // 闪避值 PROP_Crit = 36 // 暴击值 PROP_CritRes = 37 // 抗暴值 PROP_CritDmg = 38 // 暴伤值 PROP_CritDmgRes = 39 // 暴伤抵抗值 PROP_DmgUp = 40 // 增伤值 PROP_DmgDown = 41 // 伤害减免 PROP_DmgBack = 42 // 伤害反弹 PROP_Blood = 43 // 吸血值 PROP_DmgExt = 44 // 额外伤害 PROP_DmgPct = 45 // 最终伤害百分比加成 PROP_SkillPct = 46 // 技能伤害百分比加成 PROP_SKillDmgDuce = 47 // 技能承伤减少 PROP_ExpAdd = 83 // 经验增加 PROP_CoinAdd = 84 // 金币增加 PROP_AtkPct = 4210 // 攻击百分比 PROP_HpPct = 1016 // 生命百分比 PROP_DefPct = 4213 // 防御百分比 PROP_CurHp = 10002 // 当前血量 )
固定属性 Id 含义
View Source
const (
C_max_gateid = 100000
)
Variables ¶
View Source
var ( C_op_register_gate = (&PB.GW_RegisterGate{}).MsgId() C_op_test = (&PB.C_Test{}).MsgId() )
View Source
var (
GSReport = &gs_report_t{}
)
View Source
var NetMgr = &netmgr_t{ gates: make(map[int32]*SocketGW), connectq: tcp.NewConnectQ(), cnn_rt: make(map[int32]*SocketRt), }
Functions ¶
func AddAttributeTeam ¶
func AddAttributeTeam(self PropMap, AttributeTeam []*PB.AttributeType)
计算额外的加成属性
func AddAttributeType ¶
func AddAttributeType(self *PB.ClassAttributeType, new *PB.ClassAttributeType)
func AddPropMods ¶
func AddPropMods(self *PB.PropMods, m *PB.PropMods)
func GetNextRankSortTs ¶
func GetNextRankSortTs() int64
func GetRankType ¶
func GetRankType(RankType PB.RankType) string
func InitRank ¶
func InitRank()
============================================================================
func ModBasePct ¶
func NewPropMods ¶
func NewPropMods() *PB.PropMods
func SubPropMods ¶
func SubPropMods(self *PB.PropMods, m *PB.PropMods)
Types ¶
type A_rank ¶
func (A_rank) GetRankData ¶
type ClassProp ¶
type ClassProp struct { Prop_mods *PB.PropMods //统计个人属性 Props2other *PB.ClassAttributeType `bson:"-"` //自己加其他人的范围属性 Props2map *PB.PropMods //加自己的范围属性 Prop_map PropMap //最后属性 }
func NewClassProp ¶
func NewClassProp() *ClassProp
============================================================================
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
func (*Player) AccOnlineDur ¶
func (self *Player) AccOnlineDur()
func (*Player) AddGiftCodeLog ¶
func (*Player) ChangeName ¶
func (*Player) CheckGmailDeliverCond ¶
func (*Player) CreateBattlePlayer ¶
func (self *Player) CreateBattlePlayer() *PB.BattlePlayer
func (*Player) GetActPersonalStage ¶
func (*Player) GetActRawData ¶
func (*Player) GetAtkPower ¶
func (*Player) GetClientData ¶
func (self *Player) GetClientData() *PB.GS_UserInfo
func (*Player) GetCounter ¶
func (*Player) GetCreateTs ¶
func (*Player) GetFashions ¶
func (self *Player) GetFashions() *hero.FashionMap
func (*Player) GetFigureStore ¶
func (self *Player) GetFigureStore() *comp.FigureStore
func (*Player) GetGiftCode ¶
func (*Player) GetGuildBuildingLv ¶
func (*Player) GetGuildId ¶
func (*Player) GetGuildName ¶
func (*Player) GetGuildRank ¶
func (*Player) GetHFrameStore ¶
func (self *Player) GetHFrameStore() *comp.HFrameStore
func (*Player) GetHeadStore ¶
func (*Player) GetMailBox ¶
func (*Player) GetMainHero ¶
func (*Player) GetOfflineTs ¶
func (*Player) GetOnlineDur ¶
func (*Player) GetShopBuyCnt ¶
func (*Player) GetTutorial ¶
func (*Player) GetVip ¶
============================================================================ vip
func (*Player) GetVipLevel ¶
func (*Player) IsCardValid ¶
func (*Player) Reset_Daily ¶
func (self *Player) Reset_Daily()
func (*Player) Reset_GetTime ¶
func (*Player) Reset_SetTime ¶
func (*Player) SendMsgWithoutQueue ¶
func (self *Player) SendMsgWithoutQueue(message PB.Message)
func (*Player) SetActPersonalStage ¶
type PropMap ¶
func UpdatePropMap ¶
type SocketGW ¶
type SocketGW struct {
// contains filtered or unexported fields
}
func (*SocketGW) SendPacket ¶
type SocketRt ¶
type SocketRt struct { Id int32 // contains filtered or unexported fields }
func (*SocketRt) SendPacket ¶
type User ¶
type User struct { Id string `bson:"-"` // Id AuthId string `bson:"authid"` // 认证 Id Svr0 string `bson:"svr0"` // 原始服名称 Svr string `bson:"svr"` // 当前服名称 Sdk string `bson:"sdk"` // sdk Plat string `bson:"plat"` // 登录平台 DevId string `bson:"devid"` // 上次登录设备码 CreateTs time.Time `bson:"create_ts"` // 创建时间 LoginTs time.Time `bson:"login_ts"` // 上次登录时间 LoginIP string `bson:"login_ip"` // 上次登录 IP LoginCtDays int32 `bson:"login_ctdays"` // 最近连续登录天数 OnlineDur int32 `bson:"online_dur"` // 累计在线时长 (秒) Offline_ts time.Time `bson:"off_ts"` // 上次离线时间 Rst_ts time.Time `bson:"rst_ts"` // 上次重置时间 Name string `bson:"name"` // 名字 Head int32 `bson:"head"` // 头像 HFrame int32 `bson:"hframe"` // 相框 Figure int32 `bson:"figure"` // 当前形象 HeadStore *comp.HeadStore `bson:"head_store"` // 头像库 HFrameStore *comp.HFrameStore `bson:"hframe_store"` // 头像框库 FigureStore *comp.FigureStore `bson:"figure_store"` // 形象库 Lv int32 `bson:"lv"` // 等级 Exp int64 `bson:"exp"` // 经验 Vip *vip.Vip `bson:"vip"` // vip等级 Bag *comp.Bag `bson:"bag"` // 背包 MainHero *hero.MainHero `bson:"main_hero"` //主角 Heroes *hero.Heroes //获得的武将 TeamMap map[int32]int32 //布阵map<pos,heroId> Fashions *hero.FashionMap // 时装 World *world.World Fields *comp.Fields `bson:"flds"` // 域 Bill *bill.Bill `bson:"bill"` // 充值 MailBox *mail.MailBox `bson:"mailbox"` // 邮箱 Tutorial *tutorial.Tutorial `bson:"tutorial"` // 新手 Cloud *cloud.Cloud `bson:"cloud"` // 云数据 Misc *misc.Misc `bson:"misc"` // 杂项数据 Act *act.Act `bson:"act"` // 活动 Counter *counter.Counter `bson:"cnt"` // 计数恢复 Shop *shop.Shop `bson:"shop"` // 商店 GuildId string `bson:"guildid"` // 公会 Id Guild *guild.Guild `bson:"-"` // 公会 GiftCode []string `bson:"gift_code"` // 已领取的礼包码 ChatTs time.Time `bson:"-"` // 玩家聊天时间 ClientData *PB.GS_UserInfo // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.