no message
This commit is contained in:
parent
b345f7cae4
commit
6b51e16c77
|
@ -12,7 +12,7 @@ import (
|
||||||
var (
|
var (
|
||||||
CrashHashDBName = "user"
|
CrashHashDBName = "user"
|
||||||
CrashHashCollName = "user_crashhash"
|
CrashHashCollName = "user_crashhash"
|
||||||
ErrHashDBNotOpen = model.NewDBError(CrashHashDBName, CrashHashCollName, model.NOT_OPEN)
|
ErrHashDBNotOpen = model.NewDBError(CrashHashDBName, CrashHashCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func CrashHashCollection() *mongo.Collection {
|
func CrashHashCollection() *mongo.Collection {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
var (
|
var (
|
||||||
CrashHashAtomDBName = "user"
|
CrashHashAtomDBName = "user"
|
||||||
CrashHashAtomCollName = "user_crashhashatom"
|
CrashHashAtomCollName = "user_crashhashatom"
|
||||||
ErrHashAtomDBNotOpen = model.NewDBError(CrashHashAtomDBName, CrashHashAtomCollName, model.NOT_OPEN)
|
ErrHashAtomDBNotOpen = model.NewDBError(CrashHashAtomDBName, CrashHashAtomCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func CrashHashAtomCollection() *mongo.Collection {
|
func CrashHashAtomCollection() *mongo.Collection {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
var (
|
var (
|
||||||
JybDBName = "log"
|
JybDBName = "log"
|
||||||
JybCollName = "log_jyb"
|
JybCollName = "log_jyb"
|
||||||
ErrJybDBNotOpen = model.NewDBError(JybDBName, JybCollName, model.NOT_OPEN)
|
ErrJybDBNotOpen = model.NewDBError(JybDBName, JybCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func JybCollection(plt string) *mongo.Collection {
|
func JybCollection(plt string) *mongo.Collection {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import (
|
||||||
var (
|
var (
|
||||||
JybUserDBName = "log"
|
JybUserDBName = "log"
|
||||||
JybUserCollName = "log_jybuser"
|
JybUserCollName = "log_jybuser"
|
||||||
ErrJybUserDBNotOpen = model.NewDBError(JybUserDBName, JybUserCollName, model.NOT_OPEN)
|
ErrJybUserDBNotOpen = model.NewDBError(JybUserDBName, JybUserCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func JybuserCollection(plt string) *mongo.Collection {
|
func JybuserCollection(plt string) *mongo.Collection {
|
||||||
|
|
|
@ -22,7 +22,7 @@ var (
|
||||||
AccountDBName = "user"
|
AccountDBName = "user"
|
||||||
AccountCollName = "user_account"
|
AccountCollName = "user_account"
|
||||||
AccountDelBackupCollName = "user_account_del_backup"
|
AccountDelBackupCollName = "user_account_del_backup"
|
||||||
ErrAccDBNotOpen = model.NewDBError(AccountDBName, AccountCollName, model.NOT_OPEN)
|
ErrAccDBNotOpen = model.NewDBError(AccountDBName, AccountCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func AccountCollection(plt string) *mongo.Collection {
|
func AccountCollection(plt string) *mongo.Collection {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import (
|
||||||
var (
|
var (
|
||||||
BagDBName = "user"
|
BagDBName = "user"
|
||||||
BagCollName = "user_bag"
|
BagCollName = "user_bag"
|
||||||
ErrBagDBNotOpen = model.NewDBError(BagDBName, BagCollName, model.NOT_OPEN)
|
ErrBagDBNotOpen = model.NewDBError(BagDBName, BagCollName, model.NotOpen)
|
||||||
)
|
)
|
||||||
|
|
||||||
func BagCollection(plt string) *mongo.Collection {
|
func BagCollection(plt string) *mongo.Collection {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
"net/rpc"
|
"net/rpc"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrHorseRaceLampDBNotOpen = model.NewDBError(model.HorseRaceLampDBName, model.HorseRaceLampCollName, model.NOT_OPEN)
|
var ErrHorseRaceLampDBNotOpen = model.NewDBError(model.HorseRaceLampDBName, model.HorseRaceLampCollName, model.NotOpen)
|
||||||
|
|
||||||
func HorseRaceLampCollection(plt string) *mongo.Collection {
|
func HorseRaceLampCollection(plt string) *mongo.Collection {
|
||||||
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, model.HorseRaceLampDBName)
|
s := mongo.MgoSessionMgrSington.GetPltMgoSession(plt, model.HorseRaceLampDBName)
|
||||||
|
@ -41,6 +41,7 @@ func (svc *HorseRaceLampSvc) GetAllHorseRaceLamp(args string, ret *[]model.Horse
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *HorseRaceLampSvc) GetHorseRaceLamp(args *model.GetHorseRaceLampArgs, ret *model.HorseRaceLamp) (err error) {
|
func (svc *HorseRaceLampSvc) GetHorseRaceLamp(args *model.GetHorseRaceLampArgs, ret *model.HorseRaceLamp) (err error) {
|
||||||
c := HorseRaceLampCollection(args.Platform)
|
c := HorseRaceLampCollection(args.Platform)
|
||||||
if c == nil {
|
if c == nil {
|
||||||
|
@ -49,6 +50,7 @@ func (svc *HorseRaceLampSvc) GetHorseRaceLamp(args *model.GetHorseRaceLampArgs,
|
||||||
err = c.Find(bson.M{"_id": args.Id}).One(ret)
|
err = c.Find(bson.M{"_id": args.Id}).One(ret)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *HorseRaceLampSvc) RemoveHorseRaceLamp(args *model.RemoveHorseRaceLampArg, ret *bool) error {
|
func (svc *HorseRaceLampSvc) RemoveHorseRaceLamp(args *model.RemoveHorseRaceLampArg, ret *bool) error {
|
||||||
logger.Logger.Info("HorseRaceLampSvc RemoveHorseRaceLamp")
|
logger.Logger.Info("HorseRaceLampSvc RemoveHorseRaceLamp")
|
||||||
c := HorseRaceLampCollection(args.Platform)
|
c := HorseRaceLampCollection(args.Platform)
|
||||||
|
@ -61,6 +63,7 @@ func (svc *HorseRaceLampSvc) RemoveHorseRaceLamp(args *model.RemoveHorseRaceLamp
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *HorseRaceLampSvc) InsertHorseRaceLamp(args *model.InsertHorseRaceLampArgs, ret *bool) (err error) {
|
func (svc *HorseRaceLampSvc) InsertHorseRaceLamp(args *model.InsertHorseRaceLampArgs, ret *bool) (err error) {
|
||||||
c := HorseRaceLampCollection(args.Platform)
|
c := HorseRaceLampCollection(args.Platform)
|
||||||
if c == nil {
|
if c == nil {
|
||||||
|
@ -83,6 +86,7 @@ func (svc *HorseRaceLampSvc) InsertHorseRaceLamp(args *model.InsertHorseRaceLamp
|
||||||
*ret = true
|
*ret = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *HorseRaceLampSvc) EditHorseRaceLamp(args *model.EditHorseRaceLampArg, ret *bool) error {
|
func (svc *HorseRaceLampSvc) EditHorseRaceLamp(args *model.EditHorseRaceLampArg, ret *bool) error {
|
||||||
logger.Logger.Info("HorseRaceLampSvc EditHorseRaceLamp")
|
logger.Logger.Info("HorseRaceLampSvc EditHorseRaceLamp")
|
||||||
c := HorseRaceLampCollection(args.Platform)
|
c := HorseRaceLampCollection(args.Platform)
|
||||||
|
@ -104,6 +108,7 @@ func (svc *HorseRaceLampSvc) EditHorseRaceLamp(args *model.EditHorseRaceLampArg,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (svc *HorseRaceLampSvc) GetHorseRaceLampInRangeTsLimitByRange(args *model.QueryHorseRaceLampArg, ret *model.QueryHorseRaceLampRet) (err error) {
|
func (svc *HorseRaceLampSvc) GetHorseRaceLampInRangeTsLimitByRange(args *model.QueryHorseRaceLampArg, ret *model.QueryHorseRaceLampRet) (err error) {
|
||||||
logger.Logger.Info("HorseRaceLampSvc EditHorseRaceLamp")
|
logger.Logger.Info("HorseRaceLampSvc EditHorseRaceLamp")
|
||||||
c := HorseRaceLampCollection(args.Platform)
|
c := HorseRaceLampCollection(args.Platform)
|
||||||
|
@ -123,6 +128,7 @@ func (svc *HorseRaceLampSvc) GetHorseRaceLampInRangeTsLimitByRange(args *model.Q
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rpc.Register(horseRaceLampSvc)
|
rpc.Register(horseRaceLampSvc)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ var (
|
||||||
PlayerBucketIdsDBName = "user"
|
PlayerBucketIdsDBName = "user"
|
||||||
PlayerBucketIdsCollName = "user_bucketids"
|
PlayerBucketIdsCollName = "user_bucketids"
|
||||||
PlayerBucketIdsAutoId = bson.ObjectIdHex("60f69b4a09dbe3323c632f25") // 记录id使用到多少了
|
PlayerBucketIdsAutoId = bson.ObjectIdHex("60f69b4a09dbe3323c632f25") // 记录id使用到多少了
|
||||||
ErrPlayerBucketIdsDBNotOpen = model.NewDBError(PlayerBucketIdsDBName, PlayerBucketIdsCollName, model.NOT_OPEN)
|
ErrPlayerBucketIdsDBNotOpen = model.NewDBError(PlayerBucketIdsDBName, PlayerBucketIdsCollName, model.NotOpen)
|
||||||
playerBucketId = &model.PlayerBucketId{}
|
playerBucketId = &model.PlayerBucketId{}
|
||||||
playerBucketIdsCursor = int32(0)
|
playerBucketIdsCursor = int32(0)
|
||||||
playerBucketIdLock = sync.Mutex{}
|
playerBucketIdLock = sync.Mutex{}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
NOT_OPEN = "not open"
|
NotOpen = "not open"
|
||||||
ErrRPClientNoConn = errors.New("RPClient no connect")
|
ErrRPClientNoConn = errors.New("RPClient no connect")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -21,22 +21,23 @@ type RemoveHorseRaceLampRet struct {
|
||||||
Data *interface{}
|
Data *interface{}
|
||||||
Tag int
|
Tag int
|
||||||
}
|
}
|
||||||
|
|
||||||
type HorseRaceLamp struct {
|
type HorseRaceLamp struct {
|
||||||
Id bson.ObjectId `bson:"_id"`
|
Id bson.ObjectId `bson:"_id"`
|
||||||
Channel string //渠道
|
Channel string //渠道
|
||||||
Title string //标题
|
Title string //标题
|
||||||
Content string //公告内容
|
Content string //公告内容
|
||||||
Footer string
|
Footer string //
|
||||||
StartTime int64 //开始播放的时间
|
StartTime int64 //开始播放的时间
|
||||||
Interval int32 //播放间隔
|
Interval int32 //播放间隔
|
||||||
Count int32 //播放次数
|
Count int32 //播放次数
|
||||||
CreateTime int64 //创建公告的时间
|
CreateTime int64 //创建公告的时间
|
||||||
Priority int32 //播放优先级
|
Priority int32 //播放优先级
|
||||||
MsgType int32 //公告类型
|
MsgType int32 //公告类型
|
||||||
Platform string //公告播放的平台
|
Platform string //公告播放的平台
|
||||||
State int32 //状态 0.启用;1.关闭
|
State int32 //状态 0.启用;1.关闭
|
||||||
Target []int32
|
Target []int32 //
|
||||||
StandSec int32
|
StandSec int32 //
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHorseRaceLamp(channel, platform, title, content, footer string, startTime int64, interval int32, count int32, priority, state int32,
|
func NewHorseRaceLamp(channel, platform, title, content, footer string, startTime int64, interval int32, count int32, priority, state int32,
|
||||||
|
|
|
@ -1,102 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"mongo.games.com/game/common"
|
|
||||||
"mongo.games.com/game/proto"
|
|
||||||
"mongo.games.com/game/srvdata"
|
|
||||||
"mongo.games.com/goserver/core/netlib"
|
|
||||||
"mongo.games.com/goserver/srvlib/action"
|
|
||||||
srvproto "mongo.games.com/goserver/srvlib/protocol"
|
|
||||||
)
|
|
||||||
|
|
||||||
var gameStateMgr = &GameStateManager{
|
|
||||||
gameList: make(map[int32]map[int32]*Player),
|
|
||||||
gameIds: make(map[int32][]int32),
|
|
||||||
}
|
|
||||||
|
|
||||||
type GameStateManager struct {
|
|
||||||
gameList map[int32]map[int32]*Player //gameid-snid-player 推送消息的用户列表
|
|
||||||
gameIds map[int32][]int32
|
|
||||||
}
|
|
||||||
|
|
||||||
var ids = []int32{
|
|
||||||
int32(common.GameId_RollCoin),
|
|
||||||
int32(common.GameId_RollColor),
|
|
||||||
int32(common.GameId_RedVsBlack),
|
|
||||||
int32(common.GameId_DragonVsTiger),
|
|
||||||
int32(common.GameId_Baccarat),
|
|
||||||
int32(common.GameId_Roulette),
|
|
||||||
int32(common.GameId_RollPoint),
|
|
||||||
int32(common.GameId_RollAnimals),
|
|
||||||
//int32(common.GameId_BlackJack),
|
|
||||||
int32(common.GameId_HundredDZNZ),
|
|
||||||
int32(common.GameId_HundredYXX),
|
|
||||||
int32(common.GameId_Crash),
|
|
||||||
}
|
|
||||||
|
|
||||||
func (gsm *GameStateManager) Init() {
|
|
||||||
var idsMap = make(map[int32]bool)
|
|
||||||
for _, v := range ids {
|
|
||||||
idsMap[v] = true
|
|
||||||
}
|
|
||||||
dbGameFree := srvdata.PBDB_GameFreeMgr.Datas.Arr
|
|
||||||
for _, gfs := range dbGameFree {
|
|
||||||
if _, ok := idsMap[gfs.GameId]; ok {
|
|
||||||
gsm.gameIds[gfs.GameId] = append(gsm.gameIds[gfs.GameId], gfs.Id)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (gsm *GameStateManager) PlayerRegiste(player *Player, gameid int32, b bool) {
|
|
||||||
playerList := gsm.gameList[gameid]
|
|
||||||
if playerList == nil {
|
|
||||||
playerList = make(map[int32]*Player)
|
|
||||||
gsm.gameList[gameid] = playerList
|
|
||||||
}
|
|
||||||
playerList[player.SnId] = player
|
|
||||||
}
|
|
||||||
func (gsm *GameStateManager) PlayerClear(player *Player) {
|
|
||||||
for _, value := range gsm.gameList {
|
|
||||||
if value == nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
delete(value, player.SnId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (gsm *GameStateManager) BrodcastGameState(gameId int32, platform string, packid int, pack interface{}) {
|
|
||||||
mgs := make(map[*netlib.Session][]*srvproto.MCSessionUnion)
|
|
||||||
playerList := gsm.gameList[gameId]
|
|
||||||
for _, p := range playerList {
|
|
||||||
if p != nil && p.gateSess != nil && p.IsOnLine() && p.Platform == platform {
|
|
||||||
mgs[p.gateSess] = append(mgs[p.gateSess], &srvproto.MCSessionUnion{
|
|
||||||
Mccs: &srvproto.MCClientSession{
|
|
||||||
SId: proto.Int64(p.sid),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for gateSess, v := range mgs {
|
|
||||||
if gateSess != nil && len(v) != 0 {
|
|
||||||
action.MulticastMessageToServer(gateSess, packid, pack, v...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func init() {
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_RollCoin)] = []int32{110030001, 110030002, 110030003, 110030004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_RollColor)] = []int32{150010001, 150010002, 150010003, 150010004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_RedVsBlack)] = []int32{140010001, 140010002, 140010003, 140010004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_DragonVsTiger)] = []int32{120010001, 120010002, 120010003, 120010004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_Baccarat)] = []int32{350010001, 350010002, 350010003, 350010004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_Roulette)] = []int32{540000001, 540000002, 540000003, 540000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_RollPoint)] = []int32{530000001, 530000002, 530000003, 530000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_RollAnimals)] = []int32{560000001, 560000002, 560000003, 560000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_BlackJack)] = []int32{450000001, 450000002, 450000003, 450000004, 450000005}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_HundredDZNZ)] = []int32{660000001, 660000002, 660000003, 660000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_HundredYXX)] = []int32{670000001, 670000002, 670000003, 670000004}
|
|
||||||
//
|
|
||||||
//// 冰河世纪, 百战成神, 财神, 复仇者联盟, 复活岛
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_CaiShen)] = []int32{790000001, 790000002, 790000003, 790000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_Avengers)] = []int32{800000001, 800000002, 800000003, 800000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_EasterIsland)] = []int32{810000001, 810000002, 810000003, 810000004}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_IceAge)] = []int32{820000001, 820000002, 820000003}
|
|
||||||
//gameStateMgr.gameIds[int32(common.GameId_TamQuoc)] = []int32{830000001, 830000002, 830000003}
|
|
||||||
}
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
"mongo.games.com/game/protocol/message"
|
"mongo.games.com/game/protocol/message"
|
||||||
"mongo.games.com/game/srvdata"
|
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/module"
|
"mongo.games.com/goserver/core/module"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -28,10 +27,6 @@ const (
|
||||||
HorseRaceLampType_CustomMsg = 100
|
HorseRaceLampType_CustomMsg = 100
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
MAX_GAMENOTICE_PER_PLATFORM = 100
|
|
||||||
)
|
|
||||||
|
|
||||||
var HorseRaceLampMgrSington = &HorseRaceLampMgr{
|
var HorseRaceLampMgrSington = &HorseRaceLampMgr{
|
||||||
HorseRaceLampMsgList: make(map[string]*HorseRaceLamp),
|
HorseRaceLampMsgList: make(map[string]*HorseRaceLamp),
|
||||||
HorseRaceLampGameList: make(map[string][]*HorseRaceLamp),
|
HorseRaceLampGameList: make(map[string][]*HorseRaceLamp),
|
||||||
|
@ -40,8 +35,8 @@ var HorseRaceLampMgrSington = &HorseRaceLampMgr{
|
||||||
}
|
}
|
||||||
|
|
||||||
type HorseRaceLampMgr struct {
|
type HorseRaceLampMgr struct {
|
||||||
HorseRaceLampMsgList map[string]*HorseRaceLamp
|
HorseRaceLampMsgList map[string]*HorseRaceLamp // _id:跑马灯数据; 所有平台数据
|
||||||
HorseRaceLampGameList map[string][]*HorseRaceLamp
|
HorseRaceLampGameList map[string][]*HorseRaceLamp // 平台:跑马灯
|
||||||
HorseRaceLampCastList map[string]*HorseRaceLampCastInfo // 平台:跑马灯
|
HorseRaceLampCastList map[string]*HorseRaceLampCastInfo // 平台:跑马灯
|
||||||
NextGameHorseRaceLamp map[string]int64
|
NextGameHorseRaceLamp map[string]int64
|
||||||
}
|
}
|
||||||
|
@ -55,7 +50,7 @@ type HorseRaceLamp struct {
|
||||||
StartTime int64
|
StartTime int64
|
||||||
Interval int32
|
Interval int32
|
||||||
limitInterval int32
|
limitInterval int32
|
||||||
Count int32
|
Count int32 // bo
|
||||||
LastTime int64
|
LastTime int64
|
||||||
Priority int32
|
Priority int32
|
||||||
CreateTime int64
|
CreateTime int64
|
||||||
|
@ -71,7 +66,7 @@ type HorseRaceLampCastInfo struct {
|
||||||
CurIndex int
|
CurIndex int
|
||||||
CurTime int64
|
CurTime int64
|
||||||
DealQueue []*HorseRaceLamp
|
DealQueue []*HorseRaceLamp
|
||||||
DealList []*HorseRaceLamp
|
DealList []*HorseRaceLamp // 弹幕跑马灯列表
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HorseRaceLampMgr) InitHorseRaceLamp() {
|
func (this *HorseRaceLampMgr) InitHorseRaceLamp() {
|
||||||
|
@ -185,18 +180,6 @@ func (this *HorseRaceLampMgr) DelHorseRaceLampMsg(key string) {
|
||||||
delete(this.HorseRaceLampMsgList, key)
|
delete(this.HorseRaceLampMsgList, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (this *HorseRaceLampMgr) WordCheck(content string) string {
|
|
||||||
// has := srvdata.HasSensitiveWord([]rune(content))
|
|
||||||
// if has {
|
|
||||||
// content = string(srvdata.ReplaceSensitiveWord([]rune(content))[:])
|
|
||||||
// }
|
|
||||||
// return content
|
|
||||||
//}
|
|
||||||
|
|
||||||
func (this *HorseRaceLampMgr) IsSensitiveWord(content string) bool {
|
|
||||||
return srvdata.HasSensitiveWord([]rune(content))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HorseRaceLampMgr) PushGameHorseRaceLamp(ch, platform, content string, msgType int32, isRob bool, priority int32) bool {
|
func (this *HorseRaceLampMgr) PushGameHorseRaceLamp(ch, platform, content string, msgType int32, isRob bool, priority int32) bool {
|
||||||
msg := &HorseRaceLamp{
|
msg := &HorseRaceLamp{
|
||||||
Channel: ch,
|
Channel: ch,
|
||||||
|
@ -247,6 +230,7 @@ func (this *HorseRaceLampMgr) PushGameHorseRaceLamp(ch, platform, content string
|
||||||
}
|
}
|
||||||
|
|
||||||
if !isRob {
|
if !isRob {
|
||||||
|
// 替换一个机器人的消息,没有机器人则追加
|
||||||
isFindRob := false
|
isFindRob := false
|
||||||
if len(pool) > 0 {
|
if len(pool) > 0 {
|
||||||
for k, v := range pool {
|
for k, v := range pool {
|
||||||
|
@ -263,6 +247,7 @@ func (this *HorseRaceLampMgr) PushGameHorseRaceLamp(ch, platform, content string
|
||||||
this.HorseRaceLampGameList[platform] = append(pool, msg)
|
this.HorseRaceLampGameList[platform] = append(pool, msg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// 是机器人直接追加
|
||||||
this.HorseRaceLampGameList[platform] = append(pool, msg)
|
this.HorseRaceLampGameList[platform] = append(pool, msg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -270,8 +255,9 @@ func (this *HorseRaceLampMgr) PushGameHorseRaceLamp(ch, platform, content string
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HorseRaceLampMgr) DealHorseRaceLamp(uTime int64, value *HorseRaceLamp) {
|
func (this *HorseRaceLampMgr) DealHorseRaceLamp(uTime int64, value *HorseRaceLamp) {
|
||||||
if value.Count > 0 {
|
if value.Count > 0 { // 播放次数
|
||||||
this.BroadcastHorseRaceLampMsg(value)
|
this.BroadcastHorseRaceLampMsg(value)
|
||||||
value.Count = value.Count - 1
|
value.Count = value.Count - 1
|
||||||
value.LastTime = uTime
|
value.LastTime = uTime
|
||||||
|
|
|
@ -316,31 +316,6 @@ func (this *HundredSceneMgr) GetPlatformSceneByGameFreeId(platform string, gameF
|
||||||
return scenes
|
return scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *HundredSceneMgr) GetPlatformScene(platform string, gameId int32) []*Scene {
|
|
||||||
gameFreeIds := gameStateMgr.gameIds[gameId]
|
|
||||||
gameScenes := this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
|
||||||
if len(gameScenes) != len(gameFreeIds) {
|
|
||||||
var createIds []int32
|
|
||||||
for _, gfi := range gameFreeIds {
|
|
||||||
bFind := false
|
|
||||||
for _, s := range gameScenes {
|
|
||||||
if s.dbGameFree.GetId() == gfi {
|
|
||||||
bFind = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !bFind {
|
|
||||||
createIds = append(createIds, gfi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(createIds) > 0 {
|
|
||||||
this.tryCreateRoom(platform, createIds...)
|
|
||||||
gameScenes = this.GetPlatformSceneByGameFreeId(platform, gameFreeIds)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return gameScenes
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *HundredSceneMgr) ModuleName() string {
|
func (this *HundredSceneMgr) ModuleName() string {
|
||||||
return "HundredSceneMgr"
|
return "HundredSceneMgr"
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,7 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
etcd.Start()
|
etcd.Start()
|
||||||
gameStateMgr.Init()
|
|
||||||
HorseRaceLampMgrSington.InitHorseRaceLamp()
|
|
||||||
|
|
||||||
model.GetAllCoinPoolSettingData()
|
model.GetAllCoinPoolSettingData()
|
||||||
MsgMgrSington.InitMsg()
|
MsgMgrSington.InitMsg()
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -316,8 +316,6 @@ func (this *Player) OnLogined() {
|
||||||
|
|
||||||
this.BindGroupTag([]string{this.Platform})
|
this.BindGroupTag([]string{this.Platform})
|
||||||
|
|
||||||
gameStateMgr.PlayerClear(this)
|
|
||||||
|
|
||||||
this.RandRobotExData()
|
this.RandRobotExData()
|
||||||
|
|
||||||
if !this.IsRob {
|
if !this.IsRob {
|
||||||
|
@ -409,8 +407,6 @@ func (this *Player) OnRehold() {
|
||||||
//登录事件
|
//登录事件
|
||||||
this.ReportLoginEvent()
|
this.ReportLoginEvent()
|
||||||
|
|
||||||
gameStateMgr.PlayerClear(this)
|
|
||||||
|
|
||||||
FriendMgrSington.ApplyList(this.Platform, this.SnId)
|
FriendMgrSington.ApplyList(this.Platform, this.SnId)
|
||||||
FriendUnreadMgrSington.CheckSendFriendUnreadData(this.Platform, this.SnId)
|
FriendUnreadMgrSington.CheckSendFriendUnreadData(this.Platform, this.SnId)
|
||||||
|
|
||||||
|
@ -1323,8 +1319,6 @@ func (this *Player) DropLine() {
|
||||||
this.gateSess = nil
|
this.gateSess = nil
|
||||||
//统计在线时长日志
|
//统计在线时长日志
|
||||||
//this.StatisticsOllen(this.PlayerData.LastLogoutTime)
|
//this.StatisticsOllen(this.PlayerData.LastLogoutTime)
|
||||||
|
|
||||||
gameStateMgr.PlayerClear(this)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 退出
|
// 退出
|
||||||
|
@ -1351,7 +1345,6 @@ func (this *Player) Logout() {
|
||||||
this.sid = 0
|
this.sid = 0
|
||||||
this.gateSess = nil
|
this.gateSess = nil
|
||||||
this.DgGameLogout()
|
this.DgGameLogout()
|
||||||
gameStateMgr.PlayerClear(this)
|
|
||||||
this.OnlineLogLogout()
|
this.OnlineLogLogout()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2539,6 +2539,7 @@ func init() {
|
||||||
|
|
||||||
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/game/show_lottery", WebAPIHandlerWrapper(
|
WebAPIHandlerMgrSingleton.RegisteWebAPIHandler("/api/game/show_lottery", WebAPIHandlerWrapper(
|
||||||
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
func(tNode *transact.TransNode, params []byte) (int, proto.Message) {
|
||||||
|
logger.Logger.Tracef("/api/game/show_lottery %v", params)
|
||||||
pack := &webapiproto.SAShowLottery{}
|
pack := &webapiproto.SAShowLottery{}
|
||||||
msg := &webapiproto.ASShowLottery{}
|
msg := &webapiproto.ASShowLottery{}
|
||||||
|
|
||||||
|
@ -2547,6 +2548,7 @@ func init() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pack.Tag = webapiproto.TagCode_FAILED
|
pack.Tag = webapiproto.TagCode_FAILED
|
||||||
pack.Msg = "参数错误"
|
pack.Msg = "参数错误"
|
||||||
|
logger.Logger.Errorf("/api/game/show_lottery Unmarshal err: %v", err)
|
||||||
return common.ResponseTag_ParamError, pack
|
return common.ResponseTag_ParamError, pack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue