Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
33728ccc1f
@ -28,6 +28,7 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.GameInviteAcceptR
|
|||||||
blueRecord *pb.GameInviteQiecuoRecord
|
blueRecord *pb.GameInviteQiecuoRecord
|
||||||
sessions []comm.IUserSession
|
sessions []comm.IUserSession
|
||||||
gamedata *pb.GameInviteData
|
gamedata *pb.GameInviteData
|
||||||
|
timeout int32 = 10
|
||||||
rules string
|
rules string
|
||||||
roomid string
|
roomid string
|
||||||
ok bool
|
ok bool
|
||||||
@ -66,10 +67,18 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.GameInviteAcceptR
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch req.Gtype {
|
||||||
|
case 0, 1, 2, 3, 4:
|
||||||
|
timeout = 10
|
||||||
|
case 5:
|
||||||
|
timeout = 60
|
||||||
|
}
|
||||||
|
|
||||||
rules = gamedata.Rules
|
rules = gamedata.Rules
|
||||||
for _, v := range gamedata.Targets {
|
for _, v := range gamedata.Targets {
|
||||||
if v.Uid == session.GetUserId() {
|
if v.Uid == session.GetUserId() {
|
||||||
if configure.Now().Sub(time.Unix(v.Timestamp, 0)).Seconds() > 10 {
|
if configure.Now().Sub(time.Unix(v.Timestamp, 0)).Seconds() > float64(timeout) {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_PracticeInviteTimeOut,
|
Code: pb.ErrorCode_PracticeInviteTimeOut,
|
||||||
Title: pb.ErrorCode_PracticeInviteTimeOut.ToString(),
|
Title: pb.ErrorCode_PracticeInviteTimeOut.ToString(),
|
||||||
|
@ -27,6 +27,7 @@ func (this *apiComp) Qiecuo(session comm.IUserSession, req *pb.GameInviteQiecuoR
|
|||||||
info *pb.GameInviteQiecuoRecord
|
info *pb.GameInviteQiecuoRecord
|
||||||
gamedata *pb.GameInviteData
|
gamedata *pb.GameInviteData
|
||||||
user *pb.DBUser
|
user *pb.DBUser
|
||||||
|
timeout int32
|
||||||
ok bool
|
ok bool
|
||||||
keep bool
|
keep bool
|
||||||
)
|
)
|
||||||
@ -77,11 +78,16 @@ func (this *apiComp) Qiecuo(session comm.IUserSession, req *pb.GameInviteQiecuoR
|
|||||||
// keep = true
|
// keep = true
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
switch req.Gtype {
|
||||||
|
case 0, 1, 2, 3, 4:
|
||||||
|
timeout = 10
|
||||||
|
case 5:
|
||||||
|
timeout = 60
|
||||||
|
}
|
||||||
for _, v := range gamedata.Targets {
|
for _, v := range gamedata.Targets {
|
||||||
if v.Uid == req.Fid {
|
if v.Uid == req.Fid {
|
||||||
keep = true
|
keep = true
|
||||||
if configure.Now().Sub(time.Unix(v.Timestamp, 0)).Seconds() > 10 {
|
if configure.Now().Sub(time.Unix(v.Timestamp, 0)).Seconds() > float64(timeout) {
|
||||||
v.Timestamp = configure.Now().Unix()
|
v.Timestamp = configure.Now().Unix()
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
|
Loading…
Reference in New Issue
Block a user