diff --git a/server/signserver/dsgn_resp.go b/server/signserver/dsgn_resp.go index c6a4031ce..926711d57 100644 --- a/server/signserver/dsgn_resp.go +++ b/server/signserver/dsgn_resp.go @@ -108,7 +108,7 @@ func (s *Session) makeSignResponse(uid int) []byte { bf.WriteUint32(s.server.getLastCID(uid)) bf.WriteUint32(s.server.getUserRights(uid)) ps.Uint16(bf, "", false) // filters - if s.client == VITA { + if s.client == VITA || s.client == PS3 { var psnUser string s.server.db.QueryRow("SELECT psn_id FROM users WHERE id = $1", uid).Scan(&psnUser) bf.WriteBytes(stringsupport.PaddedString(psnUser, 20, true)) diff --git a/server/signserver/session.go b/server/signserver/session.go index a3906481e..dfe034226 100644 --- a/server/signserver/session.go +++ b/server/signserver/session.go @@ -18,6 +18,7 @@ type Client int const ( PC100 Client = iota VITA + PS3 ) // Session holds state for the sign server connection. @@ -52,9 +53,12 @@ func (s *Session) handlePacket(pkt []byte) error { switch reqType { case "DLTSKEYSIGN:100", "DSGN:100": s.handleDSGN(bf) + case "PS3SGN:100": + s.client = PS3 + s.handlePSSGN(bf) case "VITASGN:100": s.client = VITA - s.handleVITASGN(bf) + s.handlePSSGN(bf) case "DELETE:100": loginTokenString := string(bf.ReadNullTerminatedBytes()) characterID := int(bf.ReadUint32()) @@ -102,7 +106,7 @@ func (s *Session) authenticate(username string, password string) { bf.WriteUint8(uint8(SIGN_EABORT)) s.logger.Error("Error getting user details", zap.Error(err)) default: - if bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) == nil || s.client == VITA { + if bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) == nil || s.client == VITA || s.client == PS3 { s.logger.Debug("Passwords match!") if newCharaReq { err = s.server.newUserChara(username) @@ -133,7 +137,7 @@ func (s *Session) authenticate(username string, password string) { err = s.cryptConn.SendPacket(bf.Data()) } -func (s *Session) handleVITASGN(bf *byteframe.ByteFrame) { +func (s *Session) handlePSSGN(bf *byteframe.ByteFrame) { _ = bf.ReadNullTerminatedBytes() // 0000000256 _ = bf.ReadNullTerminatedBytes() // 1 _ = bf.ReadBytes(82)