Merge branch 'dev_slots' of git.pogorockgames.com:mango-games/server/game into dev_slots
This commit is contained in:
commit
854a124bd0
|
|
@ -0,0 +1,105 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"math/rand"
|
||||||
|
"mongo.games.com/game/protocol/activity"
|
||||||
|
"mongo.games.com/goserver/core/timer"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
|
||||||
|
"mongo.games.com/game/model"
|
||||||
|
"mongo.games.com/game/proto"
|
||||||
|
loginproto "mongo.games.com/game/protocol/login"
|
||||||
|
playerproto "mongo.games.com/game/protocol/player"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// 心跳
|
||||||
|
netlib.Register(int(loginproto.GatePacketID_PACKET_SC_PONG), loginproto.SCPong{}, SCPong)
|
||||||
|
// 登录
|
||||||
|
netlib.Register(int(loginproto.LoginPacketID_PACKET_SC_LOGIN), loginproto.SCLogin{}, SCLogin)
|
||||||
|
// 玩家信息
|
||||||
|
netlib.Register(int(playerproto.PlayerPacketID_PACKET_SC_PLAYERDATA), playerproto.SCPlayerData{}, SCPlayerData)
|
||||||
|
|
||||||
|
netlib.Register(int(activity.PushCoinPacketID_PACKET_SCPushCoinInfo), activity.SCPushCoinInfo{}, SCPrint)
|
||||||
|
}
|
||||||
|
|
||||||
|
func SCPong(s *netlib.Session, packetid int, data interface{}) error {
|
||||||
|
accountID := s.GetAttribute(SessionAttributeClientAccountId)
|
||||||
|
logger.Logger.Tracef("SCPong username:%v %v", accountID, data)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SCLogin(s *netlib.Session, packetid int, data interface{}) error {
|
||||||
|
logger.Logger.Trace("SCLogin ", data)
|
||||||
|
|
||||||
|
msg, ok := data.(*loginproto.SCLogin)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.GetOpRetCode() != loginproto.OpResultCode_OPRC_Sucess {
|
||||||
|
accountID := s.GetAttribute(SessionAttributeClientAccountId)
|
||||||
|
logger.Logger.Error("登录失败 ", accountID)
|
||||||
|
s.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
csPlayerData := &playerproto.CSPlayerData{
|
||||||
|
AccId: msg.GetAccId(),
|
||||||
|
}
|
||||||
|
pp := &model.PlayerParams{
|
||||||
|
Platform: 1,
|
||||||
|
Ip: fmt.Sprintf("%v.%v.%v.%v", 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255)),
|
||||||
|
City: "北京",
|
||||||
|
Logininmodel: "app",
|
||||||
|
}
|
||||||
|
d, err := json.Marshal(pp)
|
||||||
|
if err == nil {
|
||||||
|
csPlayerData.Params = proto.String(string(d))
|
||||||
|
}
|
||||||
|
|
||||||
|
s.Send(int(playerproto.PlayerPacketID_PACKET_CS_PLAYERDATA), csPlayerData)
|
||||||
|
logger.Logger.Info("登录成功 ", msg.GetAccId())
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SCPlayerData(s *netlib.Session, packetid int, data interface{}) error {
|
||||||
|
logger.Logger.Trace("SCPlayerData ", data)
|
||||||
|
msg, ok := data.(*playerproto.SCPlayerData)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if msg.GetOpRetCode() != playerproto.OpResultCode_OPRC_Sucess {
|
||||||
|
accountID := s.GetAttribute(SessionAttributeClientAccountId)
|
||||||
|
logger.Logger.Errorf("获取玩家信息失败 %v", accountID)
|
||||||
|
s.Close()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
s.SetAttribute(SessionAttributeUser, msg)
|
||||||
|
|
||||||
|
StartSessionPingTimer(s, timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool {
|
||||||
|
if !s.IsConned() {
|
||||||
|
StopSessionPingTimer(s)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
pack := &loginproto.CSPing{}
|
||||||
|
s.Send(int(loginproto.GatePacketID_PACKET_CS_PING), pack)
|
||||||
|
return true
|
||||||
|
}), nil, time.Second*time.Duration(60+rand.Int31n(100)), -1)
|
||||||
|
|
||||||
|
s.Send(int(activity.PushCoinPacketID_PACKET_CSPushCoinInfo), &activity.CSPushCoinInfo{})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func SCPrint(s *netlib.Session, packetid int, data interface{}) error {
|
||||||
|
logger.Logger.Info("SCPrint ", data)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
var Config = &Configuration{}
|
||||||
|
|
||||||
|
type Configuration struct {
|
||||||
|
Count int // 机器人总数
|
||||||
|
AppId string // appID
|
||||||
|
Connects netlib.SessionConfig // 网络连接配置
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Configuration) Name() string {
|
||||||
|
return "benchmark"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Configuration) Init() error {
|
||||||
|
logger.Logger.Tracef("%+v", *this)
|
||||||
|
if this.Count == 0 {
|
||||||
|
this.Count = 20
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Configuration) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
core.RegistePackage(Config)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
netlib:
|
||||||
|
SrvInfo:
|
||||||
|
Name: BenchmarkServer
|
||||||
|
Type: 9
|
||||||
|
Id: 902
|
||||||
|
AreaID: 1
|
||||||
|
Banner:
|
||||||
|
- =================
|
||||||
|
- benchmark server
|
||||||
|
- =================
|
||||||
|
IoServices: []
|
||||||
|
module:
|
||||||
|
Options:
|
||||||
|
QueueBacklog: 1024
|
||||||
|
MaxDone: 1024
|
||||||
|
Interval: 100
|
||||||
|
executor:
|
||||||
|
Options:
|
||||||
|
QueueBacklog: 1024
|
||||||
|
MaxDone: 1024
|
||||||
|
Interval: 0
|
||||||
|
Worker:
|
||||||
|
WorkerCnt: 8
|
||||||
|
Options:
|
||||||
|
QueueBacklog: 1024
|
||||||
|
MaxDone: 1024
|
||||||
|
Interval: 0
|
||||||
|
timer:
|
||||||
|
Options:
|
||||||
|
QueueBacklog: 1024
|
||||||
|
MaxDone: 1024
|
||||||
|
Interval: 100
|
||||||
|
signal:
|
||||||
|
SupportSignal: true
|
||||||
|
cmdline:
|
||||||
|
SupportCmdline: true
|
||||||
|
benchmark:
|
||||||
|
Count: 1
|
||||||
|
AppId: 5c56d1644966f078bfb90c71
|
||||||
|
Connects:
|
||||||
|
Id: 402
|
||||||
|
Type: 4
|
||||||
|
AreaId: 1
|
||||||
|
Name: ClientService
|
||||||
|
Ip: 127.0.0.1
|
||||||
|
Port: 11001
|
||||||
|
Protocol: tcp
|
||||||
|
Path: /
|
||||||
|
MaxDone: 200
|
||||||
|
MaxPend: 200
|
||||||
|
MaxPacket: 65535
|
||||||
|
MaxConn: 2000
|
||||||
|
RcvBuff: 4096
|
||||||
|
SndBuff: 4096
|
||||||
|
WriteTimeout: 3600
|
||||||
|
ReadTimeout: 3600
|
||||||
|
SoLinger: 10
|
||||||
|
IsInnerLink: true
|
||||||
|
NoDelay: true
|
||||||
|
SupportFragment: true
|
||||||
|
AuthKey: www.jxjy.games.cn
|
||||||
|
IsClient: true
|
||||||
|
AllowMultiConn: true
|
||||||
|
FilterChain:
|
||||||
|
- session-filter-auth
|
||||||
|
HandlerChain:
|
||||||
|
- handler-gate-session
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/module"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// RobotSessionStartId 机器人session开始id
|
||||||
|
RobotSessionStartId = 100000000
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
BenchMarkModule = &BenchMark{}
|
||||||
|
WaitConnectSessions []*netlib.SessionConfig
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewSession 新建session
|
||||||
|
// id 连接id, 默认自动分配
|
||||||
|
func NewSession(id ...int) {
|
||||||
|
cfg := Config.Connects
|
||||||
|
if len(id) > 0 && id[0] > 0 {
|
||||||
|
cfg.Id = id[0]
|
||||||
|
} else {
|
||||||
|
BenchMarkModule.idx++
|
||||||
|
cfg.Id = BenchMarkModule.idx
|
||||||
|
}
|
||||||
|
cfg.Init()
|
||||||
|
logger.Logger.Info("waite connect session id=", cfg.Id)
|
||||||
|
WaitConnectSessions = append(WaitConnectSessions, &cfg)
|
||||||
|
}
|
||||||
|
|
||||||
|
type BenchMark struct {
|
||||||
|
idx int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BenchMark) ModuleName() string {
|
||||||
|
return "benchmark-module"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BenchMark) Init() {
|
||||||
|
m.idx = RobotSessionStartId
|
||||||
|
for i := 0; i < Config.Count; i++ {
|
||||||
|
NewSession()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update 机器开始连接游戏服务器
|
||||||
|
func (m *BenchMark) Update() {
|
||||||
|
n := len(WaitConnectSessions)
|
||||||
|
if n > 0 {
|
||||||
|
config := WaitConnectSessions[n-1]
|
||||||
|
WaitConnectSessions = WaitConnectSessions[:n-1]
|
||||||
|
if err := netlib.Connect(config); err != nil {
|
||||||
|
logger.Logger.Error("netlib.Connect error", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *BenchMark) Shutdown() {
|
||||||
|
module.UnregisteModule(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
module.RegisteModule(BenchMarkModule, time.Millisecond, 1)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"mongo.games.com/goserver/core/timer"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
SessionAttributeClientAccountId int = iota // 账号
|
||||||
|
SessionAttributeUser
|
||||||
|
SessionAttributePingTimer
|
||||||
|
)
|
||||||
|
|
||||||
|
func StartSessionPingTimer(s *netlib.Session, act timer.TimerAction, ud interface{}, interval time.Duration, times int) bool {
|
||||||
|
StopSessionPingTimer(s)
|
||||||
|
if hTimer, ok := timer.StartTimer(act, ud, interval, times); ok {
|
||||||
|
s.SetAttribute(SessionAttributePingTimer, hTimer)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func StopSessionPingTimer(s *netlib.Session) {
|
||||||
|
if h, ok := s.GetAttribute(SessionAttributePingTimer).(timer.TimerHandle); ok {
|
||||||
|
if h != timer.TimerHandle(0) {
|
||||||
|
timer.StopTimer(h)
|
||||||
|
s.RemoveAttribute(SessionAttributePingTimer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/md5"
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"math/rand"
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/model"
|
||||||
|
loginproto "mongo.games.com/game/protocol/login"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
"strconv"
|
||||||
|
"sync/atomic"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
添加到客户端管理器,管理器负责登录
|
||||||
|
当连接断开时,从管理器中移除,判断是否需要重连
|
||||||
|
*/
|
||||||
|
|
||||||
|
const (
|
||||||
|
GateSessionHandlerName = "handler-gate-session"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GateSessionHandler struct {
|
||||||
|
netlib.BasicSessionHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GateSessionHandler) GetName() string {
|
||||||
|
return GateSessionHandlerName
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GateSessionHandler) GetInterestOps() uint {
|
||||||
|
return 1<<netlib.InterestOps_Opened |
|
||||||
|
1<<netlib.InterestOps_Closed
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GateSessionHandler) OnSessionOpened(s *netlib.Session) {
|
||||||
|
// 登录账号
|
||||||
|
StartLogin(s)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (g *GateSessionHandler) OnSessionClosed(s *netlib.Session) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
netlib.RegisteSessionHandlerCreator(GateSessionHandlerName, func() netlib.SessionHandler {
|
||||||
|
return &GateSessionHandler{}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var UserNameIndex int64
|
||||||
|
|
||||||
|
func StartLogin(s *netlib.Session) {
|
||||||
|
ts := time.Now().UnixNano()
|
||||||
|
username := fmt.Sprintf("benchmark-%v", atomic.AddInt64(&UserNameIndex, 1))
|
||||||
|
s.SetAttribute(SessionAttributeClientAccountId, username)
|
||||||
|
csLogin := &loginproto.CSLogin{
|
||||||
|
Username: username,
|
||||||
|
TimeStamp: ts,
|
||||||
|
Platform: "1",
|
||||||
|
Channel: "",
|
||||||
|
PlatformTag: "test.win88.yy_android",
|
||||||
|
}
|
||||||
|
|
||||||
|
params := &model.PlayerParams{
|
||||||
|
Ip: fmt.Sprintf("%v.%v.%v.%v", 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255)),
|
||||||
|
City: "北京",
|
||||||
|
Platform: 1,
|
||||||
|
Logininmodel: "app",
|
||||||
|
}
|
||||||
|
data, err := json.Marshal(params)
|
||||||
|
if err == nil {
|
||||||
|
csLogin.Params = string(data[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
h := md5.New()
|
||||||
|
io.WriteString(h, fmt.Sprintf("%v%v", username, Config.AppId))
|
||||||
|
pwd := hex.EncodeToString(h.Sum(nil))
|
||||||
|
h.Reset()
|
||||||
|
io.WriteString(h, fmt.Sprintf("%v%v%v", pwd, Config.AppId, ts))
|
||||||
|
pwd = hex.EncodeToString(h.Sum(nil))
|
||||||
|
csLogin.Password = pwd
|
||||||
|
|
||||||
|
csLogin.LoginType = 0
|
||||||
|
csLogin.Sign = common.MakeMd5String(csLogin.GetUsername(), csLogin.GetPassword(),
|
||||||
|
strconv.Itoa(int(csLogin.GetTimeStamp())), csLogin.GetParams(), Config.AppId)
|
||||||
|
|
||||||
|
s.Send(int(loginproto.LoginPacketID_PACKET_CS_LOGIN), csLogin)
|
||||||
|
logger.Logger.Infof("账号 [%v] 开始登录", username)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<seelog type="adaptive" mininterval="2000000" maxinterval="100000000" critmsgcount="500" minlevel="trace">
|
||||||
|
<exceptions>
|
||||||
|
<exception filepattern="test*" minlevel="error"/>
|
||||||
|
</exceptions>
|
||||||
|
<outputs formatid="all">
|
||||||
|
<rollingfile formatid="all" type="size" filename="./all.log" maxsize="50000000" maxrolls="5" />
|
||||||
|
<filter levels="info,trace,warn,error">
|
||||||
|
<console formatid="fmtinfo"/>
|
||||||
|
</filter>
|
||||||
|
<filter levels="error,critical" formatid="fmterror">
|
||||||
|
<console/>
|
||||||
|
<file path="errors.log"/>
|
||||||
|
</filter>
|
||||||
|
</outputs>
|
||||||
|
<formats>
|
||||||
|
<format id="fmtinfo" format="[%Date][%Time] [%Level] %Msg%n"/>
|
||||||
|
<format id="fmterror" format="[%Date][%Time] [%LEVEL] [%FuncShort @ %File.%Line] %Msg%n"/>
|
||||||
|
<format id="all" format="[%Date][%Time] [%Level] [@ %File.%Line] %Msg%n"/>
|
||||||
|
<format id="criticalemail" format="Critical error on our server!\n %Time %Date %RelFile %Func %Msg \nSent by Seelog"/>
|
||||||
|
</formats>
|
||||||
|
</seelog>
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
_ "mongo.games.com/game"
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/module"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
defer core.ClosePackages()
|
||||||
|
core.LoadPackages("config.yaml")
|
||||||
|
// core hook
|
||||||
|
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
core.RegisteHook(core.HOOK_AFTER_STOP, func() error {
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
// module模块
|
||||||
|
waiter := module.Start()
|
||||||
|
waiter.Wait("main()")
|
||||||
|
}
|
||||||
|
|
@ -122,9 +122,9 @@ func (this *ClockMgr) Update() {
|
||||||
this.LastDay = day
|
this.LastDay = day
|
||||||
this.fireDayEvent()
|
this.fireDayEvent()
|
||||||
|
|
||||||
week := GetWeekStartTs(tNow.Unix())
|
_, week := tNow.ISOWeek()
|
||||||
if week != int64(this.LastWeek) {
|
if week != this.LastWeek {
|
||||||
this.LastWeek = int(week)
|
this.LastWeek = week
|
||||||
this.fireWeekEvent()
|
this.fireWeekEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ const (
|
||||||
GameId_AngerUncle = 606 // 愤怒大叔
|
GameId_AngerUncle = 606 // 愤怒大叔
|
||||||
GameId_SmallRoket = 607 // 小火箭
|
GameId_SmallRoket = 607 // 小火箭
|
||||||
GameId_Clawdoll = 608 // 娃娃机
|
GameId_Clawdoll = 608 // 娃娃机
|
||||||
|
GameId_PushCoin = 609 // 推币机
|
||||||
__GameId_ThrGame_Min__ = 700 //################三方类################
|
__GameId_ThrGame_Min__ = 700 //################三方类################
|
||||||
GameId_Thr_Dg = 701 //DG Game
|
GameId_Thr_Dg = 701 //DG Game
|
||||||
GameId_Thr_XHJ = 901 ///DG Game
|
GameId_Thr_XHJ = 901 ///DG Game
|
||||||
|
|
@ -118,6 +119,7 @@ const (
|
||||||
GameDifFruits = "306" // 水果机
|
GameDifFruits = "306" // 水果机
|
||||||
GameDifRichblessed = "307" // 多彩多福
|
GameDifRichblessed = "307" // 多彩多福
|
||||||
GameDifClawdoll = "608" // 娃娃机
|
GameDifClawdoll = "608" // 娃娃机
|
||||||
|
GameDifPushCoin = "609" // 推币机
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsTienLenYuLe TienLen娱乐
|
// IsTienLenYuLe TienLen娱乐
|
||||||
|
|
@ -343,6 +345,10 @@ const (
|
||||||
GainWayNianGain_EveryDayTask = 132 //年兽活动每日任务
|
GainWayNianGain_EveryDayTask = 132 //年兽活动每日任务
|
||||||
GainWayNianGain_Task = 133 //年兽活动任务
|
GainWayNianGain_Task = 133 //年兽活动任务
|
||||||
GainWayConsume = 134 //累消活动获得
|
GainWayConsume = 134 //累消活动获得
|
||||||
|
GainWayPushCoinExchangeCost = 135 // 推币机兑换消耗
|
||||||
|
GainWatPushCoinExchangeGain = 136 // 推币机兑换获得
|
||||||
|
GainWayPushCoinGain = 137 // 推币机掉落获得
|
||||||
|
GainWayPushCoinCost = 138 // 推币机消耗
|
||||||
)
|
)
|
||||||
|
|
||||||
// 后台选择 金币变化类型 的充值 类型id号起始
|
// 后台选择 金币变化类型 的充值 类型id号起始
|
||||||
|
|
@ -598,6 +604,12 @@ const (
|
||||||
ItemIDRoomCard = 40002 // 房卡
|
ItemIDRoomCard = 40002 // 房卡
|
||||||
ItemIDLittleGuaranteed = 50014 //小爆竹
|
ItemIDLittleGuaranteed = 50014 //小爆竹
|
||||||
ItemIDBigGuaranteed = 50015 //大爆竹
|
ItemIDBigGuaranteed = 50015 //大爆竹
|
||||||
|
ItemIDPlum = 50016 //梅花(推币机)
|
||||||
|
ItemIDBigCoin = 50017 //大金币
|
||||||
|
ItemIDCoin1 = 50018 //金币1
|
||||||
|
ItemIDCoin2 = 50019 //金币2
|
||||||
|
ItemIDCoin3 = 50020 //金币3
|
||||||
|
ItemIDShake = 50021 //震动效果
|
||||||
)
|
)
|
||||||
|
|
||||||
func ToItemId(id int32) int32 {
|
func ToItemId(id int32) int32 {
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,12 @@ func InSameWeek(tNow, tPre time.Time) bool {
|
||||||
if tPre.IsZero() {
|
if tPre.IsZero() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
y1, w1 := tNow.ISOWeek()
|
||||||
if GetWeekStartTs(tNow.Unix()) == GetWeekStartTs(tPre.Unix()) {
|
y2, w2 := tPre.ISOWeek()
|
||||||
|
if y1 != y2 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if w1 == w2 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ type RedPacketColumns struct {
|
||||||
|
|
||||||
var redPacketColumns = &RedPacketColumns{
|
var redPacketColumns = &RedPacketColumns{
|
||||||
ID: "_id",
|
ID: "_id",
|
||||||
Cid: "Cid", // 红包活动id
|
Cid: "cid", // 红包活动id
|
||||||
Use: "Use", // 已发红包 红包奖励数量:已发个数
|
Use: "use", // 已发红包 红包奖励数量:已发个数
|
||||||
Ts: "Ts", // 更新时间戳
|
Ts: "ts", // 更新时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewRedPacket() *RedPacket {
|
func NewRedPacket() *RedPacket {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,283 @@
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
// The following code is automatically generated by the mongo-dao-generator tool.
|
||||||
|
// Please do not modify this code manually to avoid being overwritten in the next generation.
|
||||||
|
// For more tool details, please click the link to view https://github.com/dobyte/mongo-dao-generator
|
||||||
|
// --------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
package internal
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
|
modelpkg "mongo.games.com/game/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
type RedPacketHistoryFilterFunc func(cols *RedPacketHistoryColumns) interface{}
|
||||||
|
type RedPacketHistoryUpdateFunc func(cols *RedPacketHistoryColumns) interface{}
|
||||||
|
type RedPacketHistoryPipelineFunc func(cols *RedPacketHistoryColumns) interface{}
|
||||||
|
type RedPacketHistoryCountOptionsFunc func(cols *RedPacketHistoryColumns) *options.CountOptions
|
||||||
|
type RedPacketHistoryAggregateOptionsFunc func(cols *RedPacketHistoryColumns) *options.AggregateOptions
|
||||||
|
type RedPacketHistoryFindOneOptionsFunc func(cols *RedPacketHistoryColumns) *options.FindOneOptions
|
||||||
|
type RedPacketHistoryFindManyOptionsFunc func(cols *RedPacketHistoryColumns) *options.FindOptions
|
||||||
|
type RedPacketHistoryUpdateOptionsFunc func(cols *RedPacketHistoryColumns) *options.UpdateOptions
|
||||||
|
type RedPacketHistoryDeleteOptionsFunc func(cols *RedPacketHistoryColumns) *options.DeleteOptions
|
||||||
|
type RedPacketHistoryInsertOneOptionsFunc func(cols *RedPacketHistoryColumns) *options.InsertOneOptions
|
||||||
|
type RedPacketHistoryInsertManyOptionsFunc func(cols *RedPacketHistoryColumns) *options.InsertManyOptions
|
||||||
|
|
||||||
|
type RedPacketHistory struct {
|
||||||
|
Columns *RedPacketHistoryColumns
|
||||||
|
Database *mongo.Database
|
||||||
|
Collection *mongo.Collection
|
||||||
|
}
|
||||||
|
|
||||||
|
type RedPacketHistoryColumns struct {
|
||||||
|
Platform string // 平台
|
||||||
|
ID string
|
||||||
|
Cid string // 红包活动id
|
||||||
|
Snid string // 玩家id
|
||||||
|
Ts string // 时间戳
|
||||||
|
ItemId string // 道具id
|
||||||
|
ItemNum string // 道具数量
|
||||||
|
}
|
||||||
|
|
||||||
|
var redPacketHistoryColumns = &RedPacketHistoryColumns{
|
||||||
|
Platform: "-", // 平台
|
||||||
|
ID: "_id",
|
||||||
|
Cid: "cid", // 红包活动id
|
||||||
|
Snid: "snid", // 玩家id
|
||||||
|
Ts: "ts", // 时间戳
|
||||||
|
ItemId: "itemid", // 道具id
|
||||||
|
ItemNum: "itemnum",// 道具数量
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRedPacketHistory() *RedPacketHistory {
|
||||||
|
return &RedPacketHistory{
|
||||||
|
Columns: redPacketHistoryColumns,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count returns the number of documents in the collection.
|
||||||
|
func (dao *RedPacketHistory) Count(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryCountOptionsFunc) (int64, error) {
|
||||||
|
var (
|
||||||
|
opts *options.CountOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.CountDocuments(ctx, filter, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Aggregate executes an aggregate command against the collection and returns a cursor over the resulting documents.
|
||||||
|
func (dao *RedPacketHistory) Aggregate(ctx context.Context, pipelineFunc RedPacketHistoryPipelineFunc, optionsFunc ...RedPacketHistoryAggregateOptionsFunc) (*mongo.Cursor, error) {
|
||||||
|
var (
|
||||||
|
opts *options.AggregateOptions
|
||||||
|
pipeline = pipelineFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.Aggregate(ctx, pipeline, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertOne executes an insert command to insert a single document into the collection.
|
||||||
|
func (dao *RedPacketHistory) InsertOne(ctx context.Context, model *modelpkg.RedPacketHistory, optionsFunc ...RedPacketHistoryInsertOneOptionsFunc) (*mongo.InsertOneResult, error) {
|
||||||
|
if model == nil {
|
||||||
|
return nil, errors.New("model is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := dao.autofill(ctx, model); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var opts *options.InsertOneOptions
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.InsertOne(ctx, model, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// InsertMany executes an insert command to insert multiple documents into the collection.
|
||||||
|
func (dao *RedPacketHistory) InsertMany(ctx context.Context, models []*modelpkg.RedPacketHistory, optionsFunc ...RedPacketHistoryInsertManyOptionsFunc) (*mongo.InsertManyResult, error) {
|
||||||
|
if len(models) == 0 {
|
||||||
|
return nil, errors.New("models is empty")
|
||||||
|
}
|
||||||
|
|
||||||
|
documents := make([]interface{}, 0, len(models))
|
||||||
|
for i := range models {
|
||||||
|
model := models[i]
|
||||||
|
if err := dao.autofill(ctx, model); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
documents = append(documents, model)
|
||||||
|
}
|
||||||
|
|
||||||
|
var opts *options.InsertManyOptions
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.InsertMany(ctx, documents, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateOne executes an update command to update at most one document in the collection.
|
||||||
|
func (dao *RedPacketHistory) UpdateOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||||
|
var (
|
||||||
|
opts *options.UpdateOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
update = updateFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.UpdateOne(ctx, filter, update, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateOneByID executes an update command to update at most one document in the collection.
|
||||||
|
func (dao *RedPacketHistory) UpdateOneByID(ctx context.Context, id string, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||||
|
objectID, err := primitive.ObjectIDFromHex(id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.UpdateOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
|
||||||
|
return bson.M{"_id": objectID}
|
||||||
|
}, updateFunc, optionsFunc...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateMany executes an update command to update documents in the collection.
|
||||||
|
func (dao *RedPacketHistory) UpdateMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, updateFunc RedPacketHistoryUpdateFunc, optionsFunc ...RedPacketHistoryUpdateOptionsFunc) (*mongo.UpdateResult, error) {
|
||||||
|
var (
|
||||||
|
opts *options.UpdateOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
update = updateFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.UpdateMany(ctx, filter, update, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindOne executes a find command and returns a model for one document in the collection.
|
||||||
|
func (dao *RedPacketHistory) FindOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryFindOneOptionsFunc) (*modelpkg.RedPacketHistory, error) {
|
||||||
|
var (
|
||||||
|
opts *options.FindOneOptions
|
||||||
|
model = &modelpkg.RedPacketHistory{}
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
err := dao.Collection.FindOne(ctx, filter, opts).Decode(model)
|
||||||
|
if err != nil {
|
||||||
|
if err == mongo.ErrNoDocuments {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return model, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindOneByID executes a find command and returns a model for one document in the collection.
|
||||||
|
func (dao *RedPacketHistory) FindOneByID(ctx context.Context, id string, optionsFunc ...RedPacketHistoryFindOneOptionsFunc) (*modelpkg.RedPacketHistory, error) {
|
||||||
|
objectID, err := primitive.ObjectIDFromHex(id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.FindOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
|
||||||
|
return bson.M{"_id": objectID}
|
||||||
|
}, optionsFunc...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FindMany executes a find command and returns many models the matching documents in the collection.
|
||||||
|
func (dao *RedPacketHistory) FindMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryFindManyOptionsFunc) ([]*modelpkg.RedPacketHistory, error) {
|
||||||
|
var (
|
||||||
|
opts *options.FindOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
cur, err := dao.Collection.Find(ctx, filter, opts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
models := make([]*modelpkg.RedPacketHistory, 0)
|
||||||
|
|
||||||
|
if err = cur.All(ctx, &models); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return models, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteOne executes a delete command to delete at most one document from the collection.
|
||||||
|
func (dao *RedPacketHistory) DeleteOne(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||||
|
var (
|
||||||
|
opts *options.DeleteOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.DeleteOne(ctx, filter, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteOneByID executes a delete command to delete at most one document from the collection.
|
||||||
|
func (dao *RedPacketHistory) DeleteOneByID(ctx context.Context, id string, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||||
|
objectID, err := primitive.ObjectIDFromHex(id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.DeleteOne(ctx, func(cols *RedPacketHistoryColumns) interface{} {
|
||||||
|
return bson.M{"_id": objectID}
|
||||||
|
}, optionsFunc...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteMany executes a delete command to delete documents from the collection.
|
||||||
|
func (dao *RedPacketHistory) DeleteMany(ctx context.Context, filterFunc RedPacketHistoryFilterFunc, optionsFunc ...RedPacketHistoryDeleteOptionsFunc) (*mongo.DeleteResult, error) {
|
||||||
|
var (
|
||||||
|
opts *options.DeleteOptions
|
||||||
|
filter = filterFunc(dao.Columns)
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(optionsFunc) > 0 {
|
||||||
|
opts = optionsFunc[0](dao.Columns)
|
||||||
|
}
|
||||||
|
|
||||||
|
return dao.Collection.DeleteMany(ctx, filter, opts)
|
||||||
|
}
|
||||||
|
|
||||||
|
// autofill when inserting data
|
||||||
|
func (dao *RedPacketHistory) autofill(ctx context.Context, model *modelpkg.RedPacketHistory) error {
|
||||||
|
if model.ID.IsZero() {
|
||||||
|
model.ID = primitive.NewObjectID()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -71,10 +71,6 @@ func (r *RedPacket) GetAll() (res []*modelpkg.RedPacket, err error) {
|
||||||
func (r *RedPacket) UpdateAll(list []*modelpkg.RedPacket) error {
|
func (r *RedPacket) UpdateAll(list []*modelpkg.RedPacket) error {
|
||||||
var operations []mongo.WriteModel
|
var operations []mongo.WriteModel
|
||||||
for _, v := range list {
|
for _, v := range list {
|
||||||
updateDataMap := bson.M{
|
|
||||||
"$set": v,
|
|
||||||
}
|
|
||||||
delete(updateDataMap["$set"].(bson.M), "_id") // 删除 _id 字段
|
|
||||||
operations = append(operations, mongo.NewUpdateOneModel().SetFilter(bson.M{"_id": v.ID}).SetUpdate(bson.M{"$set": v}).SetUpsert(true))
|
operations = append(operations, mongo.NewUpdateOneModel().SetFilter(bson.M{"_id": v.ID}).SetUpdate(bson.M{"$set": v}).SetUpsert(true))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
package dao
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo/options"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/mongox"
|
||||||
|
|
||||||
|
"mongo.games.com/game/dao/internal"
|
||||||
|
modelpkg "mongo.games.com/game/model"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
_ = context.Background()
|
||||||
|
_ = logger.Logger
|
||||||
|
_ = bson.M{}
|
||||||
|
_ = mongo.Database{}
|
||||||
|
)
|
||||||
|
|
||||||
|
type RedPacketHistoryColumns = internal.RedPacketHistoryColumns
|
||||||
|
|
||||||
|
type RedPacketHistory struct {
|
||||||
|
*internal.RedPacketHistory
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetRedPacketHistory(key string) (*RedPacketHistory, error) {
|
||||||
|
return mongox.GetDao(key, NewRedPacketHistory)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRedPacketHistory(db *mongo.Database, c *mongo.Collection) (*RedPacketHistory, any) {
|
||||||
|
if db == nil || c == nil {
|
||||||
|
return &RedPacketHistory{}, &modelpkg.RedPacketHistory{}
|
||||||
|
}
|
||||||
|
|
||||||
|
v := internal.NewRedPacketHistory()
|
||||||
|
v.Database = db
|
||||||
|
v.Collection = c
|
||||||
|
c.Indexes().CreateMany(context.Background(), []mongo.IndexModel{
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"snid", 1}, {"cid", 1}, {"ts", -1}}, // 1 表示升序,-1 表示降序
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"snid", 1}, {"ts", -1}},
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"cid", 1}}, // 1 表示升序,-1 表示降序
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"ts", 1}}, // 1 表示升序,-1 表示降序
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"itemid", -1}}, // 1 表示升序,-1 表示降序
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Keys: bson.D{{"itemnum", -1}}, // 1 表示升序,-1 表示降序
|
||||||
|
Options: options.Index().SetBackground(true).SetSparse(true), // 后台创建索引,稀疏索引
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
return &RedPacketHistory{RedPacketHistory: v}, &modelpkg.RedPacketHistory{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RedPacketHistory) GetHistory(snid int32, cid int64) ([]*modelpkg.RedPacketHistory, error) {
|
||||||
|
res, err := r.FindMany(context.Background(), func(cols *internal.RedPacketHistoryColumns) interface{} {
|
||||||
|
if cid > 0 {
|
||||||
|
return bson.M{cols.Snid: snid, cols.Cid: cid}
|
||||||
|
}
|
||||||
|
return bson.M{cols.Snid: snid}
|
||||||
|
}, func(cols *internal.RedPacketHistoryColumns) *options.FindOptions {
|
||||||
|
return options.Find().SetSort(bson.D{{cols.Ts, -1}}).SetLimit(30)
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("RedPacketHistory.GetHistory ", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RedPacketHistory) Save(history *modelpkg.RedPacketHistory) error {
|
||||||
|
_, err := r.InsertOne(context.Background(), history)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("RedPacketHistory.Insert ", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
в† ЁГ
|
||||||
|
ив†
|
||||||
|
Р†
|
||||||
|
Вв† Ќ
|
||||||
|
Ь±к ђN
|
||||||
|
о±к Р†
|
||||||
|
ъўЌ Ќ
|
||||||
|
иб† Р†
|
||||||
|
¶а† °к
|
||||||
|
d»к ЂВЧ/
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
{
|
||||||
|
"Arr": [
|
||||||
|
{
|
||||||
|
"Id": 1,
|
||||||
|
"Rate": 4000,
|
||||||
|
"Gain": {
|
||||||
|
"50018": 5
|
||||||
|
},
|
||||||
|
"Value": 25000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 2,
|
||||||
|
"Rate": 1000,
|
||||||
|
"Gain": {
|
||||||
|
"50018": 10
|
||||||
|
},
|
||||||
|
"Value": 50000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 3,
|
||||||
|
"Rate": 450,
|
||||||
|
"Gain": {
|
||||||
|
"50018": 20
|
||||||
|
},
|
||||||
|
"Value": 100000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 4,
|
||||||
|
"Rate": 1500,
|
||||||
|
"Gain": {
|
||||||
|
"30001": 1
|
||||||
|
},
|
||||||
|
"Value": 10000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 5,
|
||||||
|
"Rate": 750,
|
||||||
|
"Gain": {
|
||||||
|
"30001": 5
|
||||||
|
},
|
||||||
|
"Value": 50000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 6,
|
||||||
|
"Rate": 250,
|
||||||
|
"Gain": {
|
||||||
|
"100002": 1
|
||||||
|
},
|
||||||
|
"Value": 100000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 7,
|
||||||
|
"Rate": 1000,
|
||||||
|
"Gain": {
|
||||||
|
"50017": 1
|
||||||
|
},
|
||||||
|
"Value": 50000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 8,
|
||||||
|
"Rate": 950,
|
||||||
|
"Gain": {
|
||||||
|
"50016": 1
|
||||||
|
},
|
||||||
|
"Value": 30000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 9,
|
||||||
|
"Rate": 100,
|
||||||
|
"Gain": {
|
||||||
|
"30011": 1
|
||||||
|
},
|
||||||
|
"Value": 100000000
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -4520,7 +4520,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110001,
|
"Id": 2110001,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "1",
|
"Title": "新手场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4574,7 +4574,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110002,
|
"Id": 2110002,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "2",
|
"Title": "中级场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4628,7 +4628,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110003,
|
"Id": 2110003,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "3",
|
"Title": "高级场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4682,7 +4682,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110004,
|
"Id": 2110004,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "4",
|
"Title": "富豪场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4736,7 +4736,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110005,
|
"Id": 2110005,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "5",
|
"Title": "至尊场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4790,7 +4790,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2110006,
|
"Id": 2110006,
|
||||||
"Name": "十三张四人",
|
"Name": "十三张四人",
|
||||||
"Title": "6",
|
"Title": "大神场",
|
||||||
"GameId": 211,
|
"GameId": 211,
|
||||||
"GameRule": 21100,
|
"GameRule": 21100,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4843,7 +4843,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120001,
|
"Id": 2120001,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "1",
|
"Title": "新手场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4897,7 +4897,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120002,
|
"Id": 2120002,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "2",
|
"Title": "中级场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -4951,7 +4951,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120003,
|
"Id": 2120003,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "3",
|
"Title": "高级场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -5005,7 +5005,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120004,
|
"Id": 2120004,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "4",
|
"Title": "富豪场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -5059,7 +5059,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120005,
|
"Id": 2120005,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "5",
|
"Title": "至尊场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -5113,7 +5113,7 @@
|
||||||
{
|
{
|
||||||
"Id": 2120006,
|
"Id": 2120006,
|
||||||
"Name": "十三张八人",
|
"Name": "十三张八人",
|
||||||
"Title": "6",
|
"Title": "大神场",
|
||||||
"GameId": 212,
|
"GameId": 212,
|
||||||
"GameRule": 21200,
|
"GameRule": 21200,
|
||||||
"GameType": 2,
|
"GameType": 2,
|
||||||
|
|
@ -7019,6 +7019,41 @@
|
||||||
"PlayerWaterRate": 100,
|
"PlayerWaterRate": 100,
|
||||||
"BetWaterRate": 100,
|
"BetWaterRate": 100,
|
||||||
"GameName": "娃娃机"
|
"GameName": "娃娃机"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 6090001,
|
||||||
|
"Name": "推币机",
|
||||||
|
"Title": "推币机",
|
||||||
|
"GameId": 609,
|
||||||
|
"GameRule": 60900,
|
||||||
|
"GameType": 5,
|
||||||
|
"SceneType": 1,
|
||||||
|
"Desc": "0",
|
||||||
|
"ShowType": 3,
|
||||||
|
"ShowId": 60900,
|
||||||
|
"Turn": 60900,
|
||||||
|
"BetDec": "0",
|
||||||
|
"Ai": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"OtherIntParams": [
|
||||||
|
5000,
|
||||||
|
10000,
|
||||||
|
15000
|
||||||
|
],
|
||||||
|
"RobotNumRng": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SameIpLimit": 1,
|
||||||
|
"GameDif": "609",
|
||||||
|
"GameClass": 2,
|
||||||
|
"PlatformName": "越南棋牌",
|
||||||
|
"MaxBetCoin": [
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"PlayerWaterRate": 100,
|
||||||
|
"BetWaterRate": 100,
|
||||||
|
"GameName": "推币机"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -7300,6 +7300,228 @@
|
||||||
"CompositionMax": 9999,
|
"CompositionMax": 9999,
|
||||||
"Location": "0",
|
"Location": "0",
|
||||||
"Describe": "可在年兽活动中击退年兽,获得奖品"
|
"Describe": "可在年兽活动中击退年兽,获得奖品"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50016,
|
||||||
|
"Name": "梅花",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SaleType": 1,
|
||||||
|
"SaleGold": 5000,
|
||||||
|
"Composition": 1,
|
||||||
|
"CompositionMax": 9999,
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "可在推币机活动兑换道具"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50017,
|
||||||
|
"Name": "大金币",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SaleType": 1,
|
||||||
|
"SaleGold": 5000,
|
||||||
|
"Composition": 1,
|
||||||
|
"CompositionMax": 9999,
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "推币机活动中掉落的3D道具",
|
||||||
|
"Num": 50000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50018,
|
||||||
|
"Name": "3D金币5K",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SaleType": 1,
|
||||||
|
"SaleGold": 5000,
|
||||||
|
"Composition": 1,
|
||||||
|
"CompositionMax": 9999,
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "推币机活动中掉落的3D道具",
|
||||||
|
"Num": 5000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50019,
|
||||||
|
"Name": "3D金币10K",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SaleType": 1,
|
||||||
|
"SaleGold": 5000,
|
||||||
|
"Composition": 1,
|
||||||
|
"CompositionMax": 9999,
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "推币机活动中掉落的3D道具",
|
||||||
|
"Num": 10000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50020,
|
||||||
|
"Name": "3D金币15K",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"SaleType": 1,
|
||||||
|
"SaleGold": 5000,
|
||||||
|
"Composition": 1,
|
||||||
|
"CompositionMax": 9999,
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "推币机活动中掉落的3D道具",
|
||||||
|
"Num": 15000
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 50021,
|
||||||
|
"Name": "震动效果",
|
||||||
|
"ShowLocation": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Classify": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Type": 29,
|
||||||
|
"Effect0": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Effect": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"Location": "0",
|
||||||
|
"Describe": "推币机震动次数"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -267,6 +267,12 @@
|
||||||
"Name": "娃娃机",
|
"Name": "娃娃机",
|
||||||
"GameId": 608,
|
"GameId": 608,
|
||||||
"GameDif": "608"
|
"GameDif": "608"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 60900,
|
||||||
|
"Name": "推币机",
|
||||||
|
"GameId": 609,
|
||||||
|
"GameDif": "609"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -4,10 +4,10 @@ SignReward50014,10;100001,100000"签到奖励
|
||||||
.
SignExcReward50015,1"签到额外奖励
|
.
SignExcReward50015,1"签到额外奖励
|
||||||
=SignExcRewardMax2"$签到额外奖励赠送次数上限
|
=SignExcRewardMax2"$签到额外奖励赠送次数上限
|
||||||
9SignExcRewardProp30"签到额外奖励赠送概率
|
9SignExcRewardProp30"签到额外奖励赠送概率
|
||||||
BossExp6000000"
|
BossExp6800000"
|
||||||
BOSS血量
|
BOSS血量
|
||||||
9
|
:
|
||||||
BossReward100001,100000;100002,10"BOSS击杀奖励
|
BossReward100001,1000000;100002,10"BOSS击杀奖励
|
||||||
/
LuckyRankNeed10000"幸运榜上榜条件
|
/
LuckyRankNeed10000"幸运榜上榜条件
|
||||||
/RankNeed7000000"总伤害榜上榜条件
|
/RankNeed7000000"总伤害榜上榜条件
|
||||||
> LittleHurtGold
|
> LittleHurtGold
|
||||||
|
|
@ -26,4 +26,4 @@ GiftShopID991001,991002,991003"礼包ID
|
||||||
@
GiftShopLimit3,0,0"&礼包每日限购次数,0为不限购
|
@
GiftShopLimit3,0,0"&礼包每日限购次数,0为不限购
|
||||||
4BossExcLimit30"年兽死亡额外掉落要求
|
4BossExcLimit30"年兽死亡额外掉落要求
|
||||||
" BuffCount1"Buff生效次数
|
" BuffCount1"Buff生效次数
|
||||||
oExchangeDiamond30,5,1000000"L单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量
|
oExchangeDiamond30,5,1500000"L单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量
|
||||||
|
|
@ -27,13 +27,13 @@
|
||||||
{
|
{
|
||||||
"Id": 5,
|
"Id": 5,
|
||||||
"PorpName": "BossExp",
|
"PorpName": "BossExp",
|
||||||
"PropValue": "6000000",
|
"PropValue": "6800000",
|
||||||
"PropDec": "BOSS血量"
|
"PropDec": "BOSS血量"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 6,
|
"Id": 6,
|
||||||
"PorpName": "BossReward",
|
"PorpName": "BossReward",
|
||||||
"PropValue": "100001,100000;100002,10",
|
"PropValue": "100001,1000000;100002,10",
|
||||||
"PropDec": "BOSS击杀奖励"
|
"PropDec": "BOSS击杀奖励"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
{
|
{
|
||||||
"Id": 21,
|
"Id": 21,
|
||||||
"PorpName": "ExchangeDiamond",
|
"PorpName": "ExchangeDiamond",
|
||||||
"PropValue": "30,5,1000000",
|
"PropValue": "30,5,1500000",
|
||||||
"PropDec": "单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量"
|
"PropDec": "单次兑换爆竹所需要消耗的钻石,获得数量,获得金币数量"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
|
||||||
|
"¹ê"¡<>"¢<>d
|
||||||
|
"¡<>"¢<>d"¸ê
|
||||||
|
"¡<>"¢<>d"¸ê
|
||||||
|
"¡<>"¢<>d
|
||||||
|
"¡<>"¢<>c
|
||||||
|
"¡<>"¢<>b
|
||||||
|
"¡<>"¢<>a
|
||||||
|
"¡<>"¢<>`
|
||||||
|
"¡<>"¢<>_
|
||||||
|
|
||||||
|
|
||||||
|
"¡<>"¢<>^
|
||||||
|
"¡<>"¢<>]
|
||||||
|
"¢<>\"¡<>
|
||||||
|
"¡<>"¢<>[
|
||||||
|
"¢<>Z"¡<>
|
||||||
|
"¡<>"¢<>Y
|
||||||
|
"¡<>"¢<>X
|
||||||
|
"¡<>"¢<>W
|
||||||
|
"¡<>"¢<>V
|
||||||
|
"¡<>"¢<>U
|
||||||
|
"¡<>"¢<>T
|
||||||
|
"¡<>"¢<>S
|
||||||
|
"¡<>"¢<>R
|
||||||
|
"¡<>"¢<>Q
|
||||||
|
"¡<>"¢<>P
|
||||||
|
"¡<>"¢<>O
|
||||||
|
"¡<>"¢<>N
|
||||||
|
"¢<>M"¡<>
|
||||||
|
"¢<>L"¡<>
|
||||||
|
"¡<>"¢<>K
|
||||||
|
"¡<>"¢<>J
|
||||||
|
"¡<>"¢<>I
|
||||||
|
"¢<>H"¡<>
|
||||||
|
!!"¡<>"¢<>G
|
||||||
|
"""¡<>"¢<>F
|
||||||
|
##"¡<>"¢<>E
|
||||||
|
$$"¡<>"¢<>D
|
||||||
|
%%"¡<>"¢<>C
|
||||||
|
&&"¡<>"¢<>B
|
||||||
|
''"¡<>"¢<>A
|
||||||
|
(("¡<>"¢<>@
|
||||||
|
)"¡<>"¢<>d"¹ê
|
||||||
|
*"¡<>"¢<>d"¸ê
|
||||||
|
+"¡<>"¢<>d"¸ê
|
||||||
|
,"¡<>"¢<>d
|
||||||
|
-"¡<>"¢<>c
|
||||||
|
."¡<>"¢<>b
|
||||||
|
/"¢<>a"¡<>
|
||||||
|
0"¡<>"¢<>`
|
||||||
|
1 "¢<>_"¡<>
|
||||||
|
2
|
||||||
|
"¡<>"¢<>^
|
||||||
|
3"¡<>"¢<>]
|
||||||
|
4"¡<>"¢<>\
|
||||||
|
5
"¡<>"¢<>[
|
||||||
|
6"¢<>Z"¡<>
|
||||||
|
7"¡<>"¢<>Y
|
||||||
|
8"¢<>X"¡<>
|
||||||
|
9"¡<>"¢<>W
|
||||||
|
:"¡<>"¢<>V
|
||||||
|
;"¡<>"¢<>U
|
||||||
|
<"¡<>"¢<>T
|
||||||
|
="¡<>"¢<>S
|
||||||
|
>"¡<>"¢<>R
|
||||||
|
?"¢<>Q"¡<>
|
||||||
|
@"¡<>"¢<>P
|
||||||
|
A"¡<>"¢<>O
|
||||||
|
B"¡<>"¢<>N
|
||||||
|
C"¡<>"¢<>M
|
||||||
|
D"¡<>"¢<>L
|
||||||
|
E"¡<>"¢<>K
|
||||||
|
F"¡<>"¢<>J
|
||||||
|
G"¡<>"¢<>I
|
||||||
|
H "¡<>"¢<>H
|
||||||
|
I!"¢<>G"¡<>
|
||||||
|
J""¡<>"¢<>F
|
||||||
|
K#"¡<>"¢<>E
|
||||||
|
L$"¡<>"¢<>D
|
||||||
|
M%"¡<>"¢<>C
|
||||||
|
N&"¡<>"¢<>B
|
||||||
|
O'"¡<>"¢<>A
|
||||||
|
P("¡<>"¢<>@
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
(€β8–@΅θ;PdX–`c
|
(€β8–@΅θ;PdX–`c
|
||||||
< ((€β2ΕΈ2συ8¬@Άθ;JΖΈJσυPdX¬`Η
|
< ((€β2ΕΈ2συ8¬@Άθ;JσυJΖΈPdX¬`Η
|
||||||
?<18>ΑΧ/ 2(€β2ΕΈ2συ8ξ@£θ;JΖΈJσυPdXξ`σ
|
?<18>ΑΧ/ 2(€β2ΕΈ2συ8ξ@£θ;JΖΈJσυPdXξ`σ
|
||||||
Binary file not shown.
|
|
@ -64,12 +64,70 @@
|
||||||
"100002": 500
|
"100002": 500
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{},
|
{
|
||||||
{},
|
"Id": 5,
|
||||||
{},
|
"Group": 2,
|
||||||
{},
|
"Cost": {
|
||||||
{},
|
"50016": 30
|
||||||
{},
|
},
|
||||||
|
"Gain": {
|
||||||
|
"40002": 1
|
||||||
|
},
|
||||||
|
"Times": 5
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 6,
|
||||||
|
"Group": 2,
|
||||||
|
"Cost": {
|
||||||
|
"50016": 10
|
||||||
|
},
|
||||||
|
"Gain": {
|
||||||
|
"100002": 3
|
||||||
|
},
|
||||||
|
"Times": 10
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 7,
|
||||||
|
"Group": 2,
|
||||||
|
"Cost": {
|
||||||
|
"50016": 5
|
||||||
|
},
|
||||||
|
"Gain": {
|
||||||
|
"30001": 15
|
||||||
|
},
|
||||||
|
"Times": 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 8,
|
||||||
|
"Group": 2,
|
||||||
|
"Cost": {
|
||||||
|
"50016": 1
|
||||||
|
},
|
||||||
|
"Gain": {
|
||||||
|
"20003": 1
|
||||||
|
},
|
||||||
|
"Times": 20
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 9,
|
||||||
|
"Group": 2,
|
||||||
|
"Cost": {
|
||||||
|
"50016": 1
|
||||||
|
},
|
||||||
|
"Gain": {
|
||||||
|
"100001": 30000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 10,
|
||||||
|
"Group": 2,
|
||||||
|
"Cost": {
|
||||||
|
"50016": 1
|
||||||
|
},
|
||||||
|
"Gain": {
|
||||||
|
"50021": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
{},
|
{},
|
||||||
|
|
|
||||||
BIN
data/DB_Task.dat
BIN
data/DB_Task.dat
Binary file not shown.
|
|
@ -1245,7 +1245,8 @@
|
||||||
"TargetTimes": 1,
|
"TargetTimes": 1,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50001": 5,
|
||||||
|
"50014": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1258,6 +1259,7 @@
|
||||||
"TargetTimes": 3600,
|
"TargetTimes": 3600,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
|
"100001": 100000,
|
||||||
"50014": 10
|
"50014": 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1271,7 +1273,8 @@
|
||||||
"TargetTimes": 1,
|
"TargetTimes": 1,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50001": 5,
|
||||||
|
"50014": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1284,7 +1287,8 @@
|
||||||
"TargetTimes": 1,
|
"TargetTimes": 1,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"100002": 5,
|
||||||
|
"50014": 5
|
||||||
},
|
},
|
||||||
"GameType": 1
|
"GameType": 1
|
||||||
},
|
},
|
||||||
|
|
@ -1298,7 +1302,8 @@
|
||||||
"TargetTimes": 10,
|
"TargetTimes": 10,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"100001": 30000,
|
||||||
|
"50014": 5
|
||||||
},
|
},
|
||||||
"GameType": 2
|
"GameType": 2
|
||||||
},
|
},
|
||||||
|
|
@ -1312,7 +1317,7 @@
|
||||||
"TargetTimes": 1000000,
|
"TargetTimes": 1000000,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50014": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1325,7 +1330,7 @@
|
||||||
"TargetTimes": 100,
|
"TargetTimes": 100,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50014": 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1351,7 +1356,7 @@
|
||||||
"TargetTimes": 10000000,
|
"TargetTimes": 10000000,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50014": 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1364,7 +1369,7 @@
|
||||||
"TargetTimes": 20000000,
|
"TargetTimes": 20000000,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50014": 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1390,7 +1395,7 @@
|
||||||
"TargetTimes": 500,
|
"TargetTimes": 500,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1403,7 +1408,7 @@
|
||||||
"TargetTimes": 199,
|
"TargetTimes": 199,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50015": 10
|
"50015": 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1416,7 +1421,7 @@
|
||||||
"TargetTimes": 1,
|
"TargetTimes": 1,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50015": 10
|
"50014": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1429,7 +1434,7 @@
|
||||||
"TargetTimes": 1000000,
|
"TargetTimes": 1000000,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50015": 10
|
"100001": 500000
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1442,7 +1447,7 @@
|
||||||
"TargetTimes": 10000000,
|
"TargetTimes": 10000000,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50015": 10
|
"100002": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1455,7 +1460,8 @@
|
||||||
"TargetTimes": 999,
|
"TargetTimes": 999,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50015": 10
|
"100001": 1000000,
|
||||||
|
"50015": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1468,6 +1474,7 @@
|
||||||
"TargetTimes": 1999,
|
"TargetTimes": 1999,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
|
"100001": 10000000,
|
||||||
"50015": 10
|
"50015": 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1481,7 +1488,8 @@
|
||||||
"TargetTimes": 5999,
|
"TargetTimes": 5999,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"100001": 30000000,
|
||||||
|
"50015": 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1494,7 +1502,8 @@
|
||||||
"TargetTimes": 9999,
|
"TargetTimes": 9999,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"100001": 50000000,
|
||||||
|
"50015": 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1507,72 +1516,72 @@
|
||||||
"TargetTimes": 1,
|
"TargetTimes": 1,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 13022,
|
"Id": 13022,
|
||||||
"Order": 22,
|
"Order": 22,
|
||||||
"Name": "年兽活动",
|
"Name": "年兽活动",
|
||||||
"Des": "成功击杀2只年兽",
|
|
||||||
"ActivityType": 9,
|
|
||||||
"TaskType": 33,
|
|
||||||
"TargetTimes": 2,
|
|
||||||
"FinishTimes": 1,
|
|
||||||
"Award": {
|
|
||||||
"50014": 10
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Id": 13023,
|
|
||||||
"Order": 23,
|
|
||||||
"Name": "年兽活动",
|
|
||||||
"Des": "成功击杀3只年兽",
|
"Des": "成功击杀3只年兽",
|
||||||
"ActivityType": 9,
|
"ActivityType": 9,
|
||||||
"TaskType": 33,
|
"TaskType": 33,
|
||||||
"TargetTimes": 3,
|
"TargetTimes": 3,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 5
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": 13023,
|
||||||
|
"Order": 23,
|
||||||
|
"Name": "年兽活动",
|
||||||
|
"Des": "成功击杀6只年兽",
|
||||||
|
"ActivityType": 9,
|
||||||
|
"TaskType": 33,
|
||||||
|
"TargetTimes": 6,
|
||||||
|
"FinishTimes": 1,
|
||||||
|
"Award": {
|
||||||
|
"50015": 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 13024,
|
"Id": 13024,
|
||||||
"Order": 24,
|
"Order": 24,
|
||||||
"Name": "年兽活动",
|
"Name": "年兽活动",
|
||||||
"Des": "成功击杀5只年兽",
|
"Des": "成功击杀9只年兽",
|
||||||
"ActivityType": 9,
|
"ActivityType": 9,
|
||||||
"TaskType": 33,
|
"TaskType": 33,
|
||||||
"TargetTimes": 5,
|
"TargetTimes": 9,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 13025,
|
"Id": 13025,
|
||||||
"Order": 25,
|
"Order": 25,
|
||||||
"Name": "年兽活动",
|
"Name": "年兽活动",
|
||||||
"Des": "成功击杀8只年兽",
|
"Des": "成功击杀12只年兽",
|
||||||
"ActivityType": 9,
|
"ActivityType": 9,
|
||||||
"TaskType": 33,
|
"TaskType": 33,
|
||||||
"TargetTimes": 8,
|
"TargetTimes": 12,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 20
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Id": 13026,
|
"Id": 13026,
|
||||||
"Order": 26,
|
"Order": 26,
|
||||||
"Name": "年兽活动",
|
"Name": "年兽活动",
|
||||||
"Des": "成功击杀10只年兽",
|
"Des": "成功击杀20只年兽",
|
||||||
"ActivityType": 9,
|
"ActivityType": 9,
|
||||||
"TaskType": 33,
|
"TaskType": 33,
|
||||||
"TargetTimes": 10,
|
"TargetTimes": 20,
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"50014": 10
|
"50015": 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1586,7 +1595,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 100000,
|
"100001": 100000,
|
||||||
"100002": 1
|
"50014": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1600,7 +1609,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 200000,
|
"100001": 200000,
|
||||||
"100002": 2
|
"50015": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1614,7 +1623,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 300000,
|
"100001": 300000,
|
||||||
"100002": 3
|
"50015": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1628,7 +1637,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 500000,
|
"100001": 500000,
|
||||||
"100002": 5
|
"50015": 10
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1642,7 +1651,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 1000000,
|
"100001": 1000000,
|
||||||
"100002": 10
|
"50015": 15
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -1656,7 +1665,7 @@
|
||||||
"FinishTimes": 1,
|
"FinishTimes": 1,
|
||||||
"Award": {
|
"Award": {
|
||||||
"100001": 2000000,
|
"100001": 2000000,
|
||||||
"100002": 20
|
"50015": 25
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"GameName":"推币机",
|
||||||
|
"GameId":609,
|
||||||
|
"GameMode":[0],
|
||||||
|
"SceneType":[1],
|
||||||
|
"CanForceStart":true,
|
||||||
|
"MinPlayerCnt":1,
|
||||||
|
"DefaultPlayerCnt":1
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@ package mq
|
||||||
import (
|
import (
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/dao"
|
||||||
"mongo.games.com/game/dbproxy/svc"
|
"mongo.games.com/game/dbproxy/svc"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/mq"
|
"mongo.games.com/game/mq"
|
||||||
|
|
@ -27,4 +28,28 @@ func init() {
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
mq.RegisterHandler(&mq.RegisterHandlerParam{
|
||||||
|
Name: mq.DBRedPacket,
|
||||||
|
Data: &model.RedPacketHistory{},
|
||||||
|
Handler: func(data interface{}) (err error) {
|
||||||
|
log, ok := data.(*model.RedPacketHistory)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
d, err := dao.GetRedPacketHistory(log.Platform)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("get RedPacketHistory failed: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
err = d.Save(log)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("Save RedPacketHistory failed: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,9 @@ func (svc *FriendUnreadSvc) UpsertFriendUnread(args *model.FriendUnreadByKey, re
|
||||||
if cc == nil {
|
if cc == nil {
|
||||||
return FriendUnreadColError
|
return FriendUnreadColError
|
||||||
}
|
}
|
||||||
|
if ret == nil {
|
||||||
|
ret = &model.FriendUnreadRet{}
|
||||||
|
}
|
||||||
err := cc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
err := cc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
||||||
if err != nil && err != mgo.ErrNotFound {
|
if err != nil && err != mgo.ErrNotFound {
|
||||||
logger.Logger.Error("UpsertFriendUnread Find is err: ", err)
|
logger.Logger.Error("UpsertFriendUnread Find is err: ", err)
|
||||||
|
|
@ -76,6 +79,9 @@ func (svc *FriendUnreadSvc) UpdateFriendUnread(args *model.FriendUnreadByKey, re
|
||||||
if cc == nil {
|
if cc == nil {
|
||||||
return FriendUnreadColError
|
return FriendUnreadColError
|
||||||
}
|
}
|
||||||
|
if ret == nil {
|
||||||
|
ret = &model.FriendUnreadRet{}
|
||||||
|
}
|
||||||
err := cc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
err := cc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
||||||
if err != nil && err != mgo.ErrNotFound {
|
if err != nil && err != mgo.ErrNotFound {
|
||||||
logger.Logger.Error("UpdateFriendUnread Find is err: ", err)
|
logger.Logger.Error("UpdateFriendUnread Find is err: ", err)
|
||||||
|
|
@ -98,6 +104,9 @@ func (svc *FriendUnreadSvc) QueryFriendUnreadByKey(args *model.FriendUnreadByKey
|
||||||
if fc == nil {
|
if fc == nil {
|
||||||
return FriendUnreadColError
|
return FriendUnreadColError
|
||||||
}
|
}
|
||||||
|
if ret == nil {
|
||||||
|
ret = &model.FriendUnreadRet{}
|
||||||
|
}
|
||||||
err := fc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
err := fc.Find(bson.M{"snid": args.SnId}).One(&ret.FU)
|
||||||
if err != nil && err != mgo.ErrNotFound {
|
if err != nil && err != mgo.ErrNotFound {
|
||||||
logger.Logger.Error("QueryFriendUnreadByKey is err: ", err)
|
logger.Logger.Error("QueryFriendUnreadByKey is err: ", err)
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ func ItemLogsCollection(plt string) *mongo.Collection {
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"typeid", "roomconfigid"}, Background: true, Sparse: true})
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"ts"}, Background: true, Sparse: true})
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"-ts"}, Background: true, Sparse: true})
|
||||||
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"seq"}, Background: true, Sparse: true})
|
||||||
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gamedif"}, Background: true, Sparse: true})
|
c_itemlog.EnsureIndex(mgo.Index{Key: []string{"gamedif"}, Background: true, Sparse: true})
|
||||||
}
|
}
|
||||||
return c_itemlog
|
return c_itemlog
|
||||||
|
|
@ -43,6 +44,7 @@ type ItemLogSvc struct {
|
||||||
func (svc *ItemLogSvc) InsertItemLog(log *model.ItemLog, ret *bool) (err error) {
|
func (svc *ItemLogSvc) InsertItemLog(log *model.ItemLog, ret *bool) (err error) {
|
||||||
clog := ItemLogsCollection(log.Platform)
|
clog := ItemLogsCollection(log.Platform)
|
||||||
if clog == nil {
|
if clog == nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.InsertItemLog get collection fail platform:%v", log.Platform)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = clog.Insert(log)
|
err = clog.Insert(log)
|
||||||
|
|
@ -54,10 +56,46 @@ func (svc *ItemLogSvc) InsertItemLog(log *model.ItemLog, ret *bool) (err error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (svc *ItemLogSvc) Insert(req *model.InsertItemLogReq, res *bool) error {
|
||||||
|
if len(req.Logs) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
clog := ItemLogsCollection(req.Logs[0].Platform)
|
||||||
|
if clog == nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.Insert get collection fail platform:%v", req.Logs[0].Platform)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
var docs []interface{}
|
||||||
|
for _, v := range req.Logs {
|
||||||
|
docs = append(docs, v)
|
||||||
|
}
|
||||||
|
if err := clog.Insert(docs...); err != nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.Insert error: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
*res = true
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes) error {
|
||||||
|
c := ItemLogsCollection(req.Platform)
|
||||||
|
if c == nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.UpdateState get collection fail platform:%v", req.Platform)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
err := c.UpdateId(req.LogId, bson.M{"$set": bson.M{"status": req.State}})
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.UpdateState error: %v", err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
// GetItemCount 获取v卡兑换消耗数量
|
// GetItemCount 获取v卡兑换消耗数量
|
||||||
func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
||||||
c := ItemLogsCollection(platform)
|
c := ItemLogsCollection(platform)
|
||||||
if c == nil {
|
if c == nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.GetItemCount get collection fail platform:%v", platform)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
|
@ -73,7 +111,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount swapN error:", err)
|
logger.Logger.Error("GetItemCount swapN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
swapN = tc.Count
|
swapN = tc.Count
|
||||||
|
|
@ -85,7 +123,7 @@ func GetItemCount(platform string, snid, id int32, tp int) (count int64) {
|
||||||
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
{"$group": bson.M{"_id": nil, "count": bson.M{"$sum": "$count"}}},
|
||||||
}).AllowDiskUse().One(tc)
|
}).AllowDiskUse().One(tc)
|
||||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Warn("GetItemCount costN error:", err)
|
logger.Logger.Error("GetItemCount costN error:", err)
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
costN = tc.Count
|
costN = tc.Count
|
||||||
|
|
@ -107,15 +145,6 @@ func (svc *ItemLogSvc) GetItemCount(req *model.ItemCountParam, count *int64) err
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *ItemLogSvc) UpdateState(req *model.UpdateParam, res *model.UpdateRes) error {
|
|
||||||
c := ItemLogsCollection(req.Platform)
|
|
||||||
if c == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
err := c.UpdateId(req.LogId, bson.M{"$set": bson.M{"status": req.State}})
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) {
|
func (svc *ItemLogSvc) GetClawdollItemLog(args *model.ClawdollItemLogReq, ret *model.GetClawdollItemLogRet) (err error) {
|
||||||
|
|
||||||
limitDataNum := 200
|
limitDataNum := 200
|
||||||
|
|
@ -229,38 +258,18 @@ func (svc *ItemLogSvc) GetClawdollSuccessItemLog(args *model.ClawdollSuccessItem
|
||||||
func (svc *ItemLogSvc) GetItemLog(req *model.GetItemLogParam, res *model.GetItemLogRes) error {
|
func (svc *ItemLogSvc) GetItemLog(req *model.GetItemLogParam, res *model.GetItemLogRes) error {
|
||||||
c := ItemLogsCollection(req.Plt)
|
c := ItemLogsCollection(req.Plt)
|
||||||
if c == nil {
|
if c == nil {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.GetItemLog get collection fail platform:%v", req.Plt)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err := c.Find(bson.M{"snid": req.SnId, "ts": bson.M{"$gt": req.Ts}}).All(&res.Logs)
|
err := c.Find(bson.M{"snid": req.SnId, "ts": bson.M{"$gt": req.Ts}}).Sort("ts", "seq").All(&res.Logs)
|
||||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
|
logger.Logger.Errorf("ItemLogSvc.GetItemLog error: %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *ItemLogSvc) Insert(req *model.InsertItemLogReq, res *bool) error {
|
|
||||||
if len(req.Logs) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
clog := ItemLogsCollection(req.Logs[0].Platform)
|
|
||||||
if clog == nil {
|
|
||||||
logger.Logger.Errorf("ItemLogSvc.Insert collection not found Platform:%v", req.Logs[0].Platform)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
var docs []interface{}
|
|
||||||
for _, v := range req.Logs {
|
|
||||||
docs = append(docs, v)
|
|
||||||
}
|
|
||||||
if err := clog.Insert(docs...); err != nil {
|
|
||||||
logger.Logger.Warn("ItemLogSvc.Insert error:", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
*res = true
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rpc.Register(new(ItemLogSvc))
|
rpc.Register(new(ItemLogSvc))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,3 +52,20 @@ func (r *RedPacketService) UpdateAll(req *model.UpdateRedPacketAllReq, res *bool
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *RedPacketService) GetHistory(req *model.GetRedPacketHistoryReq, res *[]*model.RedPacketHistory) error {
|
||||||
|
d, err := dao.GetRedPacketHistory(req.Plt)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
list, err := d.GetHistory(req.Snid, req.Cid)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("RedPacketService.GetHistory error: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
*res = list
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,10 @@ func (svc *FriendSvc) QueryFriendByKey(args *model.FriendByKey, ret *model.Frien
|
||||||
if fc == nil {
|
if fc == nil {
|
||||||
return FriendColError
|
return FriendColError
|
||||||
}
|
}
|
||||||
|
if ret == nil {
|
||||||
|
ret = &model.FriendRet{}
|
||||||
|
ret.Fri = &model.Friend{}
|
||||||
|
}
|
||||||
err := fc.Find(bson.M{"platform": args.Platform, "snid": args.SnId}).One(&ret.Fri)
|
err := fc.Find(bson.M{"platform": args.Platform, "snid": args.SnId}).One(&ret.Fri)
|
||||||
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
if err != nil && !errors.Is(err, mgo.ErrNotFound) {
|
||||||
logger.Logger.Error("QueryFriendByKey is err: ", err)
|
logger.Logger.Error("QueryFriendByKey is err: ", err)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
newMongo "go.mongodb.org/mongo-driver/mongo"
|
newMongo "go.mongodb.org/mongo-driver/mongo"
|
||||||
|
|
@ -68,6 +69,7 @@ func PlayerDelBackupDataCollection(plt string) *mongo.Collection {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlayerDataSvc struct {
|
type PlayerDataSvc struct {
|
||||||
|
mu sync.Mutex // 互斥锁
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *PlayerDataSvc) InsertPlayerData(args *model.InsertPlayerDataParam, ret *model.PlayerDataRet) (err error) {
|
func (svc *PlayerDataSvc) InsertPlayerData(args *model.InsertPlayerDataParam, ret *model.PlayerDataRet) (err error) {
|
||||||
|
|
@ -323,6 +325,8 @@ func SavePlayerData(pd *model.PlayerData) (err error) {
|
||||||
* 保存玩家的全部信息
|
* 保存玩家的全部信息
|
||||||
*/
|
*/
|
||||||
func (svc *PlayerDataSvc) SavePlayerData(pd *model.PlayerData, ret *bool) (err error) {
|
func (svc *PlayerDataSvc) SavePlayerData(pd *model.PlayerData, ret *bool) (err error) {
|
||||||
|
svc.mu.Lock()
|
||||||
|
defer svc.mu.Unlock()
|
||||||
err = SavePlayerData(pd)
|
err = SavePlayerData(pd)
|
||||||
*ret = err == nil
|
*ret = err == nil
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const (
|
||||||
ETCDKEY_ACT_GIVE_PREFIX = "/game/plt/actgive/"
|
ETCDKEY_ACT_GIVE_PREFIX = "/game/plt/actgive/"
|
||||||
ETCDKEY_SHOP_EXCHANGE = "/game/exchange_shop"
|
ETCDKEY_SHOP_EXCHANGE = "/game/exchange_shop"
|
||||||
ETCDKEY_GAME_NOTICE = "/game/common_notice"
|
ETCDKEY_GAME_NOTICE = "/game/common_notice"
|
||||||
ETCDKEY_SHOP_ITEM = "/game/item_shop"
|
ETCDKEY_SHOP_ITEM = "/game/item_shop/"
|
||||||
ETCDKEY_GAME_MATCH = "/game/game_match"
|
ETCDKEY_GAME_MATCH = "/game/game_match"
|
||||||
ETCDKEY_GAME_MATCH_TYPE = "/game/match_type"
|
ETCDKEY_GAME_MATCH_TYPE = "/game/match_type"
|
||||||
ETCDKEY_ACT_TURNPLATE = "/game/act_turnplate"
|
ETCDKEY_ACT_TURNPLATE = "/game/act_turnplate"
|
||||||
|
|
@ -34,7 +34,7 @@ const (
|
||||||
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
|
ETCDKEY_ACT_Invite = "/game/act_invite" // 邀请活动配置
|
||||||
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
|
ETCDKEY_ACT_Permit = "/game/act_permit" // 赛季通行证配置
|
||||||
ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
|
ETCDKEY_DIAMOND_LOTTERY = "/game/diamond_lottery" // 钻石抽奖配置
|
||||||
ETCDKEY_Item = "/game/item" // 道具列表
|
ETCDKEY_Item = "/game/item/" // 道具列表
|
||||||
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
ETCDKEY_SKin = "/game/skin_config" // 皮肤配置
|
||||||
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
ETCDKEY_RANK_TYPE = "/game/RankType" // 排行榜奖励配置
|
||||||
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
ETCDKEY_AWARD_CONFIG = "/game/awardlog_config" //获奖记录
|
||||||
|
|
@ -55,4 +55,5 @@ const (
|
||||||
ETCDKEY_NianRankConfig = "/game/activity_nian_rank" //年兽排行榜配置
|
ETCDKEY_NianRankConfig = "/game/activity_nian_rank" //年兽排行榜配置
|
||||||
KeyRedPacket = "/game/act_redpacket" //红包配置
|
KeyRedPacket = "/game/act_redpacket" //红包配置
|
||||||
KeyActConsume = "/game/act_consume" //累计消耗活动配置
|
KeyActConsume = "/game/act_consume" //累计消耗活动配置
|
||||||
|
KeyActPushCoin = "/game/act_pushcoin" //推金币活动配置
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
// 房间类型
|
||||||
|
const (
|
||||||
|
RoomMode_Classic int = iota //经典
|
||||||
|
RoomMode_Max
|
||||||
|
)
|
||||||
|
|
||||||
|
// 场景状态
|
||||||
|
const (
|
||||||
|
GatesOfOlympusStateStart int = iota //默认状态
|
||||||
|
GatesOfOlympusStateMax
|
||||||
|
)
|
||||||
|
|
||||||
|
// 玩家操作
|
||||||
|
const (
|
||||||
|
GatesOfOlympusPlayerOpStart int = iota
|
||||||
|
GatesOfOlympusPlayerOpSwitch
|
||||||
|
)
|
||||||
|
const NowByte int64 = 10000
|
||||||
|
|
||||||
|
const GameDataKey = "FortuneData"
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package pushcoin
|
||||||
|
|
||||||
|
const (
|
||||||
|
GameStatePlay = iota
|
||||||
|
GameStateMax
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
PowerMax = 700000
|
||||||
|
PowerInit = 400000
|
||||||
|
)
|
||||||
|
|
@ -62,6 +62,14 @@ func (nsa *NpcServerAgent) SyncDBGameFree(roomId int, DBGameFree *server.DB_Game
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (nsa *NpcServerAgent) DestroyScene(sceneId int) {
|
||||||
|
pack := &server.GRDestroyScene{
|
||||||
|
SceneId: proto.Int(sceneId),
|
||||||
|
}
|
||||||
|
nsa.sendPacket(int(server.SSPacketID_PACKET_GR_DESTROYSCENE), pack)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Invite 邀请机器人
|
// Invite 邀请机器人
|
||||||
func (nsa *NpcServerAgent) Invite(roomId, cnt int, gameFreeId int32) bool {
|
func (nsa *NpcServerAgent) Invite(roomId, cnt int, gameFreeId int32) bool {
|
||||||
//logger.Logger.Trace("(nsa *NpcServerAgent) Invite", roomId, cnt, isAgent, gameFreeId)
|
//logger.Logger.Trace("(nsa *NpcServerAgent) Invite", roomId, cnt, isAgent, gameFreeId)
|
||||||
|
|
|
||||||
|
|
@ -908,6 +908,9 @@ func (this *Scene) Destroy(force bool) {
|
||||||
}
|
}
|
||||||
proto.SetDefaults(pack)
|
proto.SetDefaults(pack)
|
||||||
this.SendToWorld(int(server.SSPacketID_PACKET_GW_DESTROYSCENE), pack)
|
this.SendToWorld(int(server.SSPacketID_PACKET_GW_DESTROYSCENE), pack)
|
||||||
|
|
||||||
|
NpcServerAgentSingleton.DestroyScene(int(this.SceneId))
|
||||||
|
|
||||||
logger.Logger.Trace("(this *Scene) Destroy(force bool) isCompleted", isCompleted)
|
logger.Logger.Trace("(this *Scene) Destroy(force bool) isCompleted", isCompleted)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,13 +46,6 @@ type ScenePolicy interface {
|
||||||
CanAddCoin(s *Scene, p *Player, val int64) bool
|
CanAddCoin(s *Scene, p *Player, val int64) bool
|
||||||
//当前状态能否换桌
|
//当前状态能否换桌
|
||||||
CanChangeCoinScene(s *Scene, p *Player) bool
|
CanChangeCoinScene(s *Scene, p *Player) bool
|
||||||
//创建场景扩展数据
|
|
||||||
CreateSceneExData(s *Scene) interface{}
|
|
||||||
//创建玩家扩展数据
|
|
||||||
CreatePlayerExData(s *Scene, p *Player) interface{}
|
|
||||||
//
|
|
||||||
PacketGameData(s *Scene) interface{}
|
|
||||||
InterventionGame(s *Scene, data interface{}) interface{}
|
|
||||||
//通知分场状态
|
//通知分场状态
|
||||||
NotifyGameState(s *Scene)
|
NotifyGameState(s *Scene)
|
||||||
|
|
||||||
|
|
@ -243,10 +236,6 @@ func (bsp *BaseScenePolicy) IsCanForceStart(s *Scene) bool
|
||||||
func (bsp *BaseScenePolicy) ForceStart(s *Scene) {}
|
func (bsp *BaseScenePolicy) ForceStart(s *Scene) {}
|
||||||
func (bsp *BaseScenePolicy) CanAddCoin(s *Scene, p *Player, val int64) bool { return true } /*百人牛牛,百人金华多倍结算,且当前是减币的情况下,需要判断*/
|
func (bsp *BaseScenePolicy) CanAddCoin(s *Scene, p *Player, val int64) bool { return true } /*百人牛牛,百人金华多倍结算,且当前是减币的情况下,需要判断*/
|
||||||
func (bsp *BaseScenePolicy) CanChangeCoinScene(s *Scene, p *Player) bool { return false }
|
func (bsp *BaseScenePolicy) CanChangeCoinScene(s *Scene, p *Player) bool { return false }
|
||||||
func (bsp *BaseScenePolicy) CreateSceneExData(s *Scene) interface{} { return false }
|
|
||||||
func (bsp *BaseScenePolicy) CreatePlayerExData(s *Scene, p *Player) interface{} { return false }
|
|
||||||
func (bsp *BaseScenePolicy) PacketGameData(s *Scene) interface{} { return nil }
|
|
||||||
func (bsp *BaseScenePolicy) InterventionGame(s *Scene, data interface{}) interface{} { return nil }
|
|
||||||
func (bsp *BaseScenePolicy) NotifyGameState(s *Scene) {}
|
func (bsp *BaseScenePolicy) NotifyGameState(s *Scene) {}
|
||||||
func (bsp *BaseScenePolicy) GetJackPotVal(s *Scene) int64 { return 0 }
|
func (bsp *BaseScenePolicy) GetJackPotVal(s *Scene) int64 { return 0 }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/protocol/gatesofolympus"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CSGatesOfOlympusOpPacketFactory struct {
|
||||||
|
}
|
||||||
|
type CSGatesOfOlympusOpHandler struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *CSGatesOfOlympusOpPacketFactory) CreatePacket() interface{} {
|
||||||
|
pack := &gatesofolympus.CSGatesOfOlympusOp{}
|
||||||
|
return pack
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *CSGatesOfOlympusOpHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
|
if op, ok := data.(*gatesofolympus.CSGatesOfOlympusOp); ok {
|
||||||
|
p := base.PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
logger.Logger.Warn("CSGatesOfOlympusOpHandler p == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
scene := p.GetScene()
|
||||||
|
if scene == nil {
|
||||||
|
logger.Logger.Warn("CSGatesOfOlympusOpHandler p.scene == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if !scene.HasPlayer(p) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if scene.GetScenePolicy() != nil {
|
||||||
|
scene.GetScenePolicy().OnPlayerOp(scene, p, int(op.GetOpCode()), op.GetParams())
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func init() {
|
||||||
|
common.RegisterHandler(int(gatesofolympus.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP), &CSGatesOfOlympusOpHandler{})
|
||||||
|
netlib.RegisterFactory(int(gatesofolympus.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_CSGATESOFOLYMPUSOP), &CSGatesOfOlympusOpPacketFactory{})
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamerule/gatesofolympus"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GatesOfOlympusPlayerData struct {
|
||||||
|
*base.Player
|
||||||
|
base.LabaLog
|
||||||
|
leaveTime int32 //离开时间
|
||||||
|
SlotsSession *base.SlotsSession
|
||||||
|
|
||||||
|
BetSizeIndex int64 `json:"bsi"` //选中的单注下标
|
||||||
|
BetLevelIndex int64 `json:"bli"` //选中的等级下标
|
||||||
|
BetLineIndex int64 `json:"bii"` //选中的线数下标
|
||||||
|
BetMode int64 `json:"bm,optional"` //0.常规 1.%125 2.购买
|
||||||
|
|
||||||
|
taxCoin int64
|
||||||
|
winCoin int64
|
||||||
|
currentLogId string
|
||||||
|
totalBet int64
|
||||||
|
|
||||||
|
isFree bool //只用于判断是否可以离开
|
||||||
|
}
|
||||||
|
type LinkPositions struct {
|
||||||
|
Positions []int64 `json:"Positions,omitempty"`
|
||||||
|
}
|
||||||
|
type CustomEliminate struct {
|
||||||
|
LinkPositions []*LinkPositions `json:"LinkPositions,omitempty"` //消除的位置
|
||||||
|
AppendSymbols [][]int64 `json:"AppendSymbols,omitempty"` //新增
|
||||||
|
FormattedSymbols [][]int64 `json:"FormattedSymbols,omitempty"` //最终的结果
|
||||||
|
LinePays []float64 `json:"LinePays,omitempty"` //赔付
|
||||||
|
WinCoins []float64 `json:"WinCoins,omitempty"` //输赢
|
||||||
|
MultiStr string `json:"multi_str,omitempty"`
|
||||||
|
MultiStrVal string `json:"multi_str_val,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
|
}
|
||||||
|
type SpinLock struct {
|
||||||
|
CustomEliminates []CustomEliminate `json:"CustomEliminates,omitempty"`
|
||||||
|
Pay float64 `json:"Pay,omitempty"`
|
||||||
|
Multi int64 `json:"Multi,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *GatesOfOlympusPlayerData) init() {
|
||||||
|
p.SlotsSession = base.NewSession(uint64(p.SnId), p.Coin*gatesofolympus.NowByte)
|
||||||
|
}
|
||||||
|
func (p *GatesOfOlympusPlayerData) Clear() {
|
||||||
|
p.taxCoin = 0
|
||||||
|
p.winCoin = 0
|
||||||
|
p.currentLogId = ""
|
||||||
|
p.LabaLog.Clear()
|
||||||
|
}
|
||||||
|
|
||||||
|
// 需要带到world上进行数据处理
|
||||||
|
func (p *GatesOfOlympusPlayerData) PushPlayer() map[string]string {
|
||||||
|
cache := slots.SlotsMgrSington.PushPlayer(p.SlotsSession)
|
||||||
|
return cache
|
||||||
|
}
|
||||||
|
|
||||||
|
// 进房的时候需要带进来
|
||||||
|
func (p *GatesOfOlympusPlayerData) PullPlayer(data map[string]string) {
|
||||||
|
slots.SlotsMgrSington.PullPlayer(p.SlotsSession, data)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,45 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/assemble"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GatesOfOlympusSceneData struct {
|
||||||
|
*base.Scene //场景
|
||||||
|
players map[int32]*GatesOfOlympusPlayerData //玩家信息
|
||||||
|
BetConfig *assemble.BetConfig
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGatesOfOlympusSceneData(s *base.Scene) *GatesOfOlympusSceneData {
|
||||||
|
sceneEx := &GatesOfOlympusSceneData{
|
||||||
|
Scene: s,
|
||||||
|
players: make(map[int32]*GatesOfOlympusPlayerData),
|
||||||
|
}
|
||||||
|
sceneEx.Init()
|
||||||
|
return sceneEx
|
||||||
|
}
|
||||||
|
func (s *GatesOfOlympusSceneData) Init() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *GatesOfOlympusSceneData) Clear() {
|
||||||
|
//应该是水池变一次就判断修改一次
|
||||||
|
//s.slotRateWeight = s.slotRateWeightTotal[0]
|
||||||
|
}
|
||||||
|
func (s *GatesOfOlympusSceneData) SceneDestroy(force bool) {
|
||||||
|
//销毁房间
|
||||||
|
s.Scene.Destroy(force)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *GatesOfOlympusSceneData) delPlayer(SnId int32) {
|
||||||
|
if _, exist := s.players[SnId]; exist {
|
||||||
|
delete(s.players, SnId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (s *GatesOfOlympusSceneData) OnPlayerLeave(p *base.Player, reason int) {
|
||||||
|
if /*playerEx*/ _, ok := p.ExtraData.(*GatesOfOlympusPlayerData); ok {
|
||||||
|
|
||||||
|
}
|
||||||
|
s.delPlayer(p.SnId)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,585 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/gamerule/gatesofolympus"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/assemble"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots"
|
||||||
|
"mongo.games.com/game/model"
|
||||||
|
"mongo.games.com/game/proto"
|
||||||
|
protocol "mongo.games.com/game/protocol/gatesofolympus"
|
||||||
|
"mongo.games.com/game/protocol/server"
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////
|
||||||
|
var ScenePolicyGatesOfOlympusSington = &ScenePolicyGatesOfOlympus{}
|
||||||
|
|
||||||
|
type ScenePolicyGatesOfOlympus struct {
|
||||||
|
base.BaseScenePolicy
|
||||||
|
states [gatesofolympus.GatesOfOlympusStateMax]base.SceneState
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建场景扩展数据
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) CreateSceneExData(s *base.Scene) interface{} {
|
||||||
|
sceneEx := NewGatesOfOlympusSceneData(s)
|
||||||
|
if sceneEx != nil {
|
||||||
|
if sceneEx.GetInit() {
|
||||||
|
s.SetExtraData(sceneEx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sceneEx
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建玩家扩展数据
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) CreatePlayerExData(s *base.Scene, p *base.Player) interface{} {
|
||||||
|
playerEx := &GatesOfOlympusPlayerData{Player: p}
|
||||||
|
p.SetExtraData(playerEx)
|
||||||
|
return playerEx
|
||||||
|
}
|
||||||
|
|
||||||
|
// 场景开启事件
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnStart(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnStart, sceneId=", s.GetSceneId())
|
||||||
|
sceneEx := NewGatesOfOlympusSceneData(s)
|
||||||
|
if sceneEx != nil {
|
||||||
|
if sceneEx.GetInit() {
|
||||||
|
s.SetExtraData(sceneEx)
|
||||||
|
s.ChangeSceneState(gatesofolympus.GatesOfOlympusStateStart)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 场景关闭事件
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnStop(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnStop , sceneId=", s.GetSceneId())
|
||||||
|
}
|
||||||
|
|
||||||
|
// 场景心跳事件
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnTick(s *base.Scene) {
|
||||||
|
if s == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if s.GetSceneState() != nil {
|
||||||
|
s.GetSceneState().OnTick(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家进入事件
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerEnter(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.Name)
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
playerEx := &GatesOfOlympusPlayerData{Player: p}
|
||||||
|
|
||||||
|
playerEx.init()
|
||||||
|
|
||||||
|
d := p.GameData[gatesofolympus.GameDataKey]
|
||||||
|
if d != nil {
|
||||||
|
m := make(map[string]string)
|
||||||
|
json.Unmarshal(d.Data.([]byte), &m)
|
||||||
|
playerEx.PullPlayer(m)
|
||||||
|
} else {
|
||||||
|
m := make(map[string]string)
|
||||||
|
//json.Unmarshal(d.Data.([]byte), &m)
|
||||||
|
playerEx.PullPlayer(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
playerEx.SlotsSession.SetCoin(playerEx.Coin * gatesofolympus.NowByte)
|
||||||
|
|
||||||
|
playerEx.Clear()
|
||||||
|
|
||||||
|
sceneEx.players[p.SnId] = playerEx
|
||||||
|
|
||||||
|
p.SetExtraData(playerEx)
|
||||||
|
GatesOfOlympusSendRoomInfo(s, sceneEx, playerEx)
|
||||||
|
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家离开事件
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if playerEx, ok := p.ExtraData.(*GatesOfOlympusPlayerData); ok {
|
||||||
|
playerEx.LabaLog.Save(2) // 没有收到结束消息,算2秒游戏时长
|
||||||
|
m := playerEx.PushPlayer()
|
||||||
|
if m != nil && len(m) > 0 {
|
||||||
|
b, err := json.Marshal(m)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("OnPlayerLeave, json.Marshal error:", err)
|
||||||
|
} else {
|
||||||
|
p.GameData[gatesofolympus.GameDataKey] = &model.PlayerGameData{
|
||||||
|
Platform: p.Platform,
|
||||||
|
SnId: p.SnId,
|
||||||
|
Id: gatesofolympus.GameDataKey,
|
||||||
|
Data: b,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if sceneEx, ok := s.ExtraData.(*GatesOfOlympusSceneData); ok {
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
|
||||||
|
sceneEx.OnPlayerLeave(p, reason)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家掉线
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerDropLine(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家重连
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerRehold(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
if playerEx, ok := p.GetExtraData().(*GatesOfOlympusPlayerData); ok {
|
||||||
|
GatesOfOlympusSendRoomInfo(s, sceneEx, playerEx)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回房间
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerReturn(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerReturn, GetSceneId()=", s.GetSceneId(), " player=", p.Name)
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
if playerEx, ok := p.GetExtraData().(*GatesOfOlympusPlayerData); ok {
|
||||||
|
//if p.IsMarkFlag(base.PlayerState_Auto) {
|
||||||
|
// p.UnmarkFlag(base.PlayerState_Auto)
|
||||||
|
// p.SyncFlag()
|
||||||
|
//}
|
||||||
|
//发送房间信息给自己
|
||||||
|
GatesOfOlympusSendRoomInfo(s, sceneEx, playerEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func GatesOfOlympusSendRoomInfo(s *base.Scene, sceneEx *GatesOfOlympusSceneData, playerEx *GatesOfOlympusPlayerData) {
|
||||||
|
pack := GatesOfOlympusCreateRoomInfoPacket(s, sceneEx, playerEx)
|
||||||
|
logger.Logger.Trace("RoomInfo: ", pack)
|
||||||
|
playerEx.SendToClient(int(protocol.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSROOMINFO), pack)
|
||||||
|
}
|
||||||
|
func GatesOfOlympusCreateRoomInfoPacket(s *base.Scene, sceneEx *GatesOfOlympusSceneData, playerEx *GatesOfOlympusPlayerData) interface{} {
|
||||||
|
//房间信息
|
||||||
|
pack := &protocol.SCGatesOfOlympusRoomInfo{
|
||||||
|
RoomId: s.SceneId,
|
||||||
|
GameId: s.GameId,
|
||||||
|
RoomMode: s.SceneMode,
|
||||||
|
SceneType: s.GetSceneType(),
|
||||||
|
Params: common.CopySliceInt64ToInt32(s.Params),
|
||||||
|
NumOfGames: proto.Int(sceneEx.NumOfGames),
|
||||||
|
State: proto.Int(s.SceneState.GetState()),
|
||||||
|
ParamsEx: s.GetDBGameFree().OtherIntParams,
|
||||||
|
GameFreeId: proto.Int32(s.GetDBGameFree().Id),
|
||||||
|
//BetLimit: s.GetDBGameFree().BetLimit,
|
||||||
|
}
|
||||||
|
|
||||||
|
//自己的信息
|
||||||
|
if playerEx != nil {
|
||||||
|
pd := &protocol.GatesOfOlympusPlayerData{
|
||||||
|
SnId: proto.Int32(playerEx.SnId),
|
||||||
|
Name: proto.String(playerEx.Name),
|
||||||
|
Head: proto.Int32(playerEx.Head),
|
||||||
|
Sex: proto.Int32(playerEx.Sex),
|
||||||
|
Coin: proto.Int64(playerEx.Coin),
|
||||||
|
Pos: proto.Int(playerEx.Pos),
|
||||||
|
Flag: proto.Int(playerEx.GetFlag()),
|
||||||
|
City: proto.String(playerEx.City),
|
||||||
|
HeadOutLine: proto.Int32(playerEx.HeadOutLine),
|
||||||
|
VIP: proto.Int32(playerEx.VIP),
|
||||||
|
}
|
||||||
|
pack.Player = pd
|
||||||
|
}
|
||||||
|
|
||||||
|
//get data
|
||||||
|
Response, err := slots.SlotsMgrSington.Enter(playerEx.SlotsSession, int64(s.GameId))
|
||||||
|
if err == nil {
|
||||||
|
data := assemble.DataToCli(Response).(assemble.TableInfo)
|
||||||
|
pi, _ := json.Marshal(data)
|
||||||
|
pack.PlayerInfo = string(pi)
|
||||||
|
if sceneEx.BetConfig == nil {
|
||||||
|
sceneEx.BetConfig = &data.BetConfig
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.Logger.Error("slots enter err:", err)
|
||||||
|
}
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
return pack
|
||||||
|
}
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
|
||||||
|
if s.GetSceneState() != nil {
|
||||||
|
if s.GetSceneState().OnPlayerOp(s, p, opcode, params) {
|
||||||
|
p.SetLastOPTimer(time.Now())
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *ScenePolicyGatesOfOlympus) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
|
||||||
|
if s.GetSceneState() != nil {
|
||||||
|
s.GetSceneState().OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前状态能否换桌
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if s.GetSceneState() != nil {
|
||||||
|
return s.GetSceneState().CanChangeCoinScene(s, p)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态基类
|
||||||
|
type SceneBaseStateGatesOfOlympus struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) GetTimeout(s *base.Scene) int {
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
return int(time.Now().Sub(sceneEx.GetStateStartTime()) / time.Second)
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) CanChangeTo(s base.SceneState) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前状态能否换桌
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) OnEnter(s *base.Scene) {
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
sceneEx.SetStateStartTime(time.Now())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) OnLeave(s *base.Scene) {}
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) OnTick(s *base.Scene) {
|
||||||
|
if time.Now().Sub(s.GameStartTime) > time.Second*3 {
|
||||||
|
if sceneEx, ok := s.ExtraData.(*GatesOfOlympusSceneData); ok {
|
||||||
|
for _, p := range sceneEx.players {
|
||||||
|
if p.IsOnLine() {
|
||||||
|
p.leaveTime = 0
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
p.leaveTime++
|
||||||
|
if p.leaveTime < 60*2 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
//踢出玩家
|
||||||
|
sceneEx.PlayerLeave(p.Player, common.PlayerLeaveReason_LongTimeNoOp, true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
s.GameStartTime = time.Now()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
func (this *SceneBaseStateGatesOfOlympus) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
}
|
||||||
|
|
||||||
|
// ////////////////////////////////////////////////////////////
|
||||||
|
// 开始状态
|
||||||
|
// ////////////////////////////////////////////////////////////
|
||||||
|
type SceneStateStartGatesOfOlympus struct {
|
||||||
|
SceneBaseStateGatesOfOlympus
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) GetState() int {
|
||||||
|
return gatesofolympus.GatesOfOlympusStateStart
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) CanChangeTo(s base.SceneState) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 当前状态能否换桌
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
if playerEx, ok := p.GetExtraData().(*GatesOfOlympusPlayerData); ok {
|
||||||
|
if playerEx.isFree {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) GetTimeout(s *base.Scene) int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) OnEnter(s *base.Scene) {
|
||||||
|
this.SceneBaseStateGatesOfOlympus.OnEnter(s)
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
sceneEx.SetGameNowTime(time.Now())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态离开时
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) OnLeave(s *base.Scene) {
|
||||||
|
this.SceneBaseStateGatesOfOlympus.OnLeave(s)
|
||||||
|
logger.Logger.Tracef("(this *SceneStateStartGatesOfOlympus) OnLeave, sceneid=%v", s.GetSceneId())
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家操作
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
logger.Logger.Tracef("(this *SceneStateStartGatesOfOlympus) OnPlayerOp, sceneid=%v params=%v", s.GetSceneId(), params)
|
||||||
|
if this.SceneBaseStateGatesOfOlympus.OnPlayerOp(s, p, opcode, params) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*GatesOfOlympusSceneData); ok {
|
||||||
|
if playerEx, ok := p.GetExtraData().(*GatesOfOlympusPlayerData); ok {
|
||||||
|
switch opcode {
|
||||||
|
case gatesofolympus.GatesOfOlympusPlayerOpStart:
|
||||||
|
playerEx.Clear()
|
||||||
|
if len(params) < 4 {
|
||||||
|
pack := &protocol.SCGatesOfOlympusBilled{
|
||||||
|
OpRetCode: proto.Int32(1),
|
||||||
|
}
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
logger.Logger.Trace("SCGatesOfOlympusBilled", pack.String())
|
||||||
|
playerEx.SendToClient(int(protocol.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED), pack)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
playerEx.BetSizeIndex = params[0]
|
||||||
|
playerEx.BetLevelIndex = params[1]
|
||||||
|
playerEx.BetLineIndex = params[2]
|
||||||
|
playerEx.BetMode = params[3]
|
||||||
|
needCoin := sceneEx.BetConfig.BetSize[params[0]] * float64(sceneEx.BetConfig.BetLevel[params[1]]) *
|
||||||
|
float64(sceneEx.BetConfig.BetLines[params[2]]) * float64(sceneEx.BetConfig.BaseBet[params[2]])
|
||||||
|
if needCoin > float64(playerEx.Coin) && !playerEx.isFree {
|
||||||
|
pack := &protocol.SCGatesOfOlympusBilled{
|
||||||
|
OpRetCode: proto.Int32(1),
|
||||||
|
}
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
logger.Logger.Trace("SCGatesOfOlympusBilled:", pack.String())
|
||||||
|
playerEx.SendToClient(int(protocol.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED), pack)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
//playerEx.SlotsSession.SetCoin(playerEx.Coin * gatesofolympus.NowByte)
|
||||||
|
//logger.Logger.Trace("=============init dif coin", playerEx.Coin-playerEx.SlotsSession.Coin()/gatesofolympus.NowByte)
|
||||||
|
|
||||||
|
//get data
|
||||||
|
Response, err := slots.SlotsMgrSington.Play(playerEx.SlotsSession, &base.SpinReq{
|
||||||
|
GameId: int64(sceneEx.GameId),
|
||||||
|
BetSizeIndex: playerEx.BetSizeIndex,
|
||||||
|
BetLevelIndex: playerEx.BetLevelIndex,
|
||||||
|
BetLineIndex: playerEx.BetLineIndex,
|
||||||
|
BetMode: playerEx.BetMode,
|
||||||
|
Ts: time.Now().Unix(),
|
||||||
|
})
|
||||||
|
var gameEndStr string
|
||||||
|
var data assemble.GameEnd
|
||||||
|
if err == nil {
|
||||||
|
s.SetGameNowTime(time.Now())
|
||||||
|
data = assemble.DataToCli(Response).(assemble.GameEnd)
|
||||||
|
|
||||||
|
data.BetSizeIndex = playerEx.BetSizeIndex
|
||||||
|
data.BetLevelIndex = playerEx.BetLevelIndex
|
||||||
|
data.LinesIndex = playerEx.BetLineIndex
|
||||||
|
//data.BaseBetIndex = 1
|
||||||
|
|
||||||
|
data.Results[0].BetMode = playerEx.BetMode
|
||||||
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
|
//logger.Logger.Trace("=====================AddCoin=====TotalBet===", -data.TotalBet)
|
||||||
|
//第一次触发或者正常模式
|
||||||
|
playerEx.AddCoin(int64(-data.TotalBet), common.GainWay_HundredSceneLost, base.SyncFlag_ToClient, "system", s.GetSceneName())
|
||||||
|
playerEx.totalBet = int64(data.TotalBet)
|
||||||
|
}
|
||||||
|
var taxCoin float64
|
||||||
|
if data.RoundReward > 0 {
|
||||||
|
//税收比例
|
||||||
|
taxRate := sceneEx.GetDBGameFree().GetTaxRate()
|
||||||
|
if taxRate < 0 || taxRate > 10000 {
|
||||||
|
taxRate = 500
|
||||||
|
}
|
||||||
|
taxCoin = data.RoundReward * float64(taxRate) / 10000
|
||||||
|
data.RoundReward = data.RoundReward - taxCoin
|
||||||
|
playerEx.AddServiceFee(int64(taxCoin))
|
||||||
|
playerEx.taxCoin = int64(taxCoin)
|
||||||
|
playerEx.winCoin = int64(data.RoundReward)
|
||||||
|
}
|
||||||
|
pi, _ := json.Marshal(data)
|
||||||
|
gameEndStr = string(pi)
|
||||||
|
|
||||||
|
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||||
|
//logger.Logger.Trace("=====================AddCoin=====RoundReward===", data.RoundReward)
|
||||||
|
playerEx.AddCoin(int64(data.RoundReward), common.GainWay_HundredSceneWin, 0, "system", s.GetSceneName())
|
||||||
|
//免费游戏结束或者正常模式
|
||||||
|
sceneEx.StaticsLaba(&base.StaticLabaParam{
|
||||||
|
SnId: playerEx.SnId,
|
||||||
|
Gain: int64(data.RoundReward - data.TotalBet),
|
||||||
|
GainTax: int64(taxCoin),
|
||||||
|
IsAddTimes: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if data.Results[0].FreeNum > 0 {
|
||||||
|
playerEx.isFree = true
|
||||||
|
} else {
|
||||||
|
playerEx.isFree = false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
logger.Logger.Error("slots Play err:", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
playerEx.SlotsSession.SetCoin(int64(data.FinalCoin) * gatesofolympus.NowByte)
|
||||||
|
//logger.Logger.Trace("=====================end===== playerEx.Coin===", playerEx.Coin)
|
||||||
|
//logger.Logger.Trace("=====================end===== data.FinalCoin===", data.FinalCoin)
|
||||||
|
|
||||||
|
pack := &protocol.SCGatesOfOlympusBilled{
|
||||||
|
OpRetCode: proto.Int32(0),
|
||||||
|
GameEndStr: proto.String(gameEndStr),
|
||||||
|
}
|
||||||
|
proto.SetDefaults(pack)
|
||||||
|
logger.Logger.Trace("SCGatesOfOlympusBilled", pack.String())
|
||||||
|
playerEx.SendToClient(int(protocol.GatesOfOlympusPID_PACKET_GATESOFOLYMPUS_SCGATESOFOLYMPUSBILLED), pack)
|
||||||
|
|
||||||
|
if playerEx.Coin != int64(data.FinalCoin) {
|
||||||
|
logger.Logger.Error("==========playerEx.Coin != Response.Coin==============", playerEx.Coin, data.FinalCoin)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 记录本次操作
|
||||||
|
GatesOfOlympusAndSaveLog(sceneEx, playerEx, data)
|
||||||
|
case 1000:
|
||||||
|
playerEx.Save(0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 玩家事件
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
logger.Logger.Trace("(this *SceneStateStartGatesOfOlympus) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " evtcode=", evtcode)
|
||||||
|
this.SceneBaseStateGatesOfOlympus.OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneStateStartGatesOfOlympus) OnTick(s *base.Scene) {
|
||||||
|
this.SceneBaseStateGatesOfOlympus.OnTick(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
// //////////////////////////////////////////////////////////////////////////////
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) RegisteSceneState(state base.SceneState) {
|
||||||
|
if state == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
stateid := state.GetState()
|
||||||
|
if stateid < 0 || stateid >= gatesofolympus.GatesOfOlympusStateMax {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.states[stateid] = state
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *ScenePolicyGatesOfOlympus) GetSceneState(s *base.Scene, stateid int) base.SceneState {
|
||||||
|
if stateid >= 0 && stateid < gatesofolympus.GatesOfOlympusStateMax {
|
||||||
|
return this.states[stateid]
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func GatesOfOlympusAndSaveLog(sceneEx *GatesOfOlympusSceneData, playerEx *GatesOfOlympusPlayerData, data assemble.GameEnd) {
|
||||||
|
if !playerEx.IsRob {
|
||||||
|
data.SnId = playerEx.SnId
|
||||||
|
if data.Results[0].FreeStatus != 1 && data.Results[0].FreeNumMax != 0 {
|
||||||
|
data.TotalBet = 0
|
||||||
|
}
|
||||||
|
info, err := model.MarshalGameNoteByROLL(data)
|
||||||
|
if err == nil {
|
||||||
|
logid, _ := model.AutoIncGameLogId()
|
||||||
|
playerEx.currentLogId = logid
|
||||||
|
var totalin, totalout int64
|
||||||
|
if data.Results[0].FreeStatus == 1 || data.Results[0].FreeNumMax == 0 {
|
||||||
|
totalin = playerEx.totalBet
|
||||||
|
}
|
||||||
|
if data.Results[0].FreeStatus == 3 || data.Results[0].FreeNumMax == 0 {
|
||||||
|
totalout = int64(data.RoundReward) + playerEx.taxCoin
|
||||||
|
}
|
||||||
|
playerEx.Cache(sceneEx.Scene, &base.SaveGameDetailedParam{
|
||||||
|
LogId: logid,
|
||||||
|
Detail: info,
|
||||||
|
}, &base.SaveGamePlayerListLogParam{
|
||||||
|
LogId: logid,
|
||||||
|
Platform: playerEx.Platform,
|
||||||
|
Snid: playerEx.SnId,
|
||||||
|
PlayerName: playerEx.Name,
|
||||||
|
TotalIn: totalin,
|
||||||
|
TotalOut: totalout,
|
||||||
|
TaxCoin: playerEx.taxCoin,
|
||||||
|
BetAmount: totalin,
|
||||||
|
WinAmountNoAnyTax: totalout - totalin - playerEx.taxCoin,
|
||||||
|
IsFirstGame: sceneEx.IsPlayerFirst(playerEx.Player),
|
||||||
|
IsFree: playerEx.isFree,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//统计输下注金币数
|
||||||
|
if !sceneEx.Testing && !playerEx.IsRob {
|
||||||
|
playerBet := &server.PlayerData{
|
||||||
|
SnId: proto.Int32(playerEx.SnId),
|
||||||
|
Bet: proto.Int64(playerEx.CurrentBet),
|
||||||
|
Gain: proto.Int64(int64(data.RoundReward) + playerEx.taxCoin),
|
||||||
|
Tax: proto.Int64(playerEx.taxCoin),
|
||||||
|
Coin: proto.Int64(playerEx.GetCoin()),
|
||||||
|
GameCoinTs: proto.Int64(playerEx.GameCoinTs),
|
||||||
|
}
|
||||||
|
gwPlayerBet := &server.GWPlayerData{
|
||||||
|
SceneId: sceneEx.SceneId,
|
||||||
|
GameFreeId: proto.Int32(sceneEx.GetDBGameFree().GetId()),
|
||||||
|
}
|
||||||
|
gwPlayerBet.Datas = append(gwPlayerBet.Datas, playerBet)
|
||||||
|
sceneEx.SyncPlayerDatas(&base.PlayerDataParam{
|
||||||
|
HasRobotGaming: false,
|
||||||
|
Data: gwPlayerBet,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
playerEx.taxCoin = 0
|
||||||
|
playerEx.winCoin = 0
|
||||||
|
|
||||||
|
if sceneEx.CheckNeedDestroy() && data.Results[0].FreeNum <= 0 {
|
||||||
|
sceneEx.SceneDestroy(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func init() {
|
||||||
|
//主状态
|
||||||
|
ScenePolicyGatesOfOlympusSington.RegisteSceneState(&SceneStateStartGatesOfOlympus{})
|
||||||
|
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||||
|
base.RegisteScenePolicy(common.GameId_GatesOfOlympus, gatesofolympus.RoomMode_Classic, ScenePolicyGatesOfOlympusSington)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -36,6 +36,7 @@ import (
|
||||||
_ "mongo.games.com/game/gamesrv/fortunerabbit"
|
_ "mongo.games.com/game/gamesrv/fortunerabbit"
|
||||||
_ "mongo.games.com/game/gamesrv/fortunetiger"
|
_ "mongo.games.com/game/gamesrv/fortunetiger"
|
||||||
_ "mongo.games.com/game/gamesrv/fruits"
|
_ "mongo.games.com/game/gamesrv/fruits"
|
||||||
|
_ "mongo.games.com/game/gamesrv/gatesofolympus"
|
||||||
_ "mongo.games.com/game/gamesrv/iceage"
|
_ "mongo.games.com/game/gamesrv/iceage"
|
||||||
_ "mongo.games.com/game/gamesrv/richblessed"
|
_ "mongo.games.com/game/gamesrv/richblessed"
|
||||||
_ "mongo.games.com/game/gamesrv/slotspkg/slots"
|
_ "mongo.games.com/game/gamesrv/slotspkg/slots"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package thirteen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/protocol/pushcoin"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
"mongo.games.com/goserver/core/netlib"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
common.Register(int(pushcoin.PushCoinPacketID_PACKET_CSPushCoinPlayerOp), &pushcoin.CSPushCoinPlayerOp{}, CSPushCoinPlayerOp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CSPushCoinPlayerOp(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
||||||
|
logger.Logger.Trace("CSPlayerOpHandler Process recv ", data)
|
||||||
|
if msg, ok := data.(*pushcoin.CSPushCoinPlayerOp); ok {
|
||||||
|
p := base.PlayerMgrSington.GetPlayer(sid)
|
||||||
|
if p == nil {
|
||||||
|
logger.Logger.Warn("CSPlayerOpHandler p == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
scene := p.GetScene()
|
||||||
|
if scene == nil {
|
||||||
|
logger.Logger.Warn("CSPlayerOpHandler p.scene == nil")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if scene.KeyGameDif != common.GameDifPushCoin {
|
||||||
|
logger.Logger.Error("CSPlayerOpHandler gameId Error ", scene.GameId)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if !scene.HasPlayer(p) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
sp := scene.GetScenePolicy()
|
||||||
|
if sp != nil {
|
||||||
|
sp.OnPlayerOp(scene, p, int(msg.GetOpCode()), msg.GetOpParam())
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package thirteen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GameData struct {
|
||||||
|
Shake int32 // 震动次数
|
||||||
|
Refresh int64 // 刷新次数
|
||||||
|
Power int64 // 能量值
|
||||||
|
Base int64 // 底注
|
||||||
|
}
|
||||||
|
|
||||||
|
type PlayerEx struct {
|
||||||
|
*base.Player //玩家信息
|
||||||
|
*GameData
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPushCoinPlayerData(p *base.Player, data *GameData) *PlayerEx {
|
||||||
|
playerEx := &PlayerEx{
|
||||||
|
Player: p,
|
||||||
|
GameData: data,
|
||||||
|
}
|
||||||
|
return playerEx
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package thirteen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
rule "mongo.games.com/game/gamerule/pushcoin"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/protocol/pushcoin"
|
||||||
|
"mongo.games.com/game/srvdata"
|
||||||
|
)
|
||||||
|
|
||||||
|
type SceneEx struct {
|
||||||
|
*base.Scene //场景
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPushCoinSceneData(s *base.Scene) *SceneEx {
|
||||||
|
sceneEx := &SceneEx{
|
||||||
|
Scene: s,
|
||||||
|
}
|
||||||
|
return sceneEx
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *SceneEx) CreateRoomInfoPacket(s *base.Scene, p *base.Player) *pushcoin.SCPushCoinRoomInfo {
|
||||||
|
playerEx, ok := p.ExtraData.(*PlayerEx)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
roomInfo := &pushcoin.SCPushCoinRoomInfo{
|
||||||
|
RoomId: int32(s.GetSceneId()),
|
||||||
|
GameId: s.GameId,
|
||||||
|
RoomMode: int32(s.GetSceneMode()),
|
||||||
|
Params: common.CopySliceInt64ToInt32(s.GetParams()),
|
||||||
|
State: int32(s.GetSceneState().GetState()),
|
||||||
|
TimeOut: int32(s.GetSceneState().GetTimeout(s)),
|
||||||
|
BetList: s.GetDBGameFree().GetOtherIntParams(),
|
||||||
|
}
|
||||||
|
|
||||||
|
player := pushcoin.PushCoinPlayerData{
|
||||||
|
Name: p.Name,
|
||||||
|
SnId: p.SnId,
|
||||||
|
Head: p.Head,
|
||||||
|
Sex: p.Sex,
|
||||||
|
Coin: p.Coin,
|
||||||
|
Flag: int32(p.Flags),
|
||||||
|
VIP: p.VIP,
|
||||||
|
RoleId: p.Roles.ModId,
|
||||||
|
Level: p.Level,
|
||||||
|
Exp: p.Exp,
|
||||||
|
ShakeTimes: playerEx.Shake,
|
||||||
|
BaseCoin: playerEx.Base,
|
||||||
|
PowerLine: playerEx.Power,
|
||||||
|
PowerLineMax: rule.PowerMax,
|
||||||
|
RefreshTimes: playerEx.Refresh,
|
||||||
|
}
|
||||||
|
if p.Roles != nil {
|
||||||
|
player.RoleId = p.Roles.ModId
|
||||||
|
}
|
||||||
|
if p.Skin != nil {
|
||||||
|
player.SkinId = p.Skin.ModId
|
||||||
|
}
|
||||||
|
|
||||||
|
roomInfo.Players = append(roomInfo.Players, &player)
|
||||||
|
|
||||||
|
for _, v := range srvdata.PBDB_PropExchangeMgr.Datas.Arr {
|
||||||
|
if v.GetGroup() == 2 {
|
||||||
|
roomInfo.ExchangeList = append(roomInfo.ExchangeList, &pushcoin.ExchangeInfo{
|
||||||
|
Id: v.GetId(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return roomInfo
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,332 @@
|
||||||
|
package thirteen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"mongo.games.com/goserver/core"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/common"
|
||||||
|
rule "mongo.games.com/game/gamerule/pushcoin"
|
||||||
|
"mongo.games.com/game/gamesrv/base"
|
||||||
|
"mongo.games.com/game/model"
|
||||||
|
"mongo.games.com/game/protocol/pushcoin"
|
||||||
|
)
|
||||||
|
|
||||||
|
var PolicySingleton = &Policy{}
|
||||||
|
|
||||||
|
type Policy struct {
|
||||||
|
base.BaseScenePolicy
|
||||||
|
states [rule.GameStateMax]base.SceneState
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnStart(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *PushCoinPolicy) OnStart, sceneId=", s.GetSceneId())
|
||||||
|
sceneEx := NewPushCoinSceneData(s)
|
||||||
|
if sceneEx != nil {
|
||||||
|
s.ExtraData = sceneEx
|
||||||
|
s.ChangeSceneState(rule.GameStatePlay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnStop(s *base.Scene) {
|
||||||
|
logger.Logger.Trace("(this *Policy) OnStop , sceneId=", s.GetSceneId())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnTick(s *base.Scene) {
|
||||||
|
if s == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if s.SceneState != nil {
|
||||||
|
s.SceneState.OnTick(s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerEnter(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data := p.GDatas[s.KeyGamefreeId]
|
||||||
|
if data == nil {
|
||||||
|
data = &model.PlayerGameInfo{}
|
||||||
|
p.GDatas[s.KeyGamefreeId] = data
|
||||||
|
}
|
||||||
|
|
||||||
|
gamedata := &GameData{}
|
||||||
|
if data.DataEx != nil {
|
||||||
|
err := json.Unmarshal(data.DataEx, gamedata)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("OnPlayerEnter, json.Unmarshal error, err=", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 底注
|
||||||
|
baseCoins := s.GetDBGameFree().GetOtherIntParams()
|
||||||
|
if len(baseCoins) > 0 {
|
||||||
|
gamedata.Base = baseCoins[0]
|
||||||
|
} else {
|
||||||
|
gamedata.Base = 5000
|
||||||
|
}
|
||||||
|
gamedata.Power = rule.PowerInit
|
||||||
|
}
|
||||||
|
|
||||||
|
p.ExtraData = NewPushCoinPlayerData(p, gamedata)
|
||||||
|
//给自己发送房间信息
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventEnter, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerLeave(s *base.Scene, p *base.Player, reason int) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
|
||||||
|
playerEx, ok := p.ExtraData.(*PlayerEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
data := p.GDatas[s.KeyGamefreeId]
|
||||||
|
if data == nil {
|
||||||
|
data = &model.PlayerGameInfo{}
|
||||||
|
p.GDatas[s.KeyGamefreeId] = data
|
||||||
|
}
|
||||||
|
|
||||||
|
b, err := json.Marshal(playerEx.GameData)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Error("OnPlayerLeave, json.Marshal error, err=", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
data.DataEx = b
|
||||||
|
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventLeave, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerDropLine(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventDropLine, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerRehold(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventRehold, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerReturn(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerRehold, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.PlayerEventReturn, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
|
||||||
|
if s.SceneState != nil {
|
||||||
|
p.LastOPTimer = time.Now()
|
||||||
|
return s.SceneState.OnPlayerOp(s, p, opcode, params)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnPlayerEvent, sceneId=", s.GetSceneId(), " player=", p.SnId, " eventcode=", evtcode, " params=", params)
|
||||||
|
if s.SceneState != nil {
|
||||||
|
s.SceneState.OnPlayerEvent(s, p, evtcode, params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnAudienceEnter(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnAudienceEnter, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
if sceneEx, ok := s.ExtraData.(*SceneEx); ok {
|
||||||
|
//给自己发送房间信息
|
||||||
|
this.SendRoomInfo(s, p, sceneEx)
|
||||||
|
s.FirePlayerEvent(p, base.AudienceEventEnter, nil)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnAudienceLeave(s *base.Scene, p *base.Player, reason int) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnAudienceLeave, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
s.FirePlayerEvent(p, base.AudienceEventLeave, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnAudienceDropLine(s *base.Scene, p *base.Player) {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Logger.Trace("(this *Policy) OnAudienceDropLine, sceneId=", s.GetSceneId(), " player=", p.SnId)
|
||||||
|
s.AudienceLeave(p, common.PlayerLeaveReason_DropLine)
|
||||||
|
s.FirePlayerEvent(p, base.AudienceEventDropLine, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) OnAudienceSit(s *base.Scene, p *base.Player) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) IsCompleted(s *base.Scene) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) IsCanForceStart(s *base.Scene) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) ForceStart(s *base.Scene) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
if s == nil || p == nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if s.SceneState != nil {
|
||||||
|
return s.SceneState.CanChangeCoinScene(s, p)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) SendRoomInfo(s *base.Scene, p *base.Player, sceneEx *SceneEx) {
|
||||||
|
pack := sceneEx.CreateRoomInfoPacket(s, p)
|
||||||
|
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinRoomInfo), pack)
|
||||||
|
}
|
||||||
|
|
||||||
|
//=====================================
|
||||||
|
// StateGaming 游戏中
|
||||||
|
//=====================================
|
||||||
|
|
||||||
|
type StateGaming struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) CanChangeCoinScene(s *base.Scene, p *base.Player) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) OnLeave(s *base.Scene) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) GetState() int {
|
||||||
|
return rule.GameStatePlay
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) CanChangeTo(s base.SceneState) bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) GetTimeout(s *base.Scene) int {
|
||||||
|
if sceneEx, ok := s.GetExtraData().(*SceneEx); ok {
|
||||||
|
return int(time.Now().Sub(sceneEx.StateStartTime) / time.Second)
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) OnEnter(s *base.Scene) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) OnTick(s *base.Scene) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *StateGaming) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, params []int64) bool {
|
||||||
|
logger.Logger.Trace("(this *StateGaming) OnPlayerOp, sceneId=", s.GetSceneId(), " player=", p.SnId, " opcode=", opcode, " params=", params)
|
||||||
|
_, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
_, ok = p.ExtraData.(*PlayerEx)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
pack := &pushcoin.SCPushCoinPlayerOp{
|
||||||
|
OpRetCode: pushcoin.OpResultCode_OPRC_Error,
|
||||||
|
OpCode: pushcoin.OpCodes(opcode),
|
||||||
|
}
|
||||||
|
|
||||||
|
switch pushcoin.OpCodes(opcode) {
|
||||||
|
case pushcoin.OpCodes_OP_Bet:
|
||||||
|
|
||||||
|
case pushcoin.OpCodes_OP_Gain:
|
||||||
|
|
||||||
|
case pushcoin.OpCodes_OP_Shake:
|
||||||
|
|
||||||
|
case pushcoin.OpCodes_OP_Refresh:
|
||||||
|
|
||||||
|
case pushcoin.OpCodes_OP_Exchange:
|
||||||
|
|
||||||
|
case pushcoin.OpCodes_OP_Draw:
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
p.SendToClient(int(pushcoin.PushCoinPacketID_PACKET_SCPushCoinPlayerOp), pack)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) RegisteSceneState(state base.SceneState) {
|
||||||
|
if state == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
id := state.GetState()
|
||||||
|
if id < 0 || id >= rule.GameStateMax {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.states[id] = state
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *Policy) GetSceneState(s *base.Scene, stateid int) base.SceneState {
|
||||||
|
if stateid >= 0 && stateid < rule.GameStateMax {
|
||||||
|
return this.states[stateid]
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
PolicySingleton.RegisteSceneState(&StateGaming{})
|
||||||
|
core.RegisteHook(core.HOOK_BEFORE_START, func() error {
|
||||||
|
base.RegisteScenePolicy(common.GameId_PushCoin, 0, PolicySingleton)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ type CustomFortune struct {
|
||||||
FreeNumMax int64 `json:"fnm"` //总次数
|
FreeNumMax int64 `json:"fnm"` //总次数
|
||||||
FreeNumTrigger int64 `json:"fnt"` //新增freespin
|
FreeNumTrigger int64 `json:"fnt"` //新增freespin
|
||||||
ForceRound int64 `json:"fr"` //第n次
|
ForceRound int64 `json:"fr"` //第n次
|
||||||
|
ScatterWin int64 `json:"sw,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDataByTheme(NodeTree *shared.LiteNodeTree) (map[int64]*shared.SpinLock, CustomFortune, int64) {
|
func getDataByTheme(NodeTree *shared.LiteNodeTree) (map[int64]*shared.SpinLock, CustomFortune, int64) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 检查 "external" 目录是否存在,如果存在,则进入目录
|
||||||
|
if [ -d "external" ]; then
|
||||||
|
cd external
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查 converter 文件是否存在
|
||||||
|
if [ ! -f "converter" ]; then
|
||||||
|
echo "Building converter..."
|
||||||
|
go build -o converter ../tools/converter
|
||||||
|
else
|
||||||
|
echo "converter already exists."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 执行 converter 文件
|
||||||
|
./converter go /excel ../internal/exported/excel2go ..
|
||||||
|
|
||||||
|
echo "Done."
|
||||||
|
read -p "Press [Enter] to exit..."
|
||||||
|
exit 0
|
||||||
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/Multiplier.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/Multiplier.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/S_ReelChoose.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/S_ReelChoose.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/Scatter.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Feature/Scatter.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/Formation.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/Formation.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin1.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin1.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin2.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin2.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin3.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin3.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin7.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin7.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin8.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelBaseSpin8.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin4.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin4.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin5.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/ReelFreeSpin5.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/S_Map.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/S_Map.xlsx
vendored
Normal file
Binary file not shown.
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/Symbol.xlsx
vendored
Normal file
BIN
gamesrv/slotspkg/external/excel/Base/Slots/GatesOfOlympus/Generic/Symbol.xlsx
vendored
Normal file
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
|
@ -120,6 +120,46 @@ var (
|
||||||
FortuneTigerSuperStackWeight = []*structs.FortuneTigerSuperStackWeight{}
|
FortuneTigerSuperStackWeight = []*structs.FortuneTigerSuperStackWeight{}
|
||||||
FortuneTigerSymbolBetRatio = []*structs.FortuneTigerSymbolBetRatio{}
|
FortuneTigerSymbolBetRatio = []*structs.FortuneTigerSymbolBetRatio{}
|
||||||
FortuneTigerSymbol = map[int64]*structs.FortuneTigerSymbol{}
|
FortuneTigerSymbol = map[int64]*structs.FortuneTigerSymbol{}
|
||||||
|
GatesOfOlympusBetBetChangeList = map[int64]*structs.GatesOfOlympusBetBetChangeList{}
|
||||||
|
GatesOfOlympusBetBetLevel = map[int64]*structs.GatesOfOlympusBetBetLevel{}
|
||||||
|
GatesOfOlympusBetBetLine = map[int64]*structs.GatesOfOlympusBetBetLine{}
|
||||||
|
GatesOfOlympusBetBetSize = map[int64]*structs.GatesOfOlympusBetBetSize{}
|
||||||
|
GatesOfOlympusBetFirstBet = map[int64]*structs.GatesOfOlympusBetFirstBet{}
|
||||||
|
GatesOfOlympusFormation = []*structs.GatesOfOlympusFormation{}
|
||||||
|
GatesOfOlympusMapRTPMode = map[int64]*structs.GatesOfOlympusMapRTPMode{}
|
||||||
|
GatesOfOlympusMultiplier = []*structs.GatesOfOlympusMultiplier{}
|
||||||
|
GatesOfOlympusMultiplierKeyID = map[int64]*structs.GatesOfOlympusMultiplierKeyID{}
|
||||||
|
GatesOfOlympusReelBaseSpin1Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin1Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin1Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelBaseSpin2Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin2Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin2Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelBaseSpin3Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin3Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin3Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelBaseSpin7Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin7Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin7Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelBaseSpin8Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin8Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpin8Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelBaseSpinRange = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpinReel = [][]int64{}
|
||||||
|
GatesOfOlympusReelBaseSpinWeight = [][]float64{}
|
||||||
|
GatesOfOlympusReelChoose = []*structs.GatesOfOlympusReelChoose{}
|
||||||
|
GatesOfOlympusReelFreeSpin4Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpin4Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpin4Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelFreeSpin5Range = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpin5Reel = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpin5Weight = [][]float64{}
|
||||||
|
GatesOfOlympusReelFreeSpinRange = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpinReel = [][]int64{}
|
||||||
|
GatesOfOlympusReelFreeSpinWeight = [][]float64{}
|
||||||
|
GatesOfOlympusScatter = map[int64]*structs.GatesOfOlympusScatter{}
|
||||||
|
GatesOfOlympusSymbolBetRatio = []*structs.GatesOfOlympusSymbolBetRatio{}
|
||||||
|
GatesOfOlympusSymbol = map[int64]*structs.GatesOfOlympusSymbol{}
|
||||||
MatrixFeaturesForm15X1TypeA = []*structs.MatrixFeaturesForm15X1TypeA{}
|
MatrixFeaturesForm15X1TypeA = []*structs.MatrixFeaturesForm15X1TypeA{}
|
||||||
MatrixFeaturesForm19X1TypeA = []*structs.MatrixFeaturesForm19X1TypeA{}
|
MatrixFeaturesForm19X1TypeA = []*structs.MatrixFeaturesForm19X1TypeA{}
|
||||||
MatrixFeaturesForm20X1TypeA = []*structs.MatrixFeaturesForm20X1TypeA{}
|
MatrixFeaturesForm20X1TypeA = []*structs.MatrixFeaturesForm20X1TypeA{}
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,46 @@ func StoragesLoading(data map[string]string) {
|
||||||
Load(data, "Base.FortuneTiger/SuperStack.Weight", &base.FortuneTigerSuperStackWeight)
|
Load(data, "Base.FortuneTiger/SuperStack.Weight", &base.FortuneTigerSuperStackWeight)
|
||||||
Load(data, "Base.FortuneTiger/Symbol.BetRatio", &base.FortuneTigerSymbolBetRatio)
|
Load(data, "Base.FortuneTiger/Symbol.BetRatio", &base.FortuneTigerSymbolBetRatio)
|
||||||
Load(data, "Base.FortuneTiger/Symbol.Default", &base.FortuneTigerSymbol)
|
Load(data, "Base.FortuneTiger/Symbol.Default", &base.FortuneTigerSymbol)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Bet.BetChangeList", &base.GatesOfOlympusBetBetChangeList)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Bet.BetLevel", &base.GatesOfOlympusBetBetLevel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Bet.BetLine", &base.GatesOfOlympusBetBetLine)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Bet.BetSize", &base.GatesOfOlympusBetBetSize)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Bet.FirstBet", &base.GatesOfOlympusBetFirstBet)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Formation.Default", &base.GatesOfOlympusFormation)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Map.RTPMode", &base.GatesOfOlympusMapRTPMode)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Multiplier.Default", &base.GatesOfOlympusMultiplier)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Multiplier.Default/ID", &base.GatesOfOlympusMultiplierKeyID)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin1.Range", &base.GatesOfOlympusReelBaseSpin1Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin1.Reel", &base.GatesOfOlympusReelBaseSpin1Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin1.Weight", &base.GatesOfOlympusReelBaseSpin1Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin2.Range", &base.GatesOfOlympusReelBaseSpin2Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin2.Reel", &base.GatesOfOlympusReelBaseSpin2Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin2.Weight", &base.GatesOfOlympusReelBaseSpin2Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin3.Range", &base.GatesOfOlympusReelBaseSpin3Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin3.Reel", &base.GatesOfOlympusReelBaseSpin3Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin3.Weight", &base.GatesOfOlympusReelBaseSpin3Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin7.Range", &base.GatesOfOlympusReelBaseSpin7Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin7.Reel", &base.GatesOfOlympusReelBaseSpin7Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin7.Weight", &base.GatesOfOlympusReelBaseSpin7Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin8.Range", &base.GatesOfOlympusReelBaseSpin8Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin8.Reel", &base.GatesOfOlympusReelBaseSpin8Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin8.Weight", &base.GatesOfOlympusReelBaseSpin8Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin.Range", &base.GatesOfOlympusReelBaseSpinRange)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin.Reel", &base.GatesOfOlympusReelBaseSpinReel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelBaseSpin.Weight", &base.GatesOfOlympusReelBaseSpinWeight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelChoose.Default", &base.GatesOfOlympusReelChoose)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin4.Range", &base.GatesOfOlympusReelFreeSpin4Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin4.Reel", &base.GatesOfOlympusReelFreeSpin4Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin4.Weight", &base.GatesOfOlympusReelFreeSpin4Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin5.Range", &base.GatesOfOlympusReelFreeSpin5Range)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin5.Reel", &base.GatesOfOlympusReelFreeSpin5Reel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin5.Weight", &base.GatesOfOlympusReelFreeSpin5Weight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin.Range", &base.GatesOfOlympusReelFreeSpinRange)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin.Reel", &base.GatesOfOlympusReelFreeSpinReel)
|
||||||
|
Load(data, "Base.GatesOfOlympus/ReelFreeSpin.Weight", &base.GatesOfOlympusReelFreeSpinWeight)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Scatter.Default", &base.GatesOfOlympusScatter)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Symbol.BetRatio", &base.GatesOfOlympusSymbolBetRatio)
|
||||||
|
Load(data, "Base.GatesOfOlympus/Symbol.Default", &base.GatesOfOlympusSymbol)
|
||||||
Load(data, "Base.Matrix/FeaturesForm15X1TypeA.Default", &base.MatrixFeaturesForm15X1TypeA)
|
Load(data, "Base.Matrix/FeaturesForm15X1TypeA.Default", &base.MatrixFeaturesForm15X1TypeA)
|
||||||
Load(data, "Base.Matrix/FeaturesForm19X1TypeA.Default", &base.MatrixFeaturesForm19X1TypeA)
|
Load(data, "Base.Matrix/FeaturesForm19X1TypeA.Default", &base.MatrixFeaturesForm19X1TypeA)
|
||||||
Load(data, "Base.Matrix/FeaturesForm20X1TypeA.Default", &base.MatrixFeaturesForm20X1TypeA)
|
Load(data, "Base.Matrix/FeaturesForm20X1TypeA.Default", &base.MatrixFeaturesForm20X1TypeA)
|
||||||
|
|
@ -401,6 +441,46 @@ func StoragesMapping() {
|
||||||
Set("Base", "FortuneTiger/SuperStack", "Weight", base.FortuneTigerSuperStackWeight)
|
Set("Base", "FortuneTiger/SuperStack", "Weight", base.FortuneTigerSuperStackWeight)
|
||||||
Set("Base", "FortuneTiger/Symbol", "BetRatio", base.FortuneTigerSymbolBetRatio)
|
Set("Base", "FortuneTiger/Symbol", "BetRatio", base.FortuneTigerSymbolBetRatio)
|
||||||
Set("Base", "FortuneTiger/Symbol", "Default", base.FortuneTigerSymbol)
|
Set("Base", "FortuneTiger/Symbol", "Default", base.FortuneTigerSymbol)
|
||||||
|
Set("Base", "GatesOfOlympus/Bet", "BetChangeList", base.GatesOfOlympusBetBetChangeList)
|
||||||
|
Set("Base", "GatesOfOlympus/Bet", "BetLevel", base.GatesOfOlympusBetBetLevel)
|
||||||
|
Set("Base", "GatesOfOlympus/Bet", "BetLine", base.GatesOfOlympusBetBetLine)
|
||||||
|
Set("Base", "GatesOfOlympus/Bet", "BetSize", base.GatesOfOlympusBetBetSize)
|
||||||
|
Set("Base", "GatesOfOlympus/Bet", "FirstBet", base.GatesOfOlympusBetFirstBet)
|
||||||
|
Set("Base", "GatesOfOlympus/Formation", "Default", base.GatesOfOlympusFormation)
|
||||||
|
Set("Base", "GatesOfOlympus/Map", "RTPMode", base.GatesOfOlympusMapRTPMode)
|
||||||
|
Set("Base", "GatesOfOlympus/Multiplier", "Default", base.GatesOfOlympusMultiplier)
|
||||||
|
Set("Base", "GatesOfOlympus/Multiplier", "Default/ID", base.GatesOfOlympusMultiplierKeyID)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin1", "Range", base.GatesOfOlympusReelBaseSpin1Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin1", "Reel", base.GatesOfOlympusReelBaseSpin1Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin1", "Weight", base.GatesOfOlympusReelBaseSpin1Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin2", "Range", base.GatesOfOlympusReelBaseSpin2Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin2", "Reel", base.GatesOfOlympusReelBaseSpin2Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin2", "Weight", base.GatesOfOlympusReelBaseSpin2Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin3", "Range", base.GatesOfOlympusReelBaseSpin3Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin3", "Reel", base.GatesOfOlympusReelBaseSpin3Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin3", "Weight", base.GatesOfOlympusReelBaseSpin3Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin7", "Range", base.GatesOfOlympusReelBaseSpin7Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin7", "Reel", base.GatesOfOlympusReelBaseSpin7Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin7", "Weight", base.GatesOfOlympusReelBaseSpin7Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin8", "Range", base.GatesOfOlympusReelBaseSpin8Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin8", "Reel", base.GatesOfOlympusReelBaseSpin8Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin8", "Weight", base.GatesOfOlympusReelBaseSpin8Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin", "Range", base.GatesOfOlympusReelBaseSpinRange)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin", "Reel", base.GatesOfOlympusReelBaseSpinReel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelBaseSpin", "Weight", base.GatesOfOlympusReelBaseSpinWeight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelChoose", "Default", base.GatesOfOlympusReelChoose)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin4", "Range", base.GatesOfOlympusReelFreeSpin4Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin4", "Reel", base.GatesOfOlympusReelFreeSpin4Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin4", "Weight", base.GatesOfOlympusReelFreeSpin4Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin5", "Range", base.GatesOfOlympusReelFreeSpin5Range)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin5", "Reel", base.GatesOfOlympusReelFreeSpin5Reel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin5", "Weight", base.GatesOfOlympusReelFreeSpin5Weight)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin", "Range", base.GatesOfOlympusReelFreeSpinRange)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin", "Reel", base.GatesOfOlympusReelFreeSpinReel)
|
||||||
|
Set("Base", "GatesOfOlympus/ReelFreeSpin", "Weight", base.GatesOfOlympusReelFreeSpinWeight)
|
||||||
|
Set("Base", "GatesOfOlympus/Scatter", "Default", base.GatesOfOlympusScatter)
|
||||||
|
Set("Base", "GatesOfOlympus/Symbol", "BetRatio", base.GatesOfOlympusSymbolBetRatio)
|
||||||
|
Set("Base", "GatesOfOlympus/Symbol", "Default", base.GatesOfOlympusSymbol)
|
||||||
Set("Base", "Matrix/FeaturesForm15X1TypeA", "Default", base.MatrixFeaturesForm15X1TypeA)
|
Set("Base", "Matrix/FeaturesForm15X1TypeA", "Default", base.MatrixFeaturesForm15X1TypeA)
|
||||||
Set("Base", "Matrix/FeaturesForm19X1TypeA", "Default", base.MatrixFeaturesForm19X1TypeA)
|
Set("Base", "Matrix/FeaturesForm19X1TypeA", "Default", base.MatrixFeaturesForm19X1TypeA)
|
||||||
Set("Base", "Matrix/FeaturesForm20X1TypeA", "Default", base.MatrixFeaturesForm20X1TypeA)
|
Set("Base", "Matrix/FeaturesForm20X1TypeA", "Default", base.MatrixFeaturesForm20X1TypeA)
|
||||||
|
|
@ -540,6 +620,12 @@ func LinksMapping() {
|
||||||
Link("FortuneTiger/ReelBaseSpin", "Weight/1", "FortuneTiger/ReelBaseSpin", "Weight")
|
Link("FortuneTiger/ReelBaseSpin", "Weight/1", "FortuneTiger/ReelBaseSpin", "Weight")
|
||||||
Link("FortuneTiger/ReelBaseSpin", "Weight/2", "FortuneTiger/ReelBaseSpin", "Weight")
|
Link("FortuneTiger/ReelBaseSpin", "Weight/2", "FortuneTiger/ReelBaseSpin", "Weight")
|
||||||
Link("FortuneTiger/ReelBaseSpin", "Weight/3", "FortuneTiger/ReelBaseSpin", "Weight")
|
Link("FortuneTiger/ReelBaseSpin", "Weight/3", "FortuneTiger/ReelBaseSpin", "Weight")
|
||||||
|
Link("GatesOfOlympus/MatrixSameForm5X6TypeA", "Default", "Matrix/SameForm5X6TypeA", "Default")
|
||||||
|
Link("GatesOfOlympus/MatrixSameForm5X6TypeB", "Default", "Matrix/SameForm5X6TypeB", "Default")
|
||||||
|
Link("GatesOfOlympus/PrizeModel", "Default", "PrizeModel/PrizeModelTypeB", "Default")
|
||||||
|
Link("GatesOfOlympus/ReelBaseSpin1", "Weight/1", "GatesOfOlympus/ReelBaseSpin1", "Weight")
|
||||||
|
Link("GatesOfOlympus/ReelBaseSpin1", "Weight/2", "GatesOfOlympus/ReelBaseSpin1", "Weight")
|
||||||
|
Link("GatesOfOlympus/ReelBaseSpin1", "Weight/3", "GatesOfOlympus/ReelBaseSpin1", "Weight")
|
||||||
Link("Test/MatrixLine1Form3X3TypeA", "Default", "Matrix/Line1Form3X3TypeA", "Default")
|
Link("Test/MatrixLine1Form3X3TypeA", "Default", "Matrix/Line1Form3X3TypeA", "Default")
|
||||||
Link("Test/PrizeModel", "Default", "PrizeModel/PrizeModelTypeB", "Default")
|
Link("Test/PrizeModel", "Default", "PrizeModel/PrizeModelTypeB", "Default")
|
||||||
Link("Test/ReelBaseSpin", "Weight/1", "Test/ReelBaseSpin", "Weight")
|
Link("Test/ReelBaseSpin", "Weight/1", "Test/ReelBaseSpin", "Weight")
|
||||||
|
|
@ -636,3 +722,4 @@ func Load(dataMap map[string]string, name string, v interface{}) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,19 @@ type (
|
||||||
FreeSpinCount int64
|
FreeSpinCount int64
|
||||||
MaxWin int64
|
MaxWin int64
|
||||||
}
|
}
|
||||||
|
// GatesOfOlympusMultiplier comment
|
||||||
|
GatesOfOlympusMultiplier struct {
|
||||||
|
Multiple int64
|
||||||
|
ID int64
|
||||||
|
Weights []int64
|
||||||
|
}
|
||||||
|
// GatesOfOlympusReelChoose comment
|
||||||
|
GatesOfOlympusReelChoose struct {
|
||||||
|
ID int64
|
||||||
|
IsFreeSpin bool
|
||||||
|
NodeType string
|
||||||
|
Weights []int64
|
||||||
|
}
|
||||||
// JackpotPrize comment
|
// JackpotPrize comment
|
||||||
JackpotPrize struct {
|
JackpotPrize struct {
|
||||||
PrizeType int64
|
PrizeType int64
|
||||||
|
|
@ -521,6 +534,42 @@ type (
|
||||||
// FortuneTigerSymbolBetRatio comment
|
// FortuneTigerSymbolBetRatio comment
|
||||||
FortuneTigerSymbolBetRatio = SymbolBetRatio
|
FortuneTigerSymbolBetRatio = SymbolBetRatio
|
||||||
|
|
||||||
|
// GatesOfOlympusBetBetChangeList comment
|
||||||
|
GatesOfOlympusBetBetChangeList = BetChangeList
|
||||||
|
|
||||||
|
// GatesOfOlympusBetBetLevel comment
|
||||||
|
GatesOfOlympusBetBetLevel = BetLevel
|
||||||
|
|
||||||
|
// GatesOfOlympusBetBetLine comment
|
||||||
|
GatesOfOlympusBetBetLine = BetLine
|
||||||
|
|
||||||
|
// GatesOfOlympusBetBetSize comment
|
||||||
|
GatesOfOlympusBetBetSize = BetSize
|
||||||
|
|
||||||
|
// GatesOfOlympusBetFirstBet comment
|
||||||
|
GatesOfOlympusBetFirstBet = FirstBet
|
||||||
|
|
||||||
|
// GatesOfOlympusFormation comment
|
||||||
|
GatesOfOlympusFormation = Formation
|
||||||
|
|
||||||
|
// GatesOfOlympusMapRTPMode comment
|
||||||
|
GatesOfOlympusMapRTPMode = MapRTPMode
|
||||||
|
|
||||||
|
// GatesOfOlympusMapRTPModeTypeWeight comment
|
||||||
|
GatesOfOlympusMapRTPModeTypeWeight = MapRTPModeTypeWeight
|
||||||
|
|
||||||
|
// GatesOfOlympusMultiplierKeyID comment
|
||||||
|
GatesOfOlympusMultiplierKeyID = GatesOfOlympusMultiplier
|
||||||
|
|
||||||
|
// GatesOfOlympusScatter comment
|
||||||
|
GatesOfOlympusScatter = Scatter
|
||||||
|
|
||||||
|
// GatesOfOlympusSymbol comment
|
||||||
|
GatesOfOlympusSymbol = Symbol
|
||||||
|
|
||||||
|
// GatesOfOlympusSymbolBetRatio comment
|
||||||
|
GatesOfOlympusSymbolBetRatio = SymbolBetRatio
|
||||||
|
|
||||||
// MatrixFeaturesForm15X1TypeA comment
|
// MatrixFeaturesForm15X1TypeA comment
|
||||||
MatrixFeaturesForm15X1TypeA = Matrix
|
MatrixFeaturesForm15X1TypeA = Matrix
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ const (
|
||||||
FortuneOx = "FortuneOx"
|
FortuneOx = "FortuneOx"
|
||||||
FortuneMouse = "FortuneMouse"
|
FortuneMouse = "FortuneMouse"
|
||||||
CashMania = "CashMania"
|
CashMania = "CashMania"
|
||||||
|
GatesOfOlympus = "GatesOfOlympus"
|
||||||
Test = "Test"
|
Test = "Test"
|
||||||
)
|
)
|
||||||
const (
|
const (
|
||||||
|
|
@ -17,6 +18,7 @@ const (
|
||||||
GameId_OX
|
GameId_OX
|
||||||
GameId_Mouse
|
GameId_Mouse
|
||||||
GameId_Cash_Mania
|
GameId_Cash_Mania
|
||||||
|
GameId_GatesOfOlympus
|
||||||
|
|
||||||
GameId_Max
|
GameId_Max
|
||||||
GameId_Test = 999
|
GameId_Test = 999
|
||||||
|
|
@ -29,6 +31,7 @@ var GameMap = map[uint]string{
|
||||||
GameId_OX: FortuneOx,
|
GameId_OX: FortuneOx,
|
||||||
GameId_Mouse: FortuneMouse,
|
GameId_Mouse: FortuneMouse,
|
||||||
GameId_Cash_Mania: CashMania,
|
GameId_Cash_Mania: CashMania,
|
||||||
|
GameId_GatesOfOlympus: GatesOfOlympus,
|
||||||
GameId_Test: Test,
|
GameId_Test: Test,
|
||||||
}
|
}
|
||||||
var GameMapTheme = map[string]uint{
|
var GameMapTheme = map[string]uint{
|
||||||
|
|
@ -38,6 +41,7 @@ var GameMapTheme = map[string]uint{
|
||||||
FortuneOx: GameId_OX,
|
FortuneOx: GameId_OX,
|
||||||
FortuneMouse: GameId_Mouse,
|
FortuneMouse: GameId_Mouse,
|
||||||
CashMania: GameId_Cash_Mania,
|
CashMania: GameId_Cash_Mania,
|
||||||
|
GatesOfOlympus: GameId_GatesOfOlympus,
|
||||||
Test: GameId_Test,
|
Test: GameId_Test,
|
||||||
}
|
}
|
||||||
var GameKeyMap = map[int64]uint{
|
var GameKeyMap = map[int64]uint{
|
||||||
|
|
@ -47,5 +51,7 @@ var GameKeyMap = map[int64]uint{
|
||||||
310: GameId_Rabbit,
|
310: GameId_Rabbit,
|
||||||
311: GameId_OX,
|
311: GameId_OX,
|
||||||
312: GameId_Mouse,
|
312: GameId_Mouse,
|
||||||
|
313: GameId_Cash_Mania,
|
||||||
|
314: GameId_GatesOfOlympus,
|
||||||
999: GameId_Max,
|
999: GameId_Max,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,18 @@ type GameEndDto struct {
|
||||||
ActualWin int64 `json:"actualWin"`
|
ActualWin int64 `json:"actualWin"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CustomEliminate struct {
|
||||||
|
LinkPositions []*LinkPositions `json:"LinkPositions,omitempty"` //消除的位置
|
||||||
|
AppendSymbols [][]int64 `json:"AppendSymbols,omitempty"` //新增
|
||||||
|
FormattedSymbols [][]int64 `json:"FormattedSymbols,omitempty"` //最终的结果
|
||||||
|
LinePays []float64 `json:"LinePays,omitempty"` //赔付
|
||||||
|
WinCoins []float64 `json:"WinCoins,omitempty"` //输赢
|
||||||
|
MultiStr string `json:"multi_str,omitempty"`
|
||||||
|
MultiStrVal string `json:"multi_str_val,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Special
|
// Special
|
||||||
type SpinLock struct {
|
type SpinLock struct {
|
||||||
//tigerSpecial
|
//tigerSpecial
|
||||||
|
|
@ -81,4 +93,13 @@ type SpinLock struct {
|
||||||
Multiple int64 `json:"multiple,omitempty"` //倍乘倍数
|
Multiple int64 `json:"multiple,omitempty"` //倍乘倍数
|
||||||
Irv [][]float64 `json:"irv,omitempty"`
|
Irv [][]float64 `json:"irv,omitempty"`
|
||||||
Frv [][]float64 `json:"frv,omitempty"`
|
Frv [][]float64 `json:"frv,omitempty"`
|
||||||
|
|
||||||
|
//GatesOfOlympus
|
||||||
|
CustomEliminates []CustomEliminate `json:"CustomEliminates,omitempty"`
|
||||||
|
Pay float64 `json:"Pay,omitempty"`
|
||||||
|
Multi int64 `json:"Multi,omitempty"`
|
||||||
|
MultiStr string `json:"multi_str,omitempty"`
|
||||||
|
MultiStrVal string `json:"multi_str_val,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,18 @@ func (n *MachineDesc) BetChangeList() []float64 {
|
||||||
}
|
}
|
||||||
return lists
|
return lists
|
||||||
}
|
}
|
||||||
|
func (n *MachineDesc) GetBetIndexByVal(val float64) []int64 {
|
||||||
|
betChangeListRows, ok := n.Sheet("Bet", "BetChangeList").(map[int64]*structs.BetChangeList)
|
||||||
|
if !ok {
|
||||||
|
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "BetChangeList"))
|
||||||
|
}
|
||||||
|
for _, list := range betChangeListRows {
|
||||||
|
if list.BetChangeList == val {
|
||||||
|
return []int64{list.BetSizeIndex, list.BetLevelIndex}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
func (n *MachineDesc) GetVector(choice int64, minRatio, maxRatio float64, isForceWin bool) (int64, []int64) {
|
func (n *MachineDesc) GetVector(choice int64, minRatio, maxRatio float64, isForceWin bool) (int64, []int64) {
|
||||||
if vectorIndex := config.GetInt64("slots.vectorIndex"); vectorIndex > 0 {
|
if vectorIndex := config.GetInt64("slots.vectorIndex"); vectorIndex > 0 {
|
||||||
rows := n.DefaultSheet("Vector").([]*structs.Vector)
|
rows := n.DefaultSheet("Vector").([]*structs.Vector)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ type Formation struct {
|
||||||
NodeType string
|
NodeType string
|
||||||
FormationDesc *desc.FormationDesc
|
FormationDesc *desc.FormationDesc
|
||||||
Symbols []int64
|
Symbols []int64
|
||||||
|
SymbolsAbove []int64
|
||||||
|
SymbolsBelow []int64
|
||||||
RandPositions []int64
|
RandPositions []int64
|
||||||
CheatSymbols []int64
|
CheatSymbols []int64
|
||||||
DisplaySymbols []int64
|
DisplaySymbols []int64
|
||||||
|
|
@ -72,6 +74,8 @@ func NewFormation(n *desc.NodeDesc, seqID int64) (*Formation, error) {
|
||||||
NodeType: n.NodeType,
|
NodeType: n.NodeType,
|
||||||
FormationDesc: formationDesc,
|
FormationDesc: formationDesc,
|
||||||
Symbols: nil,
|
Symbols: nil,
|
||||||
|
SymbolsAbove: nil,
|
||||||
|
SymbolsBelow: nil,
|
||||||
RandPositions: nil,
|
RandPositions: nil,
|
||||||
CheatSymbols: nil,
|
CheatSymbols: nil,
|
||||||
DisplaySymbols: nil,
|
DisplaySymbols: nil,
|
||||||
|
|
@ -96,12 +100,16 @@ func (f *Formation) Rand(r *randx.Randx) {
|
||||||
symbol := reelDesc.Reel[symbolIdx%length]
|
symbol := reelDesc.Reel[symbolIdx%length]
|
||||||
f.Symbols = append(f.Symbols, symbol)
|
f.Symbols = append(f.Symbols, symbol)
|
||||||
}
|
}
|
||||||
|
f.SymbolsAbove = append(f.SymbolsAbove, reelDesc.Reel[(startIdx+reelDesc.Range-1)%length])
|
||||||
|
f.SymbolsBelow = append(f.SymbolsBelow, reelDesc.Reel[(startIdx+reelDesc.Range)%length])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Formation) ResetRandSymbols(r *randx.Randx) {
|
func (f *Formation) ResetRandSymbols(r *randx.Randx) {
|
||||||
f.RandPositions = nil
|
f.RandPositions = nil
|
||||||
f.Symbols = nil
|
f.Symbols = nil
|
||||||
|
f.SymbolsAbove = nil
|
||||||
|
f.SymbolsBelow = nil
|
||||||
for _, reelDesc := range f.FormationDesc.ReelsDesc {
|
for _, reelDesc := range f.FormationDesc.ReelsDesc {
|
||||||
// 经测试:缓存权重 和 二分查找 对权重随机性能的提升微乎其微,没必要优化
|
// 经测试:缓存权重 和 二分查找 对权重随机性能的提升微乎其微,没必要优化
|
||||||
startIdx := int64(randx.RandWeight(r, reelDesc.Weights))
|
startIdx := int64(randx.RandWeight(r, reelDesc.Weights))
|
||||||
|
|
@ -111,11 +119,15 @@ func (f *Formation) ResetRandSymbols(r *randx.Randx) {
|
||||||
symbol := reelDesc.Reel[symbolIdx%length]
|
symbol := reelDesc.Reel[symbolIdx%length]
|
||||||
f.Symbols = append(f.Symbols, symbol)
|
f.Symbols = append(f.Symbols, symbol)
|
||||||
}
|
}
|
||||||
|
f.SymbolsAbove = append(f.SymbolsAbove, reelDesc.Reel[(startIdx-1)%length])
|
||||||
|
f.SymbolsBelow = append(f.SymbolsBelow, reelDesc.Reel[(startIdx+reelDesc.Range)%length])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (f *Formation) ResetRandSymbolsByIndex(r *randx.Randx) {
|
func (f *Formation) ResetRandSymbolsByIndex(r *randx.Randx) {
|
||||||
f.RandPositions = nil
|
f.RandPositions = nil
|
||||||
f.Symbols = nil
|
f.Symbols = nil
|
||||||
|
f.SymbolsAbove = nil
|
||||||
|
f.SymbolsBelow = nil
|
||||||
for _, reelDesc := range f.FormationDesc.ReelsDesc {
|
for _, reelDesc := range f.FormationDesc.ReelsDesc {
|
||||||
// 经测试:缓存权重 和 二分查找 对权重随机性能的提升微乎其微,没必要优化
|
// 经测试:缓存权重 和 二分查找 对权重随机性能的提升微乎其微,没必要优化
|
||||||
startIdx := int64(r.Intn(len(reelDesc.Weights)))
|
startIdx := int64(r.Intn(len(reelDesc.Weights)))
|
||||||
|
|
@ -125,6 +137,8 @@ func (f *Formation) ResetRandSymbolsByIndex(r *randx.Randx) {
|
||||||
symbol := reelDesc.Reel[symbolIdx%length]
|
symbol := reelDesc.Reel[symbolIdx%length]
|
||||||
f.Symbols = append(f.Symbols, symbol)
|
f.Symbols = append(f.Symbols, symbol)
|
||||||
}
|
}
|
||||||
|
f.SymbolsAbove = append(f.SymbolsAbove, reelDesc.Reel[(startIdx-1)%length])
|
||||||
|
f.SymbolsBelow = append(f.SymbolsBelow, reelDesc.Reel[(startIdx+reelDesc.Range)%length])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ type Formation interface {
|
||||||
SetInitFormattedSymbols(symbols [][]int64) Formation
|
SetInitFormattedSymbols(symbols [][]int64) Formation
|
||||||
|
|
||||||
GetSymbols() []int64
|
GetSymbols() []int64
|
||||||
|
GetSymbolsAbove() []int64
|
||||||
|
GetSymbolsBelow() []int64
|
||||||
SetSymbols(symbols []int64) Formation
|
SetSymbols(symbols []int64) Formation
|
||||||
GetReelFormattedSymbols() [][]int64
|
GetReelFormattedSymbols() [][]int64
|
||||||
GetMatrixFormattedSymbols() [][]int64
|
GetMatrixFormattedSymbols() [][]int64
|
||||||
|
|
@ -41,6 +43,8 @@ type Formation interface {
|
||||||
GetMatrixFormattedFinalSymbols() [][]int64
|
GetMatrixFormattedFinalSymbols() [][]int64
|
||||||
SetFormattedFinalSymbols(symbols [][]int64) Formation
|
SetFormattedFinalSymbols(symbols [][]int64) Formation
|
||||||
|
|
||||||
|
GetMatrixFormattedBySymbols(symbols []int64) [][]int64
|
||||||
|
|
||||||
GetLinkPositions() []*shared.LinkPositions
|
GetLinkPositions() []*shared.LinkPositions
|
||||||
SetLinkPositions(linkPositions []*shared.LinkPositions) Formation
|
SetLinkPositions(linkPositions []*shared.LinkPositions) Formation
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ type Spinner interface {
|
||||||
BetLines() []int64
|
BetLines() []int64
|
||||||
BaseBets() []int64
|
BaseBets() []int64
|
||||||
BetChangeList() []float64
|
BetChangeList() []float64
|
||||||
|
GetBetIndexByVal(val float64) []int64
|
||||||
|
|
||||||
Choice() int64
|
Choice() int64
|
||||||
Stay() bool
|
Stay() bool
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,20 @@ func (f *Formation) GetSymbols() []int64 {
|
||||||
return symbols
|
return symbols
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetSymbolsAbove gets origin SymbolsAbove
|
||||||
|
func (f *Formation) GetSymbolsAbove() []int64 {
|
||||||
|
symbolsAbove := make([]int64, len(f.OriginFormation.SymbolsAbove))
|
||||||
|
copy(symbolsAbove, f.OriginFormation.SymbolsAbove)
|
||||||
|
return symbolsAbove
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetSymbolsBelow gets origin SymbolsBelow
|
||||||
|
func (f *Formation) GetSymbolsBelow() []int64 {
|
||||||
|
symbolsBelow := make([]int64, len(f.OriginFormation.SymbolsBelow))
|
||||||
|
copy(symbolsBelow, f.OriginFormation.SymbolsBelow)
|
||||||
|
return symbolsBelow
|
||||||
|
}
|
||||||
|
|
||||||
// SetSymbols sets origin symbols
|
// SetSymbols sets origin symbols
|
||||||
func (f *Formation) SetSymbols(symbols []int64) intf.Formation {
|
func (f *Formation) SetSymbols(symbols []int64) intf.Formation {
|
||||||
f.OriginFormation.Symbols = symbols
|
f.OriginFormation.Symbols = symbols
|
||||||
|
|
@ -183,6 +197,12 @@ func (f *Formation) GetMatrixFormattedFinalSymbols() [][]int64 {
|
||||||
f.OriginFormation.MatrixForm)
|
f.OriginFormation.MatrixForm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetMatrixFormattedBySymbols gets symbols and places them into specific form
|
||||||
|
func (f *Formation) GetMatrixFormattedBySymbols(symbols []int64) [][]int64 {
|
||||||
|
return formation.FormatSymbols(symbols,
|
||||||
|
f.OriginFormation.MatrixForm)
|
||||||
|
}
|
||||||
|
|
||||||
// SetFormattedFinalSymbols sets formed final symbols
|
// SetFormattedFinalSymbols sets formed final symbols
|
||||||
func (f *Formation) SetFormattedFinalSymbols(symbols [][]int64) intf.Formation {
|
func (f *Formation) SetFormattedFinalSymbols(symbols [][]int64) intf.Formation {
|
||||||
f.Formation.FinalSymbols = formation.DeformatSymbols(symbols)
|
f.Formation.FinalSymbols = formation.DeformatSymbols(symbols)
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,9 @@ func (m *Machine) BaseBets() []int64 {
|
||||||
func (m *Machine) BetChangeList() []float64 {
|
func (m *Machine) BetChangeList() []float64 {
|
||||||
return m.MachineDesc.BetChangeList()
|
return m.MachineDesc.BetChangeList()
|
||||||
}
|
}
|
||||||
|
func (m *Machine) GetBetIndexByVal(val float64) []int64 {
|
||||||
|
return m.MachineDesc.GetBetIndexByVal(val)
|
||||||
|
}
|
||||||
func (m *Machine) Choice() int64 {
|
func (m *Machine) Choice() int64 {
|
||||||
if m.UserData().ForceChoice > 0 {
|
if m.UserData().ForceChoice > 0 {
|
||||||
return m.UserData().ForceChoice
|
return m.UserData().ForceChoice
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/key"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/generic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PluginChooseWheel struct {
|
||||||
|
generic.PluginBase
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginChooseWheel) Theme() string {
|
||||||
|
return key.GatesOfOlympus
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginChooseWheel) OnStepBegin(m intf.Master) {
|
||||||
|
isFreeSpin := m.Next().GetType() == FreeSpin
|
||||||
|
typ := m.Choice()
|
||||||
|
|
||||||
|
nodeName := Descx(m).RandWheel(isFreeSpin, typ)
|
||||||
|
if !isFreeSpin {
|
||||||
|
if typ == RoundTypeMoreScatter {
|
||||||
|
nodeName = "MoreScatter" + nodeName
|
||||||
|
m.SetRatio(key.MachineRatioMoreCoinMoreBet, 1.25)
|
||||||
|
} else if typ == RoundTypeBuyFreeSpin {
|
||||||
|
m.SetRatio(key.MachineRatioMoreCoinSameBet, 100)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.Set(key.MachineFormationSeqsDesc, nodeName)
|
||||||
|
|
||||||
|
// 设置日志中的RoundType
|
||||||
|
if m.Next().GetType() == BaseSpin {
|
||||||
|
m.Set(key.MachineRoundType, typ)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
const (
|
||||||
|
BaseSpin = "BaseSpin"
|
||||||
|
FreeSpin = "FreeSpin"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
RoundTypeBaseSpin = iota
|
||||||
|
RoundTypeMoreScatter // 25% more cost
|
||||||
|
RoundTypeBuyFreeSpin // 10000% more cost
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
MultiplierBaseSpin = iota
|
||||||
|
MultiplierFreeSpin
|
||||||
|
MultiplierNoWin
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
SymbolMultiplier = int64(12)
|
||||||
|
)
|
||||||
|
|
||||||
|
type CustomFortune struct {
|
||||||
|
FreeStatus int `json:"fs"`
|
||||||
|
FreeSpinNum int64 `json:"fsn"` //剩余freespin
|
||||||
|
FreeNumMax int64 `json:"fnm"` //总次数
|
||||||
|
FreeNumTrigger int64 `json:"fnt"` //新增freespin
|
||||||
|
ScatterWin int64 `json:"sw,omitempty"`
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,84 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"github.com/tomas-qstarrs/boost/randx"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/exported/excel2go/structs"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/errors"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/desc"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
||||||
|
)
|
||||||
|
|
||||||
|
type descx struct {
|
||||||
|
*randx.Randx
|
||||||
|
*desc.NodeDesc
|
||||||
|
}
|
||||||
|
|
||||||
|
func Descx(m intf.Master) *descx {
|
||||||
|
return &descx{
|
||||||
|
Randx: m.Randx(),
|
||||||
|
NodeDesc: m.Desc(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n descx) RandWheel(isFreeSpin bool, typ int64) string {
|
||||||
|
sheet := n.DefaultSheet("ReelChoose")
|
||||||
|
rows, ok := sheet.([]*structs.GatesOfOlympusReelChoose)
|
||||||
|
if !ok {
|
||||||
|
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "ReelChoose"))
|
||||||
|
}
|
||||||
|
|
||||||
|
var weights = make(map[int]int64, 0)
|
||||||
|
for idx, row := range rows {
|
||||||
|
if row.IsFreeSpin == isFreeSpin {
|
||||||
|
weights[idx] = row.Weights[int(typ)]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
idx := randx.RandWeightMap(n.Randx, weights)
|
||||||
|
return rows[idx].NodeType
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n descx) RandMultiplier(typ int64) int64 {
|
||||||
|
sheet := n.DefaultSheet("Multiplier")
|
||||||
|
rows, ok := sheet.([]*structs.GatesOfOlympusMultiplier)
|
||||||
|
if !ok {
|
||||||
|
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "Multiplier"))
|
||||||
|
}
|
||||||
|
|
||||||
|
var weights = make([]int64, 0, len(rows))
|
||||||
|
for _, row := range rows {
|
||||||
|
weights = append(weights, row.Weights[typ])
|
||||||
|
}
|
||||||
|
|
||||||
|
idx := randx.RandWeight(n.Randx, weights)
|
||||||
|
return rows[idx].ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (n descx) GetMultiBySymbol(symbol int64) int64 {
|
||||||
|
sheet := n.KeySheet("Multiplier", "Default", "ID")
|
||||||
|
rows, ok := sheet.(map[int64]*structs.GatesOfOlympusMultiplier)
|
||||||
|
if !ok {
|
||||||
|
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "Multiplier"))
|
||||||
|
}
|
||||||
|
|
||||||
|
row, ok := rows[symbol]
|
||||||
|
if !ok {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return row.Multiple
|
||||||
|
}
|
||||||
|
func (n descx) GetMultiStr() string {
|
||||||
|
sheet := n.KeySheet("Multiplier", "Default", "ID")
|
||||||
|
rows, ok := sheet.(map[int64]*structs.GatesOfOlympusMultiplier)
|
||||||
|
if !ok {
|
||||||
|
panic(errors.ConfigTypeError.ErrorWith(n.Theme, "Multiplier"))
|
||||||
|
}
|
||||||
|
var multiples = make(map[int64]int64)
|
||||||
|
for _, v := range rows {
|
||||||
|
multiples[v.ID] = v.Multiple
|
||||||
|
}
|
||||||
|
multiplesByte, _ := json.Marshal(multiples)
|
||||||
|
return string(multiplesByte)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,239 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/mohae/deepcopy"
|
||||||
|
"github.com/tomas-qstarrs/boost/mathx"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/key"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/module/shared"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/generic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PluginEliminate struct {
|
||||||
|
generic.PluginBase
|
||||||
|
}
|
||||||
|
|
||||||
|
type CustomEliminate struct {
|
||||||
|
LinkPositions []*shared.LinkPositions `json:"LinkPositions,omitempty"` //消除的位置
|
||||||
|
AppendSymbols [][]int64 `json:"AppendSymbols,omitempty"` //新增
|
||||||
|
FormattedSymbols [][]int64 `json:"FormattedSymbols,omitempty"` //最终的结果
|
||||||
|
LinePays []float64 `json:"LinePays,omitempty"` //赔付
|
||||||
|
WinCoins []float64 `json:"WinCoins,omitempty"` //输赢
|
||||||
|
MultiStr string `json:"multi_str,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CustomMulti struct {
|
||||||
|
Multi int64
|
||||||
|
MultiStr string
|
||||||
|
MultiStrVal string
|
||||||
|
}
|
||||||
|
|
||||||
|
type CustomPay struct {
|
||||||
|
Pay float64
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) Theme() string {
|
||||||
|
return key.GatesOfOlympus
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) Customs() []interface{} {
|
||||||
|
return []interface{}{
|
||||||
|
&CustomEliminate{},
|
||||||
|
&CustomMulti{},
|
||||||
|
&CustomPay{},
|
||||||
|
&CustomFortune{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) OnInit(m intf.Master) {
|
||||||
|
if len(m.RootCustoms(&CustomMulti{})) == 0 {
|
||||||
|
m.AddRootFeature(&CustomMulti{})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) OnEnterNode(m intf.Master) {
|
||||||
|
if m.Cursor().GetType() == key.BaseSpin {
|
||||||
|
m.RootCustom(&CustomMulti{}).(*CustomMulti).Multi = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) BeforeSpin(m intf.Master) {
|
||||||
|
m.AddCursorFeature(&CustomPay{}).SetLifetime(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginEliminate) AfterSpin(m intf.Master) {
|
||||||
|
cursorFormation := m.CursorFormation()
|
||||||
|
formattedSymbols := cursorFormation.GetReelFormattedDisplaySymbols()
|
||||||
|
|
||||||
|
//f := getCustomFortune(m)
|
||||||
|
//if f.FreeSpinNum == 13 {
|
||||||
|
// formattedSymbols[0][0] = 1
|
||||||
|
// formattedSymbols[0][1] = 1
|
||||||
|
// formattedSymbols[0][2] = 1
|
||||||
|
//}
|
||||||
|
|
||||||
|
appendFormattedSymbols := deepcopy.Copy(formattedSymbols).([][]int64)
|
||||||
|
randPositions := cursorFormation.GetRandPositions()
|
||||||
|
|
||||||
|
// 清空基础赢钱
|
||||||
|
m.CursorFormation().SetWin(0)
|
||||||
|
|
||||||
|
// 获取custom
|
||||||
|
customMulti := m.RootCustom(&CustomMulti{}).(*CustomMulti)
|
||||||
|
customPay := m.CursorCustom(&CustomPay{}).(*CustomPay)
|
||||||
|
|
||||||
|
// 根据赔付计算multi type
|
||||||
|
linkPositions, _, linePays := m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||||
|
|
||||||
|
var multiType int64
|
||||||
|
if mathx.Sum(linePays) == 0 {
|
||||||
|
multiType = MultiplierNoWin
|
||||||
|
} else if m.Cursor().GetType() == key.BaseSpin {
|
||||||
|
multiType = MultiplierBaseSpin
|
||||||
|
} else {
|
||||||
|
multiType = MultiplierFreeSpin
|
||||||
|
}
|
||||||
|
|
||||||
|
// 替换Formation元素
|
||||||
|
for colIdx, symbols := range formattedSymbols {
|
||||||
|
for rowIdx, symbol := range symbols {
|
||||||
|
if symbol == SymbolMultiplier {
|
||||||
|
multiSymbol := Descx(m).RandMultiplier(multiType)
|
||||||
|
formattedSymbols[int64(colIdx)][5-int64(len(symbols))+int64(rowIdx)] = multiSymbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 存储 Formation元素
|
||||||
|
cursorFormation.SetFormattedDisplaySymbols(formattedSymbols)
|
||||||
|
defer cursorFormation.SetFormattedFinalSymbols(formattedSymbols)
|
||||||
|
|
||||||
|
// 有消除
|
||||||
|
for mathx.Sum(linePays) > 0 {
|
||||||
|
// 计算连线赢钱
|
||||||
|
lineNum := len(linePays)
|
||||||
|
winCoins := make([]float64, lineNum)
|
||||||
|
for lineIdx, pay := range linePays {
|
||||||
|
winCoins[lineIdx] = float64(m.Cursor().GetSingleBet()) * float64(pay)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标记消除的元素
|
||||||
|
for _, link := range linkPositions {
|
||||||
|
for _, pos := range link.Positions {
|
||||||
|
row, col := cursorFormation.PositionToCoords(pos)
|
||||||
|
formattedSymbols[col][row] = -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 删除消除的元素
|
||||||
|
for colIndex := range formattedSymbols {
|
||||||
|
for rowIndex := 0; rowIndex < len(formattedSymbols[colIndex]); rowIndex++ {
|
||||||
|
if formattedSymbols[colIndex][rowIndex] == -1 {
|
||||||
|
formattedSymbols[colIndex] = append(formattedSymbols[colIndex][:rowIndex], formattedSymbols[colIndex][rowIndex+1:]...)
|
||||||
|
rowIndex--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var symbolsAbove []int64
|
||||||
|
// 获取新得元素
|
||||||
|
for colIdx, symbols := range formattedSymbols {
|
||||||
|
// 获取后续(向前)元素
|
||||||
|
appendFormattedSymbols[colIdx] = cursorFormation.GetReelSymbols(int64(colIdx),
|
||||||
|
randPositions[colIdx]-int64(5-len(symbols)), int64(5-len(symbols)))
|
||||||
|
|
||||||
|
symbolsAbove = append(symbolsAbove, cursorFormation.GetReelSymbols(int64(colIdx),
|
||||||
|
randPositions[colIdx]-int64(5-len(symbols))-1, 1)...)
|
||||||
|
|
||||||
|
for rowIdx, symbol := range appendFormattedSymbols[colIdx] {
|
||||||
|
if symbol == SymbolMultiplier {
|
||||||
|
multiSymbol := Descx(m).RandMultiplier(multiType)
|
||||||
|
appendFormattedSymbols[colIdx][rowIdx] = multiSymbol
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 拼接剩余元素和后续(向前)元素
|
||||||
|
formattedSymbols[colIdx] = deepcopy.Copy(appendFormattedSymbols[colIdx]).([]int64)
|
||||||
|
formattedSymbols[colIdx] = append(formattedSymbols[colIdx], symbols...)
|
||||||
|
|
||||||
|
// randPosition 向前移动
|
||||||
|
randPositions[colIdx] -= int64(len(appendFormattedSymbols[colIdx]))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加后续feature,这里是消除
|
||||||
|
m.AddCursorFeature(&CustomEliminate{
|
||||||
|
LinkPositions: linkPositions,
|
||||||
|
AppendSymbols: appendFormattedSymbols,
|
||||||
|
FormattedSymbols: formattedSymbols,
|
||||||
|
LinePays: linePays,
|
||||||
|
WinCoins: winCoins,
|
||||||
|
MultiStr: Descx(m).GetMultiStr(),
|
||||||
|
SymbolsAbove: symbolsAbove,
|
||||||
|
SymbolsBelow: m.CursorFormation().GetSymbolsBelow(),
|
||||||
|
}).SetLifetime(1)
|
||||||
|
|
||||||
|
// 累加pay
|
||||||
|
customPay.Pay += mathx.Sum(linePays)
|
||||||
|
|
||||||
|
// 连线
|
||||||
|
linkPositions, _, linePays = m.TryLinkMatrixSymbols(1, formattedSymbols)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 增加multi
|
||||||
|
var multiSum int64
|
||||||
|
maxColCount := 0
|
||||||
|
|
||||||
|
// 找到最长的列数
|
||||||
|
for _, row := range formattedSymbols {
|
||||||
|
if len(row) > maxColCount {
|
||||||
|
maxColCount = len(row)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flatIndex := 0 // 当前符号在一维数组中的索引
|
||||||
|
|
||||||
|
customMulti.MultiStr = ""
|
||||||
|
customMulti.MultiStrVal = ""
|
||||||
|
|
||||||
|
// 遍历列优先的索引
|
||||||
|
for col := 0; col < maxColCount; col++ {
|
||||||
|
for row := 0; row < len(formattedSymbols); row++ {
|
||||||
|
rowSymbols := formattedSymbols[row] // 当前行的符号
|
||||||
|
if col < len(rowSymbols) { // 确保当前列存在
|
||||||
|
symbol := rowSymbols[col]
|
||||||
|
multi := Descx(m).GetMultiBySymbol(symbol)
|
||||||
|
multiSum += multi
|
||||||
|
|
||||||
|
// 打印 Symbol 和其一维索引
|
||||||
|
//fmt.Printf("Symbol: %s, Position in one-dimensional array: %d\n", symbol, flatIndex)
|
||||||
|
if multi > 0 {
|
||||||
|
if len(customMulti.MultiStr) > 0 {
|
||||||
|
customMulti.MultiStr += ";"
|
||||||
|
customMulti.MultiStrVal += ","
|
||||||
|
}
|
||||||
|
customMulti.MultiStr += fmt.Sprintf("%v~%v~%v", 12, flatIndex, multi)
|
||||||
|
customMulti.MultiStrVal += fmt.Sprintf("%v", multi)
|
||||||
|
}
|
||||||
|
flatIndex++ // 索引递增
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if customPay.Pay > 0 {
|
||||||
|
if multiSum == 0 {
|
||||||
|
win := int64(customPay.Pay * float64(m.Cursor().GetSingleBet()))
|
||||||
|
m.CursorFeature(&CustomPay{}).SetWin(win)
|
||||||
|
} else {
|
||||||
|
customMulti.Multi += multiSum
|
||||||
|
var win int64
|
||||||
|
if customMulti.Multi == 0 {
|
||||||
|
win = int64(customPay.Pay * float64(m.Cursor().GetSingleBet()))
|
||||||
|
} else {
|
||||||
|
win = int64(customPay.Pay * float64(m.Cursor().GetSingleBet()) * float64(customMulti.Multi))
|
||||||
|
}
|
||||||
|
m.CursorFeature(&CustomPay{}).SetWin(win)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,106 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/tomas-qstarrs/boost/mathx"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/key"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/generic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PluginFreeSpin struct {
|
||||||
|
generic.PluginScatter
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginFreeSpin) Theme() string {
|
||||||
|
return key.GatesOfOlympus
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取特性数据
|
||||||
|
func getCustomFortune(m intf.Master) *CustomFortune {
|
||||||
|
customFortune := new(CustomFortune)
|
||||||
|
if len(m.CursorCustoms(customFortune)) == 0 {
|
||||||
|
m.AddCursorFeature(customFortune)
|
||||||
|
}
|
||||||
|
return m.CursorCustom(customFortune).(*CustomFortune)
|
||||||
|
}
|
||||||
|
|
||||||
|
// AfterSpin implements generic.PluginBase.AfterSpin
|
||||||
|
func (p *PluginFreeSpin) AfterSpin(m intf.Master) {
|
||||||
|
switch m.Cursor().GetType() {
|
||||||
|
case key.BaseSpin:
|
||||||
|
p.AfterBaseSpin(m)
|
||||||
|
case key.FreeSpin:
|
||||||
|
p.AfterFreeSpin(m)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AfterBaseSpin is called after base spin
|
||||||
|
func (p *PluginFreeSpin) AfterBaseSpin(m intf.Master) {
|
||||||
|
addTimes, win := p.GetScatterInfo(m, false)
|
||||||
|
if addTimes > 0 {
|
||||||
|
//m.AddNodeOnCursor(key.FreeSpin, addTimes)
|
||||||
|
customFortune := getCustomFortune(m)
|
||||||
|
customFortune.FreeStatus = 1
|
||||||
|
customFortune.FreeNumMax += addTimes
|
||||||
|
customFortune.FreeNumTrigger = addTimes
|
||||||
|
customFortune.FreeSpinNum = addTimes
|
||||||
|
customFortune.ScatterWin = win
|
||||||
|
m.AddNodeFeature(m.AddNodeOnCursor(key.FreeSpin, addTimes).GetID(), customFortune).SetLifetime(addTimes)
|
||||||
|
}
|
||||||
|
if win > 0 {
|
||||||
|
m.AddCursorFeature(&generic.CustomScatterWin{}).SetWin(win)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AfterFreeSpin is called after free spin
|
||||||
|
func (p *PluginFreeSpin) AfterFreeSpin(m intf.Master) {
|
||||||
|
addTimes, win := p.GetScatterInfo(m, true)
|
||||||
|
customFortune := getCustomFortune(m)
|
||||||
|
if addTimes > 0 {
|
||||||
|
customFortune.FreeStatus = 2
|
||||||
|
customFortune.FreeNumTrigger = addTimes
|
||||||
|
customFortune.FreeNumMax += addTimes
|
||||||
|
customFortune.FreeSpinNum += addTimes
|
||||||
|
customFortune.ScatterWin = win
|
||||||
|
m.AddProgress(addTimes)
|
||||||
|
m.AddCursorFeature(&generic.CustomExtraFreeSpin{ExtraTimes: addTimes}).SetLifetime(1)
|
||||||
|
} else {
|
||||||
|
customFortune.FreeStatus = 0
|
||||||
|
customFortune.FreeNumTrigger = 0
|
||||||
|
if customFortune.FreeSpinNum > 0 {
|
||||||
|
if customFortune.FreeSpinNum == 1 {
|
||||||
|
customFortune.FreeStatus = 3
|
||||||
|
}
|
||||||
|
customFortune.FreeSpinNum--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if win > 0 {
|
||||||
|
m.AddCursorFeature(&generic.CustomScatterWin{}).SetWin(win)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetScatterInfo gets add free spin times & pay rate
|
||||||
|
func (p *PluginFreeSpin) GetScatterInfo(m intf.Master, inFreeSpin bool) (int64, int64) {
|
||||||
|
var scatterCount int64
|
||||||
|
symbols := m.CursorFormation().GetFinalSymbols()
|
||||||
|
scatterSymbols := p.Scatters(m)
|
||||||
|
for _, scatterSymbol := range scatterSymbols {
|
||||||
|
scatterCount += int64(mathx.Count(scatterSymbol, symbols))
|
||||||
|
}
|
||||||
|
|
||||||
|
if scatterCount == 0 {
|
||||||
|
return 0, 0
|
||||||
|
}
|
||||||
|
|
||||||
|
freeSpinCount := generic.Descx(m).FreeSpin(inFreeSpin, scatterCount)
|
||||||
|
|
||||||
|
payRate := generic.Descx(m).ScatterPayRate(inFreeSpin, scatterCount)
|
||||||
|
|
||||||
|
win := m.Bet() * payRate
|
||||||
|
|
||||||
|
if m.Choice() == RoundTypeMoreScatter {
|
||||||
|
win = int64(mathx.SafeDiv(win, 1.25))
|
||||||
|
}
|
||||||
|
|
||||||
|
return freeSpinCount, win
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
var Plugins = []interface{}{
|
||||||
|
&PluginChooseWheel{},
|
||||||
|
&PluginEliminate{},
|
||||||
|
&PluginFreeSpin{},
|
||||||
|
&PluginSpecial{},
|
||||||
|
}
|
||||||
|
|
||||||
|
var SimulatorPlugins = []interface{}{}
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package gatesofolympus
|
||||||
|
|
||||||
|
import (
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/internal/generic/key"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/intf"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/generic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type PluginSpecial struct {
|
||||||
|
generic.PluginBase
|
||||||
|
}
|
||||||
|
type Special struct {
|
||||||
|
CustomEliminates []CustomEliminate `json:"CustomEliminates,omitempty"` //消除的次数 一次为一个结果
|
||||||
|
FreeStatus int `json:"fs"`
|
||||||
|
FreeSpinNum int64 `json:"fsn,omitempty"` //剩余freespin
|
||||||
|
FreeNumMax int64 `json:"fnm,omitempty"` //总次数
|
||||||
|
FreeNumTrigger int64 `json:"fnt,omitempty"` //新增freespin
|
||||||
|
Pay float64 `json:"Pay,omitempty"`
|
||||||
|
Multi int64 `json:"Multi,omitempty"`
|
||||||
|
MultiStr string `json:"multi_str,omitempty"`
|
||||||
|
MultiStrVal string `json:"multi_str_val,omitempty"`
|
||||||
|
SymbolsAbove []int64 `json:"symbols_above,omitempty"`
|
||||||
|
SymbolsBelow []int64 `json:"symbols_below,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginSpecial) Theme() string {
|
||||||
|
return key.GatesOfOlympus
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *PluginSpecial) Customs() []interface{} {
|
||||||
|
return []interface{}{
|
||||||
|
&Special{},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (p *PluginSpecial) getCustomSpecial(m intf.Master) *Special {
|
||||||
|
customSpecial := new(Special)
|
||||||
|
if len(m.CursorCustoms(customSpecial)) == 0 {
|
||||||
|
m.AddCursorFeature(customSpecial).SetLifetime(0)
|
||||||
|
}
|
||||||
|
return m.CursorCustom(customSpecial).(*Special)
|
||||||
|
}
|
||||||
|
func (p *PluginSpecial) AfterSpin(m intf.Master) {
|
||||||
|
//cf := m.CursorFeatures(&CustomEliminate{})
|
||||||
|
ces := m.CursorCustoms(&CustomEliminate{})
|
||||||
|
sp := p.getCustomSpecial(m)
|
||||||
|
if len(ces) > 0 {
|
||||||
|
for _, i2 := range ces {
|
||||||
|
ce := i2.(*CustomEliminate)
|
||||||
|
wc := make([]float64, len(ce.WinCoins))
|
||||||
|
for j := 0; j < len(ce.WinCoins); j++ {
|
||||||
|
wc[j] = ce.WinCoins[j] / 10000
|
||||||
|
}
|
||||||
|
sp.CustomEliminates = append(sp.CustomEliminates, CustomEliminate{
|
||||||
|
LinkPositions: ce.LinkPositions,
|
||||||
|
AppendSymbols: ce.AppendSymbols,
|
||||||
|
FormattedSymbols: ce.FormattedSymbols,
|
||||||
|
LinePays: ce.LinePays,
|
||||||
|
WinCoins: wc,
|
||||||
|
MultiStr: ce.MultiStr,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
customFortune := getCustomFortune(m)
|
||||||
|
sp.FreeStatus = customFortune.FreeStatus
|
||||||
|
sp.FreeSpinNum = customFortune.FreeSpinNum
|
||||||
|
sp.FreeNumMax = customFortune.FreeNumMax
|
||||||
|
sp.FreeNumTrigger = customFortune.FreeNumTrigger
|
||||||
|
|
||||||
|
customMulti := m.RootCustom(&CustomMulti{}).(*CustomMulti)
|
||||||
|
customPay := m.CursorCustom(&CustomPay{}).(*CustomPay)
|
||||||
|
sp.Multi = customMulti.Multi
|
||||||
|
sp.MultiStr = customMulti.MultiStr
|
||||||
|
sp.MultiStrVal = customMulti.MultiStrVal
|
||||||
|
sp.Pay = customPay.Pay
|
||||||
|
sp.SymbolsAbove = m.CursorFormation().GetSymbolsAbove()
|
||||||
|
sp.SymbolsBelow = m.CursorFormation().GetSymbolsBelow()
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortuneox"
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortuneox"
|
||||||
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortunerabbit"
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortunerabbit"
|
||||||
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortunetiger"
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/fortunetiger"
|
||||||
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/gatesofolympus"
|
||||||
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/test"
|
"mongo.games.com/game/gamesrv/slotspkg/slots/plugin/test"
|
||||||
"mongo.games.com/game/gamesrv/slotspkg/slots/reg"
|
"mongo.games.com/game/gamesrv/slotspkg/slots/reg"
|
||||||
)
|
)
|
||||||
|
|
@ -20,6 +21,7 @@ func Init() {
|
||||||
reg.Register(fortunedragon.Plugins...)
|
reg.Register(fortunedragon.Plugins...)
|
||||||
reg.Register(fortunemouse.Plugins...)
|
reg.Register(fortunemouse.Plugins...)
|
||||||
reg.Register(cashmania.Plugins...)
|
reg.Register(cashmania.Plugins...)
|
||||||
|
reg.Register(gatesofolympus.Plugins...)
|
||||||
reg.Register(test.Plugins...)
|
reg.Register(test.Plugins...)
|
||||||
|
|
||||||
if global.Mock {
|
if global.Mock {
|
||||||
|
|
@ -28,6 +30,8 @@ func Init() {
|
||||||
reg.Register(fortunerabbit.SimulatorPlugins...)
|
reg.Register(fortunerabbit.SimulatorPlugins...)
|
||||||
reg.Register(fortunedragon.SimulatorPlugins...)
|
reg.Register(fortunedragon.SimulatorPlugins...)
|
||||||
reg.Register(cashmania.SimulatorPlugins...)
|
reg.Register(cashmania.SimulatorPlugins...)
|
||||||
|
reg.Register(gatesofolympus.SimulatorPlugins...)
|
||||||
|
reg.Register(test.SimulatorPlugins...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -39,11 +43,15 @@ func Close() {
|
||||||
reg.Deregister(fortunedragon.Plugins...)
|
reg.Deregister(fortunedragon.Plugins...)
|
||||||
reg.Deregister(fortunemouse.Plugins...)
|
reg.Deregister(fortunemouse.Plugins...)
|
||||||
reg.Deregister(cashmania.Plugins...)
|
reg.Deregister(cashmania.Plugins...)
|
||||||
|
reg.Deregister(gatesofolympus.Plugins...)
|
||||||
|
reg.Deregister(test.Plugins...)
|
||||||
if global.Mock {
|
if global.Mock {
|
||||||
reg.Deregister(fortuneox.SimulatorPlugins...)
|
reg.Deregister(fortuneox.SimulatorPlugins...)
|
||||||
reg.Deregister(fortunetiger.SimulatorPlugins...)
|
reg.Deregister(fortunetiger.SimulatorPlugins...)
|
||||||
reg.Deregister(fortunerabbit.SimulatorPlugins...)
|
reg.Deregister(fortunerabbit.SimulatorPlugins...)
|
||||||
reg.Deregister(fortunedragon.SimulatorPlugins...)
|
reg.Deregister(fortunedragon.SimulatorPlugins...)
|
||||||
reg.Deregister(cashmania.SimulatorPlugins...)
|
reg.Deregister(cashmania.SimulatorPlugins...)
|
||||||
|
reg.Deregister(gatesofolympus.SimulatorPlugins...)
|
||||||
|
reg.Deregister(test.SimulatorPlugins...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1257,7 +1257,7 @@ func (this *SceneEx) CountBilled() {
|
||||||
for _, v := range this.players {
|
for _, v := range this.players {
|
||||||
if v != nil && v.IsGameing() {
|
if v != nil && v.IsGameing() {
|
||||||
if v.totalScore > 0 {
|
if v.totalScore > 0 {
|
||||||
v.gainCoin = int64(float64(v.totalScore) * float64(totalLoseScore) / float64(totalWinScore))
|
v.gainCoin = int64(float64(v.totalScore*totalLoseScore) / float64(totalWinScore))
|
||||||
} else if v.totalScore < 0 {
|
} else if v.totalScore < 0 {
|
||||||
v.gainCoin = v.totalScore
|
v.gainCoin = v.totalScore
|
||||||
}
|
}
|
||||||
|
|
@ -1270,7 +1270,7 @@ func (this *SceneEx) CountBilled() {
|
||||||
if v.totalScore > 0 {
|
if v.totalScore > 0 {
|
||||||
v.gainCoin = v.totalScore
|
v.gainCoin = v.totalScore
|
||||||
} else if v.totalScore < 0 {
|
} else if v.totalScore < 0 {
|
||||||
v.gainCoin = int64(float64(v.totalScore) * float64(totalLoseScore) / float64(totalWinScore))
|
v.gainCoin = int64(float64(v.totalScore*totalWinScore) / float64(totalLoseScore))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ func UpBagItem(args *BagInfo) error {
|
||||||
ret := false
|
ret := false
|
||||||
err := rpcCli.CallWithTimeout("BagSvc.UpgradeBag", args, &ret, time.Second*30)
|
err := rpcCli.CallWithTimeout("BagSvc.UpgradeBag", args, &ret, time.Second*30)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("UpgradeBag err:%v SnId:%v BagId:%v", err, args.SnId, args.BagId)
|
return fmt.Errorf("UpgradeBag err:%v SnId:%v BagId:%v Ts:%v", err, args.SnId, args.BagId, args.Ts)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ const (
|
||||||
OpCollect = 6
|
OpCollect = 6
|
||||||
OpNian = 7
|
OpNian = 7
|
||||||
OpConsume = 8 // 累计消耗活动
|
OpConsume = 8 // 累计消耗活动
|
||||||
|
OpPushCoin = 9 // 推金币活动
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -175,6 +176,8 @@ type AllConfig struct {
|
||||||
*webapi.RedPacketConfig
|
*webapi.RedPacketConfig
|
||||||
// 累计消耗活动配置
|
// 累计消耗活动配置
|
||||||
*webapi.ConsumeConfig
|
*webapi.ConsumeConfig
|
||||||
|
// 推金币活动配置
|
||||||
|
*webapi.PushCoinConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
type GlobalConfig struct {
|
type GlobalConfig struct {
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,19 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"github.com/globalsign/mgo/bson"
|
"sync/atomic"
|
||||||
"mongo.games.com/game/protocol/server"
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/globalsign/mgo/bson"
|
||||||
|
"mongo.games.com/goserver/core/logger"
|
||||||
|
|
||||||
|
"mongo.games.com/game/protocol/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ItemLogDBName = "log"
|
ItemLogDBName = "log"
|
||||||
ItemLogCollName = "log_itemlog"
|
ItemLogCollName = "log_itemlog"
|
||||||
ClawDollItemIds = []int32{40003, 40004, 80001, 80002}
|
ItemSeq = int64(0)
|
||||||
)
|
)
|
||||||
|
|
||||||
type ItemLog struct {
|
type ItemLog struct {
|
||||||
|
|
@ -24,6 +27,7 @@ type ItemLog struct {
|
||||||
Count int64 //个数
|
Count int64 //个数
|
||||||
CreateTs int64 //记录时间
|
CreateTs int64 //记录时间
|
||||||
Ts int64 // 纳秒时间戳
|
Ts int64 // 纳秒时间戳
|
||||||
|
Seq int64 // 序号
|
||||||
Remark string //备注
|
Remark string //备注
|
||||||
TypeId int32 // 变化类型
|
TypeId int32 // 变化类型
|
||||||
GameId int64 // 游戏id,游戏中获得时有值
|
GameId int64 // 游戏id,游戏中获得时有值
|
||||||
|
|
@ -55,7 +59,7 @@ type ItemParam struct {
|
||||||
Cost []*Item // 消耗的道具
|
Cost []*Item // 消耗的道具
|
||||||
LogId string // 撤销的id,兑换失败
|
LogId string // 撤销的id,兑换失败
|
||||||
RoomConfigId int32 // 房间配置id
|
RoomConfigId int32 // 房间配置id
|
||||||
Offline int32 // 离线记录
|
Offline int32 // 离线记录 1是 0否
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewItemLogEx(param ItemParam) *ItemLog {
|
func NewItemLogEx(param ItemParam) *ItemLog {
|
||||||
|
|
@ -69,6 +73,7 @@ func NewItemLogEx(param ItemParam) *ItemLog {
|
||||||
itemLog.Count = param.Count
|
itemLog.Count = param.Count
|
||||||
itemLog.CreateTs = now.Unix()
|
itemLog.CreateTs = now.Unix()
|
||||||
itemLog.Ts = now.UnixNano()
|
itemLog.Ts = now.UnixNano()
|
||||||
|
itemLog.Seq = atomic.AddInt64(&ItemSeq, 1)
|
||||||
itemLog.Remark = param.Remark
|
itemLog.Remark = param.Remark
|
||||||
itemLog.TypeId = param.TypeId
|
itemLog.TypeId = param.TypeId
|
||||||
itemLog.GameId = param.GameId
|
itemLog.GameId = param.GameId
|
||||||
|
|
|
||||||
|
|
@ -557,6 +557,15 @@ type RedPacketData struct {
|
||||||
JN int32 // 参与次数
|
JN int32 // 参与次数
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PushCoinData struct {
|
||||||
|
Shake int32 // 震动次数
|
||||||
|
Refresh int64 // 刷新次数
|
||||||
|
Power int64 // 能量值
|
||||||
|
Exchange map[int32]int32 // 兑换次数 兑换id:兑换次数
|
||||||
|
Dram int // 抽奖次数
|
||||||
|
Items map[int32]int64 // 道具
|
||||||
|
}
|
||||||
|
|
||||||
type WelfareData struct {
|
type WelfareData struct {
|
||||||
ReliefFundTimes int32 //救济金领取次数
|
ReliefFundTimes int32 //救济金领取次数
|
||||||
Sign7 *NewSignData //七日签到
|
Sign7 *NewSignData //七日签到
|
||||||
|
|
@ -575,6 +584,7 @@ type WelfareData struct {
|
||||||
PermitExchange map[int32][]int64 // 赛季通行证兑换次数, 多次的兑换时间
|
PermitExchange map[int32][]int64 // 赛季通行证兑换次数, 多次的兑换时间
|
||||||
NianData *NianData //年兽活动数据
|
NianData *NianData //年兽活动数据
|
||||||
RedPacket map[int64]*RedPacketData // 红包活动 活动id:领取次数
|
RedPacket map[int64]*RedPacketData // 红包活动 活动id:领取次数
|
||||||
|
PushCoin *PushCoinData // 推币机活动
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWelfareData() *WelfareData {
|
func NewWelfareData() *WelfareData {
|
||||||
|
|
@ -695,6 +705,8 @@ type NianData struct {
|
||||||
BuffStatus bool //Buff领取状态
|
BuffStatus bool //Buff领取状态
|
||||||
BuffCount int64 //Buff剩余生效次数
|
BuffCount int64 //Buff剩余生效次数
|
||||||
SignAwardTime int64 //签到奖励领取时间
|
SignAwardTime int64 //签到奖励领取时间
|
||||||
|
SignOtherAwardCount int32 //签到额外奖励掉落数量
|
||||||
|
SignOtherAwardProp int32 //签到额外奖励掉落概率
|
||||||
BossDieCount int32 //BOSS死亡次数
|
BossDieCount int32 //BOSS死亡次数
|
||||||
LittleHurt int32 //小爆竹次数
|
LittleHurt int32 //小爆竹次数
|
||||||
BigHurt int32 //大爆竹次数
|
BigHurt int32 //大爆竹次数
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import (
|
||||||
//go:generate mongoctl -model-dir=. -model-names=RedPacket -dao-dir=../dao/
|
//go:generate mongoctl -model-dir=. -model-names=RedPacket -dao-dir=../dao/
|
||||||
type RedPacket struct {
|
type RedPacket struct {
|
||||||
ID primitive.ObjectID `bson:"_id" gen:"autoFill"`
|
ID primitive.ObjectID `bson:"_id" gen:"autoFill"`
|
||||||
Cid int64 // 红包活动id
|
Cid int64 `bson:"cid"` // 红包活动id
|
||||||
Use map[int64]int64 // 已发红包 红包奖励数量:已发个数
|
Use map[int64]int64 `bson:"use"` // 已发红包 红包奖励数量:已发个数
|
||||||
Ts int64 // 更新时间戳
|
Ts int64 `bson:"ts"` // 更新时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RedPacket) DatabaseName() string {
|
func (r *RedPacket) DatabaseName() string {
|
||||||
|
|
@ -75,3 +75,50 @@ type BackRedPacket struct {
|
||||||
ItemNum int64 // 道具数量
|
ItemNum int64 // 道具数量
|
||||||
Ts int64 // 时间戳
|
Ts int64 // 时间戳
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//go:generate mongoctl -model-dir=. -model-names=RedPacketHistory -dao-dir=../dao/
|
||||||
|
type RedPacketHistory struct {
|
||||||
|
Platform string `bson:"-"` // 平台
|
||||||
|
ID primitive.ObjectID `bson:"_id" gen:"autoFill"`
|
||||||
|
Cid int64 `bson:"cid"` // 红包活动id
|
||||||
|
Snid int32 `bson:"snid"` // 玩家id
|
||||||
|
Ts int64 `bson:"ts"` // 时间戳
|
||||||
|
ItemId int32 `bson:"itemid"` // 道具id
|
||||||
|
ItemNum int64 `bson:"itemnum"` // 道具数量
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RedPacketHistory) DatabaseName() string {
|
||||||
|
return "log"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *RedPacketHistory) CollectionName() string {
|
||||||
|
return "log_redpackethistory"
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetRedPacketHistoryReq struct {
|
||||||
|
Plt string
|
||||||
|
Snid int32
|
||||||
|
Cid int64
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetRedPacketHistory(plt string, snid int32, cid int64) (res []*RedPacketHistory, err error) {
|
||||||
|
if rpcCli == nil {
|
||||||
|
logger.Logger.Error("model.GetRedPacketHistory rpcCli == nil")
|
||||||
|
return nil, errors.New("rpc client is nil")
|
||||||
|
}
|
||||||
|
|
||||||
|
req := &GetRedPacketHistoryReq{
|
||||||
|
Plt: plt,
|
||||||
|
Snid: snid,
|
||||||
|
Cid: cid,
|
||||||
|
}
|
||||||
|
res = make([]*RedPacketHistory, 0)
|
||||||
|
|
||||||
|
err = rpcCli.CallWithTimeout("RedPacketService.GetHistory", req, &res, time.Second*30)
|
||||||
|
if err != nil {
|
||||||
|
logger.Logger.Errorf("GetRedPacketHistory error: %v", err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ const (
|
||||||
DBGiveLog = "db_givelog"
|
DBGiveLog = "db_givelog"
|
||||||
DBLotteryCode = "db_lotterycode" // 玩家抽奖码
|
DBLotteryCode = "db_lotterycode" // 玩家抽奖码
|
||||||
DBLotteryLog = "db_lotterylog" // 中奖记录
|
DBLotteryLog = "db_lotterylog" // 中奖记录
|
||||||
|
DBRedPacket = "db_redpackethistory" // 红包记录
|
||||||
)
|
)
|
||||||
|
|
||||||
// ranksrv 消息
|
// ranksrv 消息
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue