msg

package
v0.0.0-...-cd1bf01 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginErr_begin = iota
	LoginErr_tokenerr
	LoginErr_nouser
	LoginErr_inotherroom
	LoginErr_gamecoin_notenough
	LoginErr_gamecoin_toomuch
	LoginErr_accountforbidden
	LoginErr_wrongpasswd
	LoginErr_nophysical //没有体力
)

游戏登录

View Source
const (
	SitErr_Begin = iota
	SitErr_NoFitLocation
	SitErr_HaveSit
	SitErr_ForbidWatch
	SitErr_NoLogin
	SitErr_coin_toomuch
	SitErr_coin_notenough
	SitErr_nophysical
)

入座

View Source
const (
	Handuperr_begin = iota
	Handuperr_no_sitdown
	Handuperr_already_hand
	Handuperr_coin_notenough
	Handuperr_coin_toomuch
	Handuperr_room_closed
)

Handuperr

View Source
const (
	TableLeave_ToRoom = iota
	TableLeave_ChangeTable
)

Tableplayerleave

View Source
const (
	Kickout_begin          = iota
	Kickout_toolong_handup //入座举手超时
	Kickout_toolong_think  //对战考虑超时
	Kickout_room_closed    //房间已关闭
)

Variables

View Source
var Processor = json.NewProcessor()

使用默认的 JSON 消息处理器(默认还提供了 protobuf 消息处理器)

View Source
var Processortype = reflect.TypeOf(Processor)

Functions

This section is empty.

Types

type AD_GetRewardReq

type AD_GetRewardReq struct {
	IsLook int8 //是否成功看广告 1成功
}

看广告成功请求

type AD_GetRewardRes

type AD_GetRewardRes struct {
	Goldbean int32 //奖券值 分 <0 表示错误
}

看广告后领取奖励答复

type AccountDBWPropReq

type AccountDBWPropReq struct {
	UserID        int64  //用户ID
	UserIP        string //
	LobbyBigVer   string
	LobbySmallVer string
	RegAppID      string
	RegChannelID  int32
	RegTime       time.Time
	AcType        int8             //账号类型
	AppID         string           //长渠道
	TradeNo       string           //货币来源订单号,一般充值有
	SubChannelID  int32            //短渠道
	SourceID      int32            //货币来源
	GiftID        int32            //礼包ID
	ActID         int32            //
	PropList      []UserPropChange //道具列表
}

type Accountrdatareq

type Accountrdatareq struct {
	Account     string
	Passwd      string
	Token       string  //登录token
	LoginRoute  string  //登录来源,Login,Lobby,DZMJ
	Serverid    string  //
	Loginip     string  //
	MacID       string  //
	AppID       string  //
	Userid      int64   //
	Gameid      int32   //
	ServerLevel int32   //
	ChannelID   int32   //
	DevType     int8    //
	SDKAcType   int8    //第三方账号类型
	Proplist    []int32 //道具列表
}

type Accountwdatareq

type Accountwdatareq struct {
	UserID            int64 //
	GameTax           uint64
	Diamond           int64
	GameCoin          int64 //增量
	PlayCoin          int64 //游戏玩分
	GameCoinwin       int64 //
	GameCoinlose      int64 //
	GameID            int32 //
	ServerID          string
	RoomLevel         int32
	PrizeTicket       int32 //增量
	HelpTimes         int32 //增量
	GameExp           int32
	VipExp            int32
	RechargeMoney     int32
	GamePlaytime      int32 //
	GameOnlinetime    int32 //
	GameWintimes      int32 //
	GameLosetimes     int32 //
	GameWinStktimes   int32 //连胜
	GameLoseStktimes  int32 //连输
	GameWinmStktimes  int32 //最大连胜
	GameLosemStktimes int32 //最大连输
	SourceID          int32 //货币来源
	GiftID            int32 //礼包ID
	ActID             int32 //活动ID
	OpenID            string
	UnionID           string
	ThirdAppID        string
	ThirdAppKey       string
	TradeNo           string           //订单号
	PropList          []UserPropChange //道具列表增量
	IsQuitGame        bool             //是否退出游戏
	RedPacketTimes    int32            //拆红包次数
	BuybPlayTimes     int32            //首充B之后玩的局数,非增量
	GamePlaytimes     int32            //每日玩游戏局数
	GameExtStr        string           //游戏每日扩展属性
	IsRobot           bool             //是否机器人
	//任务属性
	TaskID       int32 //每日任务ID
	TaskProgress int32 //任务进度
	TaskTime     time.Time
}

type ActPlayersGameEndMsg

type ActPlayersGameEndMsg struct {
	WinOrFail int8  //赢1 输-1 平0
	WinScore  int32 //赢局积分
}

游戏服在PlayersGameEnd时发送的 msg

type ActivityReqMsg

type ActivityReqMsg struct {
	Route     string //触发资源名 “如:玩家入座PlayerSitDownSuccess”,这个字段数据玩家登陆时会发送给游戏服
	ClientMsg string //客户端数据
}

活动消息请求,向活动服发送数据

type ActivityReqMsgs

type ActivityReqMsgs struct {
	RouteMsgs         []RouteMsg //[优先级]触发资源
	UserID            int64      //玩家id
	AcType            int8       //0:官方游客 1:sdk账号 2:微信账号
	AcIsVisit         bool       //是否游客
	GameID            int32      //游戏id
	RoomLevel         int32      //房间等级,这个等级可能为 0
	RegisteTime       int32      //注册时间v
	RegProvince       string     //注册省份
	RegCity           string     // 注册城市
	RegIP             string     // 注册IP
	LgnIP             string     //  登录IP
	IsFirstUser       bool       //是否新手
	IsRobot           bool       //是否机器人
	VipExp            int32      //vip等级
	RegChannelInfo    string     //注册长渠道
	ChannelID         int32      //渠道id
	LgnChannelInfo    string     //登录长渠道
	LgnChannelID      int32      //登录渠道
	TypeID            int32      //类型id 判断是否快速登录
	GameCoin          int64      //当前积分
	LotteryNum        int32      //当前奖券
	PlatPlayTime      int32      //平台游戏时长
	GamePlayTime      int32      //当前游戏时长
	PlatGameWinTimes  int32      //平台玩家赢局数
	PlatGameLoseTimes int32      //平台玩家输局数
	GameWinTimes      int32      //玩家赢局数
	GameLoseTimes     int32      //玩家输局数
	GameBWinTimes     int32      //刺激场玩家赢局数
	GameBLoseTimes    int32      //刺激场玩家输局数
	RedPacketTimes    int32      //玩家拆红包数量
	NickName          string     //玩家昵称
	HeadURL           string     //用户头像地址
}

type ActivityResponseMsg

type ActivityResponseMsg struct {
	Errcode        int32  //错误码
	Route          string //触发资源名
	UserID         int32
	MapResponseMsg map[string]interface{} //[活动id][结构体]
}

活动服返回数据

type ActivitySubsidyReq

type ActivitySubsidyReq struct {
	SubsidyCount int32 //救济金次数
}

救济金

type ActivityUpDownRoomReq

type ActivityUpDownRoomReq struct {
	RoomID string
}

升降场

type ApplyRobotReq

type ApplyRobotReq struct {
	UserID    int64
	NickName  string
	GameCoin  int64
	TableID   int32
	ChairID   int32
	MatchTime int64 //匹配入座时间
}

type BulleNoticeRes

type BulleNoticeRes struct {
	VipExp           int32
	NextVipExp       int32
	VipLevel         int32
	VipRechargeTimes []VipRechargeTimesDef
}

type BulletinNotice

type BulletinNotice struct {
	Event      string      `json:"event"` //事件名
	GameID     int32       `json:"gameid"`
	RoomID     string      `json:"roomid"`
	LevelGame  int32       `json:"levelgame"`
	AreaID     int32       `json:"areaid"`      //用户站点
	ChannelID  int32       `json:"channelid"`   //短渠道
	DistinctID int64       `json:"distinct_id"` //用户ID
	SavedField interface{} `json:"save_field"`  //根据事件自定义数据类型
	UserLCID   string      `json:"userlcid"`    //用户长渠道号
	Properties interface{} `json:"properties"`  //根据事件自定义数据类型
}

