utils

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast

func Broadcast(message PB.Message)

func BuyCount

func BuyCount(plr IPlayer, counter_id int32, num int32) int32

func CheckCount

func CheckCount(plr IPlayer, counter_id int32, num int64) int32

func Drop

func Drop(args ...interface{}) (ret []int32)

============================================================================ args 0:玩家 1:掉落组id 2:排斥组 3:数量

func DropOne

func DropOne(grpid int32) (ret int32)

func FindPlayer

func FindPlayer(uid string) interface{}

func GenRandCode

func GenRandCode(n int) string

func GenRandName

func GenRandName(fake bool) (name string)

func Init

func Init(plrmgr IPlayerMgr, netmgr INetMgr, statustab IStatusTab)

func IsStatusTabArrayConform

func IsStatusTabArrayConform(plr interface{}, confXXX_FieldName interface{}, extra interface{}) int32

用法: utils.IsStatusTabArrayConform(plr,confXXX.FieldName) == Err.OK 须知: confXXX.FieldName是策划表里面的字段,字段名可以自定义,但类型必须和下面的断言类型一致.否则异常

func IsStatusTabConform

func IsStatusTabConform(plr interface{}, c_type int32, id int32, num int32, extra interface{}) int32

============================================================================ 用法: utils.IsStatusTabConform(plr,id,val) == Err.OK extra额外参数,根据具体逻辑传递

func LoadPlayer

func LoadPlayer(uid string) interface{}

func Send2Bat

func Send2Bat(batid int32, message PB.Message)

func Send2CrossPlayer

func Send2CrossPlayer(svrid int32, plrid string, message PB.Message)

func Send2Game

func Send2Game(svrid int32, message PB.Message)

func Send2GlobalMaster

func Send2GlobalMaster(message PB.Message)

func Send2GrandMaster

func Send2GrandMaster(message PB.Message)

func Send2Master

func Send2Master(message PB.Message)

func WeightRand

func WeightRand(conf1 *PB.Unit, num int32) (ret []int32)

func WeightRandone

func WeightRandone(conf *PB.Unit) (ret int32)

Types

type INetMgr

type INetMgr interface {
	Send2Bat(batid int32, message PB.Message)
	Send2Game(svrid int32, message PB.Message)
	Send2CrossPlayer(svrid int32, plrid string, message PB.Message)
	Send2Master(message PB.Message)
	Send2GrandMaster(message PB.Message)
	Send2GlobalMaster(message PB.Message)
}

type IPlayer

type IPlayer interface {
	comp.IPlayer
}

type IPlayerMgr

type IPlayerMgr interface {
	LoadIPlayer(uid string) interface{}
	FindIPlayerById(uid string) interface{}
	Array_OnlineIPlayers() []interface{}
}

type IStatusTab

type IStatusTab interface {
	IsStatusTabConform(plr interface{}, c_type int32, id int32, num int32, extra interface{}) PB.RetType
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL