mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 07:25:03 +01:00
fix limited friends & clanmates amount
This commit is contained in:
@@ -131,9 +131,6 @@ func (s *Server) getFriendsForCharacters(chars []character) []members {
|
||||
}
|
||||
friends = append(friends, charFriends...)
|
||||
}
|
||||
if len(friends) > 255 { // Uint8
|
||||
friends = friends[:255]
|
||||
}
|
||||
return friends
|
||||
}
|
||||
|
||||
@@ -153,15 +150,12 @@ func (s *Server) getGuildmatesForCharacters(chars []character) []members {
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
for i, _ := range charGuildmates {
|
||||
for i := range charGuildmates {
|
||||
charGuildmates[i].CID = char.ID
|
||||
}
|
||||
guildmates = append(guildmates, charGuildmates...)
|
||||
}
|
||||
}
|
||||
if len(guildmates) > 255 { // Uint8
|
||||
guildmates = guildmates[:255]
|
||||
}
|
||||
return guildmates
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,12 @@ func (s *Session) makeSignResponse(uid int) []byte {
|
||||
if len(friends) == 0 {
|
||||
bf.WriteUint8(0)
|
||||
} else {
|
||||
bf.WriteUint8(uint8(len(friends)))
|
||||
if len(friends) > 255 {
|
||||
bf.WriteUint8(255)
|
||||
bf.WriteUint16(uint16(len(friends)))
|
||||
} else {
|
||||
bf.WriteUint8(uint8(len(friends)))
|
||||
}
|
||||
for _, friend := range friends {
|
||||
bf.WriteUint32(friend.CID)
|
||||
bf.WriteUint32(friend.ID)
|
||||
@@ -101,7 +106,12 @@ func (s *Session) makeSignResponse(uid int) []byte {
|
||||
if len(guildmates) == 0 {
|
||||
bf.WriteUint8(0)
|
||||
} else {
|
||||
bf.WriteUint8(uint8(len(guildmates)))
|
||||
if len(guildmates) > 255 {
|
||||
bf.WriteUint8(255)
|
||||
bf.WriteUint16(uint16(len(guildmates)))
|
||||
} else {
|
||||
bf.WriteUint8(uint8(len(guildmates)))
|
||||
}
|
||||
for _, guildmate := range guildmates {
|
||||
bf.WriteUint32(guildmate.CID)
|
||||
bf.WriteUint32(guildmate.ID)
|
||||
|
||||
Reference in New Issue
Block a user