mq消息

type C2S_TaskReward

type C2S_TaskReward struct {
}

领取任务奖励请求

type C2S_UserIntervalAdReq

type C2S_UserIntervalAdReq struct {
	Res  int8 `json:"res"`
	Type int8 `json:"type"` //看完广告通知类型 1:游戏间隔N局看广告请求 2:天降红包领取 3:下局包赔
}

通用广告看完请求

type ClientUserRes

type ClientUserRes struct {
	UserID       int64
	ErrCode      int32
	Account      string //用户账号
	Token        string
	AcIndex      int32     //用户账号所属机器码的序号
	AcType       int16     //账号类型
	AppID        string    //对外产品ID
	SID          int32     //对内产品ID
	IsValid      int8      //账号是否冻结
	NickName     string    //用户昵称
	GameCoin     int64     //积分
	PTicket      int32     //金豆
	AllPTicket   int32     //
	Diamond      int64     //钻石
	RegChan      int32     //注册短渠道
	RegTime      time.Time //注册时间
	RegSID       int32
	Gender       int8   //性别
	HeadID       int32  //系统头像id
	THUrl        string //第三方头像地址
	PhNum        string //绑定手机号
	WxAddr       string //绑定微信地址
	WxAppID      string
	AliAddr      string //绑定支付宝地址
	VipExp       int32  //vip经验
	VipLevel     int32  //
	GameExp      int32  //平台经验
	GameID       int32
	ServerID     string
	ServerLevel  int32
	OpenID       string
	UnionID      string
	PropList     []PropInfo  //道具列表
	NewPlayer    int8        //是否新手玩家
	ExtInfo      interface{} //扩展信息
	IfGameServer bool        //true 游戏服,false非游戏服
	MJBHongBao   int32       //广告版麻将金币
}
type Logingamereq struct {
	Userid            int
	Loginlongchannel  string
	Loginshortchannel int
	Logindeviceid     string
	Logindevicetype   int    //1:PC 2:安卓 3:IOS
	Loginsiteid       int    //登陆站点
	Loginfrom         string //登陆来源
	Logintoken        string //登陆token
}

type ConfDogRequest

type ConfDogRequest struct {
	NodeName string //服务名
	NodeID   string //服务节点
	ConfKeys []string
}

ConfDogRequest 配置门户请求

type ConfDogResponse

type ConfDogResponse struct {
	Action string
	Key    string
	Value  string
}

ConfDogResponse 配置门户返回

type EnterScenceReq

type EnterScenceReq struct {
	Account     string //账号
	Passwd      string //密码
	Token       string //token
	UserID      int64  //用户ID
	ProdName    string //产品名
	AppID       string //产品ID
	MacID       string //机器码
	OsType      int8   //1:pc 2:Android 3:IOS
	LoginIP     string //登录IP
	OpenID      string //第三方OpenID
	UnionID     string //第三方UnionID
	LoginMethod int8   //第三方登录方式 1,2,3……
	ChannelID   int32  //短渠道号
	LongChannel string //长渠道号
	BigVer      string //大版本号
	SmallVer    string //小版本号
	Gender      int8
	Platform    string
	Imei        string //通讯设备码原值
	Idfa        string //ios广告标识位
	Oaid        string //oaid原值
	AndroidID   string //安卓设置ID原值
	NatrualMac  string //机器码原值
	UserSource  string //用户来源,例如同1个渠道不同的位置
	Province    string
	City        string
	SDKAcType   int8 //1:游客 2:正式账号
}

EnterScenceReq 进入业务服,各业务可自由筛选字段但结构名不能变

type EnterScenceRes

type EnterScenceRes struct {
	ConnAddr string
}

AskConnReq 反馈合适连接服务器

type GameAwardInfo

type GameAwardInfo struct {
	ComID  int32 //数据来源模块
	TaskID int32 //任务ID
}

GameAwardInfo 业务发奖附加信息

type GameFlagNotice

type GameFlagNotice struct {
	IsClosed bool
}

type GameRegistReq

type GameRegistReq struct {
	GameID   int32
	Addr     string
	NodeID   string //服务器节点描述
	NodeName string //服务器类型 例如:"login", "xzmj"
	IsGray   int8   //是否灰度
}

