From eda59f8c72efc63fa5bb5fc914c73f5203eed4ff Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 11:37:04 +0800 Subject: [PATCH 1/5] 1 --- server/imserver/model/friend.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/imserver/model/friend.go b/server/imserver/model/friend.go index dfbfeaad..156e3d2f 100644 --- a/server/imserver/model/friend.go +++ b/server/imserver/model/friend.go @@ -14,7 +14,7 @@ var Friend = new (friend) func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, cb func (error, int64, int64)) { - f5.GetJsStyleDb().Upsert( + f5.GetJsStyleDb().UpsertEx( constant.FRIEND_DB, "t_friend_relationship", [][]string{ @@ -33,7 +33,12 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, {"createtime", q5.ToString(nowTime)}, {"modifytime", q5.ToString(nowTime)}, }, - cb) + func (err error, lastInsertId int64, rowsAffected int64) { + cb(err, lastInsertId, rowsAffected) + }, + func (ds *f5.DataSet) bool { + return true + }) } func (this *friend) DeleteSoft(accountId1 string, accountId2 string, From 97a7af158d3d0e1a231ec1aabda5c98973705ca2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 11:43:22 +0800 Subject: [PATCH 2/5] 1 --- server/imserver/model/friend.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/imserver/model/friend.go b/server/imserver/model/friend.go index 156e3d2f..e4e2c501 100644 --- a/server/imserver/model/friend.go +++ b/server/imserver/model/friend.go @@ -35,6 +35,7 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, }, func (err error, lastInsertId int64, rowsAffected int64) { cb(err, lastInsertId, rowsAffected) + this.updateAddFriendTask(accountId1, accountId2) }, func (ds *f5.DataSet) bool { return true @@ -56,3 +57,7 @@ func (this *friend) DeleteSoft(accountId1 string, accountId2 string, }, cb) } + +func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string) { + +} From f32e1fe47ffc4ca5b559998bf6a8924c333cb94b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 11:44:58 +0800 Subject: [PATCH 3/5] 1 --- server/imserver/model/friend.go | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/server/imserver/model/friend.go b/server/imserver/model/friend.go index e4e2c501..010a0089 100644 --- a/server/imserver/model/friend.go +++ b/server/imserver/model/friend.go @@ -35,7 +35,7 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, }, func (err error, lastInsertId int64, rowsAffected int64) { cb(err, lastInsertId, rowsAffected) - this.updateAddFriendTask(accountId1, accountId2) + this.updateAddFriendTask(accountId1, accountId2, nowTime) }, func (ds *f5.DataSet) bool { return true @@ -58,6 +58,28 @@ func (this *friend) DeleteSoft(accountId1 string, accountId2 string, cb) } -func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string) { - +func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string, nowTime int64) { + { + f5.GetJsStyleDb().Upsert( + constant.GAME_DB, + "t_friend_relationship", + [][]string{ + {"account_id1", accountId1}, + {"account_id2", accountId2}, + }, + [][]string{ + {"add_time", q5.ToString(nowTime)}, + {"deleted", "0"}, + }, + [][]string{ + {"account_id1", accountId1}, + {"account_id2", accountId2}, + {"add_time", q5.ToString(nowTime)}, + {"deleted", "0"}, + {"createtime", q5.ToString(nowTime)}, + {"modifytime", q5.ToString(nowTime)}, + }, + func (err error, lastInsertId int64, rowsAffected int64) { + }) + } } From 69b2db191e43e8f134a8d566387e6288f279cfd4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 13:59:16 +0800 Subject: [PATCH 4/5] 1 --- server/imserver/model/friend.go | 48 ++++++++++++++++----------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/server/imserver/model/friend.go b/server/imserver/model/friend.go index 010a0089..62c9f01f 100644 --- a/server/imserver/model/friend.go +++ b/server/imserver/model/friend.go @@ -35,7 +35,8 @@ func (this *friend) Force(accountId1 string, accountId2 string, nowTime int64, }, func (err error, lastInsertId int64, rowsAffected int64) { cb(err, lastInsertId, rowsAffected) - this.updateAddFriendTask(accountId1, accountId2, nowTime) + this.updateAddFriendTask(accountId1, nowTime) + this.updateAddFriendTask(accountId2, nowTime) }, func (ds *f5.DataSet) bool { return true @@ -58,28 +59,25 @@ func (this *friend) DeleteSoft(accountId1 string, accountId2 string, cb) } -func (this *friend) updateAddFriendTask(accountId1 string, accountId2 string, nowTime int64) { - { - f5.GetJsStyleDb().Upsert( - constant.GAME_DB, - "t_friend_relationship", - [][]string{ - {"account_id1", accountId1}, - {"account_id2", accountId2}, - }, - [][]string{ - {"add_time", q5.ToString(nowTime)}, - {"deleted", "0"}, - }, - [][]string{ - {"account_id1", accountId1}, - {"account_id2", accountId2}, - {"add_time", q5.ToString(nowTime)}, - {"deleted", "0"}, - {"createtime", q5.ToString(nowTime)}, - {"modifytime", q5.ToString(nowTime)}, - }, - func (err error, lastInsertId int64, rowsAffected int64) { - }) - } +func (this *friend) updateAddFriendTask(accountId string, nowTime int64) { + f5.GetJsStyleDb().Upsert( + constant.GAME_DB, + "t_rookie_task_value", + [][]string{ + {"account_id", accountId}, + {"task_type", "16"}, + }, + [][]string{ + {"!value", "value + 1"}, + {"modifytime", q5.ToString(nowTime)}, + }, + [][]string{ + {"account_id", accountId}, + {"task_type", "16"}, + {"value", "1"}, + {"createtime", q5.ToString(nowTime)}, + {"modifytime", q5.ToString(nowTime)}, + }, + func (err error, lastInsertId int64, rowsAffected int64) { + }) } From 0cbc90c4f11ebec666f8febc48c55935e66741e8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 17 Oct 2024 14:16:08 +0800 Subject: [PATCH 5/5] 1 --- server/matchserver/history/historymgr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/matchserver/history/historymgr.go b/server/matchserver/history/historymgr.go index fc910f9c..de715f83 100644 --- a/server/matchserver/history/historymgr.go +++ b/server/matchserver/history/historymgr.go @@ -56,7 +56,7 @@ func (this *historyMgr) PushLastBattleInfo(hum common.Player) { func (this *historyMgr) CanStart(accountId string, mapId int32, modeId int32) bool { u := this.getUser(accountId) - if u == nil && modeId == jccommon.MAP_MODE_CIRCUIT { + if u != nil && modeId == jccommon.MAP_MODE_CIRCUIT { key := q5.MkInt64(mapId, modeId) if startTime, ok := u.mapAndModeHash[key]; ok { nowTime := q5.ToInt32(f5.GetApp().GetRealSeconds())