GPCM: Log remove friend profile ID

This commit is contained in:
mkwcat 2024-04-26 11:23:17 -04:00
parent 922b56a52c
commit 443ac5ee41
No known key found for this signature in database
GPG Key ID: 7A505679CE9E7AA9

View File

@ -91,7 +91,8 @@ func (g *GameSpySession) addFriend(command common.GameSpyCommand) {
mutex.Lock()
defer mutex.Unlock()
if !g.User.OpenHost && g.isFriendAuthorized(uint32(newProfileId)) {
authorized := g.isFriendAuthorized(uint32(newProfileId))
if !g.User.OpenHost && authorized {
logging.Info(g.ModuleName, "Attempt to add a friend who is already authorized")
// This seems to always happen, do we need to return an error?
// DWC vocally ignores the error anyway, so let's not bother
@ -125,8 +126,10 @@ func (g *GameSpySession) addFriend(command common.GameSpyCommand) {
// Friends are now mutual!
// TODO: Add a limit
g.AuthFriendList = append(g.AuthFriendList, uint32(newProfileId))
newSession.AuthFriendList = append(newSession.AuthFriendList, g.User.ProfileId)
if !authorized {
g.AuthFriendList = append(g.AuthFriendList, uint32(newProfileId))
newSession.AuthFriendList = append(newSession.AuthFriendList, g.User.ProfileId)
}
// Send friend auth message
sendMessageToSessionBuffer("4", newSession.User.ProfileId, g, "")
@ -149,6 +152,9 @@ func (g *GameSpySession) removeFriend(command common.GameSpyCommand) {
}
delProfileID32 := uint32(delProfileID64)
fc := common.CalcFriendCodeString(delProfileID32, g.User.GsbrCode[:4])
logging.Info(g.ModuleName, "Remove friend:", aurora.Cyan(strDelProfileID), aurora.Cyan(fc))
mutex.Lock()
defer mutex.Unlock()