type GameRegistRes

type GameRegistRes struct {
	HashCode []uint32
}

type GameUserSafeCtrl

type GameUserSafeCtrl struct {
	UserID     int64     `gorm:"primary_key:true" json:"user_id"`
	OpenLobby  int8      `json:"open_lobby"` //开启大厅
	UpdateTime time.Time `json:"update_time"`
}

GameUserSafeCtrl 用户风控属性

func (GameUserSafeCtrl) TableName

func (a GameUserSafeCtrl) TableName() string

type HandUpNotice

type HandUpNotice struct {
	Tableid int32
	Chairid int32
}

type HandUpReq

type HandUpReq struct {
	Handup int8
}

type HandUpRes

type HandUpRes struct {
	Errcode int32
}

type KickOutRes

type KickOutRes struct {
	Errcode int32
	Errmsg  string
}

type LeaveSceneReq

type LeaveSceneReq struct {
	UserID int64 //用户ID
}

LeaveSceneReq 进入业务服

type LeaveSceneRes

type LeaveSceneRes struct {
	Route string //用户ID
}

type LetPlayerOffline

type LetPlayerOffline struct {
	Route string //
}

LetPlayerOffline 让用户下线,退出app

type LoginAgainRes

type LoginAgainRes struct {
	UserID       int64
	ErrCode      int32
	Account      string //用户账号
	Token        string
	AcIndex      int32     //用户账号所属机器码的序号
	AcType       int16     //账号类型
	AppID        string    //对外产品ID
	SID          int32     //对内产品ID
	IsValid      int8      //账号是否冻结
	NickName     string    //用户昵称
	GameCoin     int64     //积分
	PTicket      int32     //金豆
	AllPTicket   int32     //
	Diamond      int64     //钻石
	RegChan      int32     //注册短渠道
	RegTime      time.Time //注册时间
	RegSID       int32
	Gender       int8   //性别
	HeadID       int32  //系统头像id
	THUrl        string //第三方头像地址
	OpenID       string
	UnionID      string
	WxAddr       string
	WxAppID      string
	AliAddr      string
	PhNum        string //绑定手机号
	VipExp       int32  //vip经验
	GameExp      int32  //平台经验
	GameID       int32
	ServerID     string
	ServerLevel  int32
	PropList     []PropInfo //道具列表
	Tableplayers []TablePlayer
	MJBHongBao   int32 //广告版金币
	ExtInfo      interface{}
}

type LoginLobbyNotice

type LoginLobbyNotice struct {
	UserID     int64
	ServerName string
	ServerID   string
}

LoginLobbyNotice 用户登录大厅通知

type LoginRes

type LoginRes struct {
	Userid       int64
	Errcode      int32
	Account      string //用户账号
	Token        string
	AcIndex      int32  //用户账号所属机器码的序号
	AcType       int16  //账号类型
	AppID        string //长渠道号
	BranchID     string //产品线ID
	SiteID       int32  //对内产品ID
	IsValid      int8   //账号是否冻结
	NickName     string //用户昵称
	GameCoin     int64  //积分
	BankCoin     int64  //
	GoldBean     int32  //金豆
	AllGoldBean  int32  //
	Diamond      int64
	MJBHongBao   int32     //麻将币红包 propid 1001,广告版麻将使用
	RegChan      int32     //注册短渠道
	RegTime      time.Time //注册时间
	RegProvince  string    //注册省份
	RegCity      string    //注册城市
	RegIP        string    //注册IP
	RegSiteID    int32     //注册站点
	Gender       int8      //性别
	HeadID       int32     //系统头像id
	ThirdHeadUrl string    //第三方头像地址
	ThirdAppID   string    //第三方AppID
	AcIsVisit    bool      //账号是否游客状态
	OpenID       string    //第三方OPENID
	UnionID      string    //第三方unionid
	Phonebinded  string    //绑定手机号
	WxAddr       string    //绑定微信地址
	WxAppID      string    //绑定的微信APPID
	AliAddr      string    //绑定支付宝地址
	IsBuyB       bool      //是否已经首充过B,首充B之后,有几次强胡机会
	//平台属性
	VipExp             int32 //vip经验
	VipLevel           int32 //vip等级
	AllGameExp         int32 //
	PlatPlayTime       int32 //
	PlatOnlineTime     int32 //
	PlatPlayCoin       int64 //
	PlatPrizeTicket    int32 //平台总获得奖券
	PlatRechargeTimes  int32
	PlatRechargeMoney  int32  //分为单位
	PlatTax            uint64 //
	PlatGameWinTimes   int32  //平台赢局
	PlatGameLoseTimes  int32  //平台输局
	GameBWinTimes      int32  //刺激场赢局
	GameBLoseTimes     int32  //刺激场输局
	PlatRedPacketTimes int32  //平台拆红包
	PlatQHPlayTimes    int32  //首充之后强胡的次数

	//每日平台属性
	PlatDayPlayTime      int32 // 每日玩的时间
	PlatDayOnlineTime    int32 //
	PlatDayPlayCoin      int64 //
	PlatDayPrizeTicket   int32 //平台总获得奖券
	PlatDayRechargeTimes int32
	PlatDayRechargeMoney int32  //分为单位
	PlatDayTax           uint64 //
	PlatHelpTimes        int32  //领取救济金次数
	PlatDayPlayTimes     int32  //每日玩的次数
	PlatDayTaskID        int32  //每日任务ID,可变动
	PlatDayTaskProgress  int32  //每日任务进度
	PlatDayTaskTime      time.Time
	PlatDayUpdateTime    int64

	//游戏属性
	GameExp           int32  //
	GameWinTimes      int32  //
	GameLoseTimes     int32  //
	GameWinStkTimes   int32  //连赢次数
	GameLoseStkTimes  int32  //连输次数
	GameWinmStkTimes  int32  //最大连赢
	GameLosemStkTimes int32  //最大连输
	GamePlayTime      int32  //
	GameOnlineTime    int32  //
	GameCoinPlay      int64  //
	GameCoinWin       int64  //
	GameCoinLose      int64  //
	OtherGameID       int32  //
	OtherRoomID       string //
	OtherRoomLevel    int32
	GameStatus        int8
	Proplist          []PropInfo //道具列表
	RedPacketTimes    int32      //拆红包数量
	GameExtStr        string     //游戏扩展属性
	//风控属性
	SafeCtrl GameUserSafeCtrl
}

type MQWriteReq

type MQWriteReq struct {
	Tags      string //mq所属tag
	MqContent string //mq内容 BulletinNotice的json字符串
}

type MqFromConSumer

type MqFromConSumer struct {
	Event       string
	Idevent     int
	Gameid      int
	Levelgame   int
	Roomid      int
	Areaid      int
	Channelid   int
	Distinc_id  int
	Userlcid    string
	Saved_field interface{}
	Properties  interface{}
}

MqFromConSumer MQ消费数据

type PropInfo

type PropInfo struct {
	Propid   int32 `json:"prop_id"`
	Proptype int32 `json:"prop_type"`
	Propnum  int32 `json:"prop_count"`
	Proptime int64 `json:"prop_time"`
	Minnum   int32 `json:"min_num"`
	Maxnum   int32 `json:"max_num"`
}

type RechargeInfo

type RechargeInfo struct {
	ErrMessage string `json:"errmessage"`
	GiftID     int32  `json:"giftid"` //礼包ID
	Money      int32  `json:"money"`
	OrderID    string `json:"orderid"` //订单号
	ExtField   string `json:"ext"`     //自定义字段
}

RechargeInfo 充值相关信息

type RequestData

type RequestData struct {
	Route    string
	ReqID    uint64
	Protocol string //通信协议:json(默认),protobuf
	ReqData  interface{}
}

type ResponseData

type ResponseData struct {
	Code    int32
	Message string
	RspID   uint64
	RspName string
	RspData interface{}
}

type RewardData

type RewardData struct {
	PropId   int32
	Count    int32
	Time     int64
	SourceId int32
}

type RobotMessage

type RobotMessage struct {
	Route  string
	UserID int64
	ReqMsg interface{}
}

type RouteMsg

type RouteMsg struct {
	Route string
	Msg   string
}

