Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
piaohua committed Aug 17, 2018
1 parent be67c0f commit 27ada01
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
27 changes: 20 additions & 7 deletions ebg/desk_coin.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,36 @@ func (t *Desk) coinCameinMsg(userid string) {
}

//召唤机器人
func (t *Desk) loadRobot() {
t.robotTime++
if t.robotTime < 10 {
return
}
t.robotTime = 0
t.callRobot()
}

func (t *Desk) callRobot() {
if len(t.roles) >= 5 {
return
}
r, n := t.roleCountNum()
if r == 0 {
return
}
switch t.DeskData.Rtype {
case int32(pb.ROOM_TYPE0):
r, n := t.roleCountNum()
if r > 1 {
if r >= 3 || n >= 2 {
return
}
if n >= 4 {
}
case int32(pb.ROOM_TYPE1):
if !t.DeskData.Pub {
return
}
case int32(pb.ROOM_TYPE2):
if len(t.roles) > 5 {
if r >= 2 || n >= 2 {
return
}
case int32(pb.ROOM_TYPE2):
}
msg := new(pb.RobotMsg)
msg.Roomid = t.DeskData.Rid
Expand All @@ -162,7 +175,7 @@ func (t *Desk) callRobot() {
msg.Ltype = t.DeskData.Ltype
msg.Gtype = t.DeskData.Gtype
msg.EnvBet = int32(t.DeskData.Multiple)
msg.Num = 2
msg.Num = 1
t.dbmsPid.Tell(msg)
}

Expand Down
1 change: 1 addition & 0 deletions ebg/desk_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (a *Desk) ding(ctx actor.Context) {
case int32(pb.ROOM_TYPE2): //百人
a.freeTimeout()
}
a.loadRobot()
}

//关闭时钟
Expand Down
4 changes: 2 additions & 2 deletions ebg/desk_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ func (a *Desk) handlerRequest(msg interface{}, ctx actor.Context) {
msg1 := a.coinEnterMsg(userid)
ctx.Respond(msg1)
a.coinCameinMsg(userid)
//a.callRobot()
a.callRobot()
case *pb.CEBFreeEnterRoom:
arg := msg.(*pb.CEBFreeEnterRoom)
glog.Debugf("CEBFreeEnterRoom %#v", arg)
userid := a.getRouter(ctx)
msg1 := a.freeEnterMsg(userid)
ctx.Respond(msg1)
a.freeCameinMsg(userid)
//a.callRobot()
a.callRobot()
case *pb.CEBFreeDealer:
arg := msg.(*pb.CEBFreeDealer)
glog.Debugf("CEBFreeDealer %#v", arg)
Expand Down
6 changes: 4 additions & 2 deletions niu/desk_coin.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,19 @@ func (t *Desk) callRobot() {
if len(t.roles) >= 5 {
return
}
r, n := t.roleCountNum()
if r == 0 {
return
}
switch t.DeskData.Rtype {
case int32(pb.ROOM_TYPE0):
r, n := t.roleCountNum()
if r >= 3 || n >= 2 {
return
}
case int32(pb.ROOM_TYPE1):
if !t.DeskData.Pub {
return
}
r, n := t.roleCountNum()
if r >= 2 || n >= 2 {
return
}
Expand Down
1 change: 1 addition & 0 deletions niu/desk_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (a *Desk) ding(ctx actor.Context) {
case int32(pb.ROOM_TYPE2): //百人
a.freeTimeout()
}
a.loadRobot()
}

//关闭时钟
Expand Down
2 changes: 0 additions & 2 deletions niu/desk_niu.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func (t *Desk) dismiss(force bool) {

//' 超时处理
func (t *Desk) coinTimeout() {
t.loadRobot()
t.checkPubOver2()
switch t.state {
case int32(pb.STATE_READY):
Expand Down Expand Up @@ -229,7 +228,6 @@ func (t *Desk) coinTimeout() {

//' 超时处理
func (t *Desk) privTimeout() {
t.loadRobot()
t.checkPubOver2()
t.voteTimeout()
switch t.state {
Expand Down
2 changes: 1 addition & 1 deletion robot/robots.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (r *RobotServer) run2(msg *pb.RobotMsg) {
//重置
phone1 := cfg.Section("robot").Key("phone").Value()
//if r.phone > utils.StringAdd2(phone1, "750") {
if r.phone > utils.StringAdd2(phone1, "74") {
if r.phone > utils.StringAdd2(phone1, "73") {
r.phone = phone1
}
}
Expand Down
2 changes: 1 addition & 1 deletion robot/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *Robot) addCurrency() {

//SendDefer 延迟发送
func (c *Robot) SendDefer(msg interface{}) {
utils.Sleep(utils.RandIntN(6) + 5) //随机
utils.Sleep(utils.RandIntN(5) + 3) //随机
c.Sender(msg)
}

Expand Down

0 comments on commit 27ada01

Please sign in to comment.