60 lines
2.5 KiB
Go
60 lines
2.5 KiB
Go
package baseroom
|
||
|
||
import (
|
||
"samba/util/model"
|
||
)
|
||
|
||
// 物品
|
||
type Item struct {
|
||
Id int `json:"id"` // 物品id
|
||
Num int64 `json:"num"` // 物品数量
|
||
}
|
||
|
||
type BasePlayerLog struct {
|
||
UId int64 `json:"uid"` // 玩家id
|
||
Seat int `json:"seat"` // 座位号
|
||
TakeCoin int64 `json:"initial_coins"` // 携带金币
|
||
WinCoin int64 `json:"win_coins"` // 输赢金币
|
||
EndCoin int64 `json:"end_coins"` // 结束金币
|
||
Tip int64 `json:"charge"` // 台费
|
||
CostItem []Item `json:"cost_item"` // 消耗物品
|
||
Robot int `json:"robot"` // 机器人标识 0:机器人 1:真人
|
||
RobotTemper int `json:"robot_temper"` // 机器人性格 0:未知 1:稳健 2:激进 3:普通 4:摆烂 5:策略型
|
||
EmoteNum int `json:"emote_num"` // 玩家发送的表情次数
|
||
FreeScore int64 `json:"free_score"` // 免费积分
|
||
InoutScore int64 `json:"inout_score"` // 可提现的免费积分
|
||
MoneyScore int64 `json:"money_score"` // 充值积分
|
||
}
|
||
|
||
// 房间对局写入redis的对局日志
|
||
type BaseGameLog struct {
|
||
RoomId int `json:"room_id"` // 房间id
|
||
RoomType int `json:"room_type"` // 房间类型
|
||
Level int `json:"level"` // 房间等级:低中高级场
|
||
PlayType int `json:"play_type"` // 玩法类型
|
||
Blind int64 `json:"bet"` // 底注
|
||
GameNo string `json:"game_no"` // 本局唯一id 游戏开始之后赋值
|
||
StartTime int64 `json:"start_time"` // 开始时间 游戏开始之后赋值
|
||
EndTime int64 `json:"end_time"` // 结束时间 游戏结束之后赋值
|
||
Players []interface{} `json:"players"` // 玩家数据 游戏结束之后赋值(涉及到输赢金币)
|
||
ClubId int `json:"club_id"` // 当前俱乐部id 0:金币场
|
||
PlatformFee int64 `json:"platform_fee"` // 平台分佣(消耗俱乐部部长身上的俱乐部币) 俱乐部分成之后赋值
|
||
ClubFee int64 `json:"club_fee"` // 俱乐部分佣 俱乐部分成之后赋值
|
||
}
|
||
|
||
// 游戏开始之后赋值
|
||
func (t *BaseGameLog) StartGame(startTime int64, gameNo string) {
|
||
t.StartTime = startTime
|
||
t.GameNo = gameNo
|
||
}
|
||
|
||
func (t *BaseGameLog) EndGame(endTime int64, players []interface{}) {
|
||
t.EndTime = endTime
|
||
t.Players = players
|
||
model.AddRoomGameLog(t.PlayType, t)
|
||
}
|
||
|
||
//func (t *BaseGameLog) Flush() {
|
||
// model.AddRoomGameLog(t.PlayType, t)
|
||
//}
|