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
|
||||
sessions []comm.IUserSession
|
||||
gamedata *pb.GameInviteData
|
||||
timeout int32 = 10
|
||||
rules string
|
||||
roomid string
|
||||
ok bool
|
||||
@ -66,10 +67,18 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.GameInviteAcceptR
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
switch req.Gtype {
|
||||
case 0, 1, 2, 3, 4:
|
||||
timeout = 10
|
||||
case 5:
|
||||
timeout = 60
|
||||
}
|
||||
|
||||
rules = gamedata.Rules
|
||||
for _, v := range gamedata.Targets {
|
||||
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{
|
||||
Code: pb.ErrorCode_PracticeInviteTimeOut,
|
||||
Title: pb.ErrorCode_PracticeInviteTimeOut.ToString(),
|
||||
|
@ -27,6 +27,7 @@ func (this *apiComp) Qiecuo(session comm.IUserSession, req *pb.GameInviteQiecuoR
|
||||
info *pb.GameInviteQiecuoRecord
|
||||
gamedata *pb.GameInviteData
|
||||
user *pb.DBUser
|
||||
timeout int32
|
||||
ok bool
|
||||
keep bool
|
||||
)
|
||||
@ -77,11 +78,16 @@ func (this *apiComp) Qiecuo(session comm.IUserSession, req *pb.GameInviteQiecuoR
|
||||
// keep = true
|
||||
// }
|
||||
// }
|
||||
|
||||
switch req.Gtype {
|
||||
case 0, 1, 2, 3, 4:
|
||||
timeout = 10
|
||||
case 5:
|
||||
timeout = 60
|
||||
}
|
||||
for _, v := range gamedata.Targets {
|
||||
if v.Uid == req.Fid {
|
||||
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()
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
|
Loading…
Reference in New Issue
Block a user