网络游戏初步接入

This commit is contained in:
2024-10-18 15:11:40 +08:00
parent 263a57f636
commit b27d2b80f7
12 changed files with 306 additions and 67 deletions
+2 -3
View File
@@ -7,7 +7,6 @@ import (
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"
"slices"
"work_cation/cfg"
"work_cation/global"
"work_cation/models"
"work_cation/repo"
@@ -61,7 +60,7 @@ func itemFollowUserView(w fyne.Window, data *models.Online, user *models.UserFol
go func() {
defer func() { _ = recover() }()
if data == nil {
data = &models.Online{ID: user.ID, Ip: user.Ip, Port: cfg.T.ServerAddr}
data = &models.Online{ID: user.ID, Ip: user.Ip, Port: user.Port}
}
newUser, err := service.Client.GetUser(data)
if err != nil {
@@ -71,7 +70,7 @@ func itemFollowUserView(w fyne.Window, data *models.Online, user *models.UserFol
if err == nil {
onlineShow.SetText("在线")
}
if err == nil && newUser.Name != user.Name {
if err == nil && newUser.UpdateTx != user.UpdateTx {
// 更新用户信息
fmt.Println("更新用户信息:", user, newUser)
repo.UserFollow.UnFollow(global.DB, user)