type S2C_GameGuide

type S2C_GameGuide struct {
	GuideGameID int32 //引导的游戏id
	GameRound   int32 //本游戏还省多少局能引导游戏
}

主动推送引导

type S2C_TaskInfo

type S2C_TaskInfo struct {
	TaskTotalNum int32  //活动总局数
	TaskProgress int32  //活动进度
	TaskReward   int32  //活动奖励
	RewardDesc   string //奖励描述
	IfTaskOver   bool   //活动完成
}

主动推送任务

type S2C_TaskReward

type S2C_TaskReward struct {
	TaskID     int32 //任务ID
	NextTaskID int32 //下一个任务ID
	RewardID   int32 //奖励ID
	TaskReward int32 //任务奖励数量
}

领取任务奖励返回

type ShareInfo

type ShareInfo struct {
	ShareID int32 `json:"shareid"`
}

type ShareInfoExt

type ShareInfoExt struct {
	StartTime int64  `json:"starttime"` //时间戳
	LifeTime  int32  `json:"lifetime"`
	HeadUrl   string `json:"headurl"`
	NickName  string `json:"nickname"`
}

{"starttime":1588919443,"lifetime":45454,"headurl":"http://tggg.jpg","nickname":"ggg"}

type ShareReq

type ShareReq struct {
	ShareID   int32 //分享ID
	StartTime int64 //时间戳
	LifeTime  int32 //
	HeadUrl   string
	NickName  string
}

{"starttime":1588919443,"lifetime":45454,"headurl":"http://tggg.jpg","nickname":"ggg"}

type SitDownReq

type SitDownReq struct {
	Levelid int32 //桌子等级
	Tableid int32 //
	Chairid int32 //
}

type SitDownRes

type SitDownRes struct {
	Errcode int32 //错误码
	Tableid int32 //桌子号
	Chairid int32 //椅子号
	Players []TablePlayer
	ExtInfo interface{}
}

type TableJoinPlayer

type TableJoinPlayer struct {
	Player  TablePlayer
	ExtInfo interface{}
}

type TablePlayer

type TablePlayer struct {
	Userid            int64 //
	Siteid            int32
	Nickname          string //
	Gamecoin          int64
	Bankcoin          int64
	Goldbean          int32
	Diamond           int64 //钻石
	MJBHongBao        int32 //广告版麻币
	Sysheadid         int32
	Thirdheadurl      string //
	Gender            int8
	Vipexp            int32 //
	Gameexp           int32
	Gamewintimes      int32 //
	Gamelosetimes     int32 //
	Gamewinstktimes   int32
	GameLosestktimes  int32
	Gamewinmstktimes  int32 //最大连胜
	Gamelosemstktimes int32
	Tableid           int32
	Chairid           int32       //
	Gamestatus        int32       //
	PExtInfo          interface{} //玩家信息扩展
}

type TablePlayerLeaveNotice

type TablePlayerLeaveNotice struct {
	Userid  int64 //
	Tableid int32
	Chairid int32 //
}

type TablePlayerLeaveReq

type TablePlayerLeaveReq struct {
	Leavetype int32 //离开类型
}

type TablePlayerLeaveRes

type TablePlayerLeaveRes struct {
	Errcode   int32
	Leavetype int32 //离开类型
}

type UserPropChange

type UserPropChange struct {
	Propid    int32     `json:"prop_id"`
	Proptype  int32     `json:"prop_type"`
	Propnum   int32     `json:"prop_count"`
	Proptime  int64     `json:"prop_time"`
	ActiveID  int32     `json:"active_id"`
	BeginTime time.Time `json:"begin_time"`
	EndTime   time.Time `json:"end_time"`
}

type Useronlinestatus

type Useronlinestatus struct {
	Userid      int64     `gorm:"primary_key:true"`
	Siteid      int32     //
	Gameid      int32     //
	Serverid    string    //
	Collectdate time.Time //
}

type VipRechargeTimesDef

type VipRechargeTimesDef struct {
	ID            int32 //商品ID
	RechargeTimes int32 //商品购买次数
}

type WriteLogReq

type WriteLogReq struct {
	LogTxt string
}

Jump to

Keyboard shortcuts

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