Documentation ¶
Index ¶
- Variables
- func NewAccount() interface{}
- func NewLiteAccount() interface{}
- func NewLitePlayer() interface{}
- func NewPlayer() interface{}
- type Account
- func (a *Account) Exit()
- func (a *Account) GetPlayer() *Player
- func (a *Account) GetSock() transport.Socket
- func (a *Account) HeartBeat(rpcId int32)
- func (a *Account) Main(ctx context.Context) error
- func (a *Account) Run(ctx context.Context) error
- func (a *Account) SendProtoMessage(p proto.Message)
- func (a *Account) SetExecuteChannel(ch chan ExecutorHandler)
- func (a *Account) SetPlayer(p *Player)
- func (a *Account) SetSock(s transport.Socket)
- type BladeManager
- func (m *BladeManager) AddBlade(typeId int32) blade.Blade
- func (m *BladeManager) BladeAddExp(id int64, exp int64)
- func (m *BladeManager) BladeAddLevel(id int64, level int32)
- func (m *BladeManager) CanCost(typeMisc int32, num int32) error
- func (m *BladeManager) CanGain(typeMisc int32, num int32) error
- func (m *BladeManager) DelBlade(id int64)
- func (m *BladeManager) DoCost(typeMisc int32, num int32) error
- func (m *BladeManager) GainLoot(typeMisc int32, num int32) error
- func (m *BladeManager) GetBlade(id int64) (blade.Blade, error)
- func (m *BladeManager) GetBladeList() []blade.Blade
- func (m *BladeManager) GetBladeNums() int
- func (m *BladeManager) GetCostLootType() int32
- func (m *BladeManager) LoadAll() error
- func (m *BladeManager) PutonEquip(bladeID int64, equipID int64) error
- func (m *BladeManager) TakeoffEquip(bladeID int64) error
- type ExecutorHandler
- type HeroManager
- func (m *HeroManager) AddHeroByTypeID(typeID int32) hero.Hero
- func (m *HeroManager) CanCost(typeMisc int32, num int32) error
- func (m *HeroManager) CanGain(typeMisc int32, num int32) error
- func (m *HeroManager) DelHero(id int64)
- func (m *HeroManager) DoCost(typeMisc int32, num int32) error
- func (m *HeroManager) GainLoot(typeMisc int32, num int32) error
- func (m *HeroManager) GenerateCombatUnitInfo() []*pbCombat.UnitInfo
- func (m *HeroManager) GetCostLootType() int32
- func (m *HeroManager) GetHero(id int64) hero.Hero
- func (m *HeroManager) GetHeroList() []hero.Hero
- func (m *HeroManager) GetHeroNums() int
- func (m *HeroManager) HeroSetLevel(level int32)
- func (m *HeroManager) LoadAll() error
- func (m *HeroManager) PutonEquip(heroID int64, equipID int64) error
- func (m *HeroManager) PutonRune(heroId int64, runeId int64) error
- func (m *HeroManager) SendHeroAtt(h hero.Hero)
- func (m *HeroManager) SendHeroUpdate(h hero.Hero)
- func (m *HeroManager) TakeoffEquip(heroID int64, pos int32) error
- func (m *HeroManager) TakeoffRune(heroId int64, pos int32) error
- type ItemManager
- func (m *ItemManager) AddItemByTypeID(typeID int32, num int32) error
- func (m *ItemManager) CanCost(typeMisc int32, num int32) error
- func (m *ItemManager) CanGain(typeMisc int32, num int32) error
- func (m *ItemManager) CostItemByID(id int64, num int32) error
- func (m *ItemManager) CostItemByTypeID(typeID int32, num int32) error
- func (m *ItemManager) DeleteItem(id int64) error
- func (m *ItemManager) DoCost(typeMisc int32, num int32) error
- func (m *ItemManager) GainLoot(typeMisc int32, num int32) error
- func (m *ItemManager) GetCostLootType() int32
- func (m *ItemManager) GetItem(id int64) (item.Item, error)
- func (m *ItemManager) GetItemList() []item.Item
- func (m *ItemManager) GetItemNums() int
- func (m *ItemManager) LoadAll() error
- func (m *ItemManager) Save(id int64) error
- func (m *ItemManager) SendItemAdd(i item.Item)
- func (m *ItemManager) SendItemDelete(id int64)
- func (m *ItemManager) SendItemUpdate(i item.Item)
- func (m *ItemManager) UseItem(id int64) error
- type LiteAccount
- func (la *LiteAccount) AddPlayerID(playerID int64)
- func (la *LiteAccount) AfterLoad() error
- func (la *LiteAccount) GetID() int64
- func (la *LiteAccount) GetLevel() int32
- func (la *LiteAccount) GetName() string
- func (la *LiteAccount) GetObjID() int64
- func (la *LiteAccount) GetPlayerIDs() []int64
- func (la *LiteAccount) GetStoreIndex() int64
- func (la *LiteAccount) SetID(id int64)
- func (la *LiteAccount) SetLevel(level int32)
- func (la *LiteAccount) SetName(name string)
- type LitePlayer
- func (p *LitePlayer) AfterLoad() error
- func (p *LitePlayer) GetAccountID() int64
- func (p *LitePlayer) GetExp() int64
- func (p *LitePlayer) GetID() int64
- func (p *LitePlayer) GetLevel() int32
- func (p *LitePlayer) GetName() string
- func (p *LitePlayer) GetObjID() int64
- func (p *LitePlayer) GetStoreIndex() int64
- func (p *LitePlayer) SetAccountID(id int64)
- func (p *LitePlayer) SetID(id int64)
- func (p *LitePlayer) SetName(name string)
- func (p *LitePlayer) TableName() string
- type LitePlayerBenchmark
- type Player
- func (p *Player) AfterLoad() error
- func (p *Player) BladeManager() *BladeManager
- func (p *Player) CanCost(misc int32, num int32) error
- func (p *Player) CanGain(misc int32, num int32) error
- func (p *Player) ChangeExp(add int64)
- func (p *Player) ChangeLevel(add int32)
- func (p *Player) CostLootManager() *costloot.CostLootManager
- func (p *Player) DoCost(misc int32, num int32) error
- func (p *Player) GainLoot(misc int32, num int32) error
- func (p *Player) GetCostLootType() int32
- func (p *Player) GetType() int32
- func (p *Player) HeroManager() *HeroManager
- func (p *Player) ItemManager() *ItemManager
- func (p *Player) RuneManager() *RuneManager
- func (p *Player) SendProtoMessage(m proto.Message)
- func (p *Player) SetAccount(acct *Account)
- func (p *Player) TokenManager() *TokenManager
- type RuneManager
- func (m *RuneManager) AddRuneByTypeID(typeID int32) error
- func (m *RuneManager) CanCost(typeMisc int32, num int32) error
- func (m *RuneManager) CanGain(typeMisc int32, num int32) error
- func (m *RuneManager) CostRuneByID(id int64) error
- func (m *RuneManager) CostRuneByTypeID(typeID int32, num int32) error
- func (m *RuneManager) DeleteRune(id int64) error
- func (m *RuneManager) DoCost(typeMisc int32, num int32) error
- func (m *RuneManager) GainLoot(typeMisc int32, num int32) error
- func (m *RuneManager) GetCostLootType() int32
- func (m *RuneManager) GetRune(id int64) rune.Rune
- func (m *RuneManager) GetRuneList() []rune.Rune
- func (m *RuneManager) GetRuneNums() int
- func (m *RuneManager) LoadAll() error
- func (m *RuneManager) Save(id int64)
- func (m *RuneManager) SendRuneAdd(r rune.Rune)
- func (m *RuneManager) SendRuneDelete(id int64)
- func (m *RuneManager) SendRuneUpdate(r rune.Rune)
- func (m *RuneManager) SetRuneEquiped(id int64, objId int64)
- func (m *RuneManager) SetRuneUnEquiped(id int64)
- type Token
- type TokenManager
- func (m *TokenManager) AfterLoad() error
- func (m *TokenManager) CanCost(typeMisc int32, num int32) error
- func (m *TokenManager) CanGain(typeMisc int32, num int32) error
- func (m *TokenManager) DoCost(typeMisc int32, num int32) error
- func (m *TokenManager) GainLoot(typeMisc int32, num int32) error
- func (m *TokenManager) GetCostLootType() int32
- func (m *TokenManager) GetObjID() int64
- func (m *TokenManager) GetStoreIndex() int64
- func (m *TokenManager) GetToken(tp int32) (*Token, error)
- func (m *TokenManager) LoadAll() error
- func (m *TokenManager) SendTokenUpdate(t *Token)
- func (m *TokenManager) TokenDec(tp int32, value int64) error
- func (m *TokenManager) TokenInc(tp int32, value int64) error
- func (m *TokenManager) TokenSet(tp int32, value int64) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAccountDisconnect = errors.New("account disconnect") // handleSocket got this error will disconnect account ErrCreateMoreThanOnePlayer = errors.New("AccountManager.CreatePlayer failed: only can create one player") // only can create one player Account_MemExpire = time.Hour * 2 )
Functions ¶
func NewAccount ¶
func NewAccount() interface{}
func NewLiteAccount ¶
func NewLiteAccount() interface{}
func NewLitePlayer ¶
func NewLitePlayer() interface{}
Types ¶
type Account ¶
type Account struct { LiteAccount `bson:"inline" json:",inline"` // contains filtered or unexported fields }
full account info
func (*Account) SendProtoMessage ¶
msg Example:
Type: transport.BodyProtobuf Name: yokai_account.M2C_AccountLogon Body: protoBuf byte
func (*Account) SetExecuteChannel ¶
func (a *Account) SetExecuteChannel(ch chan ExecutorHandler)
type BladeManager ¶
func NewBladeManager ¶
func NewBladeManager(owner *Player) *BladeManager
func (*BladeManager) BladeAddExp ¶
func (m *BladeManager) BladeAddExp(id int64, exp int64)
func (*BladeManager) BladeAddLevel ¶
func (m *BladeManager) BladeAddLevel(id int64, level int32)
func (*BladeManager) DelBlade ¶
func (m *BladeManager) DelBlade(id int64)
func (*BladeManager) GetBladeList ¶
func (m *BladeManager) GetBladeList() []blade.Blade
func (*BladeManager) GetBladeNums ¶
func (m *BladeManager) GetBladeNums() int
func (*BladeManager) GetCostLootType ¶
func (m *BladeManager) GetCostLootType() int32
interface of cost_loot
func (*BladeManager) LoadAll ¶
func (m *BladeManager) LoadAll() error
func (*BladeManager) PutonEquip ¶
func (m *BladeManager) PutonEquip(bladeID int64, equipID int64) error
func (*BladeManager) TakeoffEquip ¶
func (m *BladeManager) TakeoffEquip(bladeID int64) error
type HeroManager ¶
func NewHeroManager ¶
func NewHeroManager(owner *Player) *HeroManager
func (*HeroManager) AddHeroByTypeID ¶
func (m *HeroManager) AddHeroByTypeID(typeID int32) hero.Hero
func (*HeroManager) DelHero ¶
func (m *HeroManager) DelHero(id int64)
func (*HeroManager) GenerateCombatUnitInfo ¶
func (m *HeroManager) GenerateCombatUnitInfo() []*pbCombat.UnitInfo
func (*HeroManager) GetCostLootType ¶
func (m *HeroManager) GetCostLootType() int32
interface of cost_loot
func (*HeroManager) GetHeroList ¶
func (m *HeroManager) GetHeroList() []hero.Hero
func (*HeroManager) GetHeroNums ¶
func (m *HeroManager) GetHeroNums() int
func (*HeroManager) HeroSetLevel ¶
func (m *HeroManager) HeroSetLevel(level int32)
func (*HeroManager) LoadAll ¶
func (m *HeroManager) LoadAll() error
func (*HeroManager) PutonEquip ¶
func (m *HeroManager) PutonEquip(heroID int64, equipID int64) error
func (*HeroManager) SendHeroAtt ¶
func (m *HeroManager) SendHeroAtt(h hero.Hero)
func (*HeroManager) SendHeroUpdate ¶
func (m *HeroManager) SendHeroUpdate(h hero.Hero)
func (*HeroManager) TakeoffEquip ¶
func (m *HeroManager) TakeoffEquip(heroID int64, pos int32) error
func (*HeroManager) TakeoffRune ¶
func (m *HeroManager) TakeoffRune(heroId int64, pos int32) error
type ItemManager ¶
func NewItemManager ¶
func NewItemManager(owner *Player) *ItemManager
func (*ItemManager) AddItemByTypeID ¶
func (m *ItemManager) AddItemByTypeID(typeID int32, num int32) error
func (*ItemManager) CostItemByID ¶
func (m *ItemManager) CostItemByID(id int64, num int32) error
func (*ItemManager) CostItemByTypeID ¶
func (m *ItemManager) CostItemByTypeID(typeID int32, num int32) error
func (*ItemManager) DeleteItem ¶
func (m *ItemManager) DeleteItem(id int64) error
func (*ItemManager) GetCostLootType ¶
func (m *ItemManager) GetCostLootType() int32
interface of cost_loot
func (*ItemManager) GetItemList ¶
func (m *ItemManager) GetItemList() []item.Item
func (*ItemManager) GetItemNums ¶
func (m *ItemManager) GetItemNums() int
func (*ItemManager) LoadAll ¶
func (m *ItemManager) LoadAll() error
func (*ItemManager) Save ¶
func (m *ItemManager) Save(id int64) error
func (*ItemManager) SendItemAdd ¶
func (m *ItemManager) SendItemAdd(i item.Item)
func (*ItemManager) SendItemDelete ¶
func (m *ItemManager) SendItemDelete(id int64)
func (*ItemManager) SendItemUpdate ¶
func (m *ItemManager) SendItemUpdate(i item.Item)
func (*ItemManager) UseItem ¶
func (m *ItemManager) UseItem(id int64) error
type LiteAccount ¶
type LiteAccount struct { store.StoreObjector `bson:"-" json:"-"` ID int64 `bson:"_id" json:"_id"` UserId int64 `bson:"user_id" json:"user_id"` GameId int16 `bson:"game_id" json:"game_id"` Name string `bson:"name" json:"name"` Level int32 `bson:"level" json:"level"` PlayerIDs []int64 `bson:"player_id" json:"player_id"` }
lite account info
func (*LiteAccount) AddPlayerID ¶
func (la *LiteAccount) AddPlayerID(playerID int64)
func (*LiteAccount) AfterLoad ¶
func (la *LiteAccount) AfterLoad() error
func (*LiteAccount) GetID ¶
func (la *LiteAccount) GetID() int64
func (*LiteAccount) GetLevel ¶
func (la *LiteAccount) GetLevel() int32
func (*LiteAccount) GetName ¶
func (la *LiteAccount) GetName() string
func (*LiteAccount) GetObjID ¶
func (la *LiteAccount) GetObjID() int64
func (*LiteAccount) GetPlayerIDs ¶
func (la *LiteAccount) GetPlayerIDs() []int64
func (*LiteAccount) GetStoreIndex ¶
func (la *LiteAccount) GetStoreIndex() int64
func (*LiteAccount) SetID ¶
func (la *LiteAccount) SetID(id int64)
func (*LiteAccount) SetLevel ¶
func (la *LiteAccount) SetLevel(level int32)
func (*LiteAccount) SetName ¶
func (la *LiteAccount) SetName(name string)
type LitePlayer ¶
type LitePlayer struct { store.StoreObjector `bson:"-" json:"-"` ID int64 `bson:"_id" json:"_id"` AccountID int64 `bson:"account_id" json:"account_id"` Name string `bson:"name" json:"name"` Exp int64 `bson:"exp" json:"exp"` Level int32 `bson:"level" json:"level"` }
func (*LitePlayer) AfterLoad ¶
func (p *LitePlayer) AfterLoad() error
func (*LitePlayer) GetAccountID ¶
func (p *LitePlayer) GetAccountID() int64
func (*LitePlayer) GetExp ¶
func (p *LitePlayer) GetExp() int64
func (*LitePlayer) GetID ¶
func (p *LitePlayer) GetID() int64
func (*LitePlayer) GetLevel ¶
func (p *LitePlayer) GetLevel() int32
func (*LitePlayer) GetName ¶
func (p *LitePlayer) GetName() string
func (*LitePlayer) GetObjID ¶
func (p *LitePlayer) GetObjID() int64
func (*LitePlayer) GetStoreIndex ¶
func (p *LitePlayer) GetStoreIndex() int64
func (*LitePlayer) SetAccountID ¶
func (p *LitePlayer) SetAccountID(id int64)
func (*LitePlayer) SetID ¶
func (p *LitePlayer) SetID(id int64)
func (*LitePlayer) SetName ¶
func (p *LitePlayer) SetName(name string)
func (*LitePlayer) TableName ¶
func (p *LitePlayer) TableName() string
type LitePlayerBenchmark ¶
type LitePlayerBenchmark struct { Benchmark1 int32 `bson:"benchmark_1"` Benchmark2 int32 `bson:"benchmark_2"` Benchmark3 int32 `bson:"benchmark_3"` Benchmark4 int32 `bson:"benchmark_4"` Benchmark5 int32 `bson:"benchmark_5"` Benchmark6 int32 `bson:"benchmark_6"` Benchmark7 int32 `bson:"benchmark_7"` Benchmark8 int32 `bson:"benchmark_8"` Benchmark9 int32 `bson:"benchmark_9"` Benchmark10 int32 `bson:"benchmark_10"` }
type Player ¶
type Player struct { LitePlayer `bson:"inline" json:",inline"` // contains filtered or unexported fields }
func (*Player) BladeManager ¶
func (p *Player) BladeManager() *BladeManager
func (*Player) ChangeLevel ¶
func (*Player) CostLootManager ¶
func (p *Player) CostLootManager() *costloot.CostLootManager
func (*Player) HeroManager ¶
func (p *Player) HeroManager() *HeroManager
func (*Player) ItemManager ¶
func (p *Player) ItemManager() *ItemManager
func (*Player) RuneManager ¶
func (p *Player) RuneManager() *RuneManager
func (*Player) SendProtoMessage ¶
func (*Player) SetAccount ¶
func (*Player) TokenManager ¶
func (p *Player) TokenManager() *TokenManager
type RuneManager ¶
func NewRuneManager ¶
func NewRuneManager(owner *Player) *RuneManager
func (*RuneManager) AddRuneByTypeID ¶
func (m *RuneManager) AddRuneByTypeID(typeID int32) error
func (*RuneManager) CostRuneByID ¶
func (m *RuneManager) CostRuneByID(id int64) error
func (*RuneManager) CostRuneByTypeID ¶
func (m *RuneManager) CostRuneByTypeID(typeID int32, num int32) error
func (*RuneManager) DeleteRune ¶
func (m *RuneManager) DeleteRune(id int64) error
func (*RuneManager) GetCostLootType ¶
func (m *RuneManager) GetCostLootType() int32
interface of cost_loot
func (*RuneManager) GetRuneList ¶
func (m *RuneManager) GetRuneList() []rune.Rune
func (*RuneManager) GetRuneNums ¶
func (m *RuneManager) GetRuneNums() int
func (*RuneManager) LoadAll ¶
func (m *RuneManager) LoadAll() error
func (*RuneManager) Save ¶
func (m *RuneManager) Save(id int64)
func (*RuneManager) SendRuneAdd ¶
func (m *RuneManager) SendRuneAdd(r rune.Rune)
func (*RuneManager) SendRuneDelete ¶
func (m *RuneManager) SendRuneDelete(id int64)
func (*RuneManager) SendRuneUpdate ¶
func (m *RuneManager) SendRuneUpdate(r rune.Rune)
func (*RuneManager) SetRuneEquiped ¶
func (m *RuneManager) SetRuneEquiped(id int64, objId int64)
func (*RuneManager) SetRuneUnEquiped ¶
func (m *RuneManager) SetRuneUnEquiped(id int64)
type Token ¶
type Token struct { ID int32 `bson:"token_id" json:"token_id"` Value int64 `bson:"token_value" json:"token_value"` MaxHold int64 `bson:"token_max_hold" json:"token_max_hold"` Entry *define.TokenEntry `bson:"-" json:"-"` }
type TokenManager ¶
type TokenManager struct { store.StoreObjector `bson:"-" json:"-"` OwnerType int32 `bson:"owner_type" json:"owner_type"` Tokens []*Token `bson:"tokens" json:"tokens"` sync.RWMutex `bson:"-" json:"-"` // contains filtered or unexported fields }
func NewTokenManager ¶
func NewTokenManager(owner *Player) *TokenManager
func (*TokenManager) AfterLoad ¶
func (m *TokenManager) AfterLoad() error
func (*TokenManager) GetCostLootType ¶
func (m *TokenManager) GetCostLootType() int32
interface of cost_loot
func (*TokenManager) GetObjID ¶
func (m *TokenManager) GetObjID() int64
func (*TokenManager) GetStoreIndex ¶
func (m *TokenManager) GetStoreIndex() int64
func (*TokenManager) LoadAll ¶
func (m *TokenManager) LoadAll() error
func (*TokenManager) SendTokenUpdate ¶
func (m *TokenManager) SendTokenUpdate(t *Token)
Click to show internal directories.
Click to hide internal directories.