diff --git a/database/accounts/service.go b/database/accounts/service.go index 3d39131..f8ffbde 100755 --- a/database/accounts/service.go +++ b/database/accounts/service.go @@ -22,13 +22,13 @@ import ( "database/sql" "errors" "fmt" - "log" "time" "github.com/google/uuid" "github.com/pangbox/server/common/hash" "github.com/pangbox/server/gen/dbmodels" "github.com/pangbox/server/pangya" + log "github.com/sirupsen/logrus" ) // Enumeration of possible errors that can be returned from authenticate. @@ -619,6 +619,7 @@ func (s *Service) getDecorationIDWith(ctx context.Context, tx *dbmodels.Queries, return sql.NullInt64{}, err } if len(items) == 0 { + log.Warningf("missing decoration 0x%08x", typeID) return sql.NullInt64{}, nil } return sql.NullInt64{Valid: true, Int64: items[0].ItemID}, nil @@ -663,14 +664,18 @@ func (s *Service) SetDecoration(ctx context.Context, playerId int64, decoration return err } - queries.SetPlayerDecoration(ctx, dbmodels.SetPlayerDecorationParams{ + _, err = queries.SetPlayerDecoration(ctx, dbmodels.SetPlayerDecorationParams{ BackgroundID: backgroundID, FrameID: frameID, StickerID: stickerID, SlotID: slotID, CutInID: cutInID, TitleID: titleID, + PlayerID: playerId, }) + if err != nil { + return err + } err = tx.Commit() if err != nil { diff --git a/game/model/room.go b/game/model/room.go index 0d984f2..19c625d 100644 --- a/game/model/room.go +++ b/game/model/room.go @@ -38,42 +38,42 @@ const ( ) type RoomPlayerEntry struct { - ConnID uint32 - Nickname string `struct:"[22]byte"` - GuildName string `struct:"[17]byte"` - Slot uint8 - PlayerFlags uint32 // (I think GM flag goes here!) - TitleID uint32 - CharTypeID uint32 - PortraitBGID uint32 - PortraitFrameID uint32 - PortraitStickerID uint32 - PortraitSlotID uint32 - SlotCutInID uint32 - SlotRankBannerID uint32 - StatusFlags RoomStatusFlag - Rank uint8 - Unknown uint16 - GuildID uint32 - GuildEmblemImage string `struct:"[12]byte"` - PlayerID uint32 - Unknown2 uint32 - Unknown3 uint8 // <-- suspect, this may not be in the right place - LoungeState uint32 - Unknown4 uint16 - X float32 - Y float32 - Z float32 - Angle float32 - Unknown5 uint32 - ShopUnknown uint32 - ShopName string `struct:"[64]byte"` - MascotTypeID uint32 - GlobalID string `struct:"[22]byte"` - Unknown6 [106]byte - Guest bool `struct:"byte"` - AverageScore float32 - CharacterData pangya.PlayerCharacterData + ConnID uint32 + Nickname string `struct:"[22]byte"` + GuildName string `struct:"[17]byte"` + Slot uint8 + PlayerFlags uint32 // (I think GM flag goes here!) + TitleID uint32 + CharTypeID uint32 + BackgroundTypeID uint32 + FrameTypeID uint32 + StickerTypeID uint32 + SlotTypeID uint32 + CutInTypeID uint32 + TitleTypeID uint32 + StatusFlags RoomStatusFlag + Rank uint8 + Unknown uint16 + GuildID uint32 + GuildEmblemImage string `struct:"[12]byte"` + PlayerID uint32 + Unknown2 uint32 + Unknown3 uint8 // <-- suspect, this may not be in the right place + LoungeState uint32 + Unknown4 uint16 + X float32 + Y float32 + Z float32 + Angle float32 + Unknown5 uint32 + ShopUnknown uint32 + ShopName string `struct:"[64]byte"` + MascotTypeID uint32 + GlobalID string `struct:"[22]byte"` + Unknown6 [106]byte + Guest bool `struct:"byte"` + AverageScore float32 + CharacterData pangya.PlayerCharacterData } type RoomActionRotation struct { diff --git a/game/server/conn.go b/game/server/conn.go index db49ddb..a70ba8a 100755 --- a/game/server/conn.go +++ b/game/server/conn.go @@ -69,6 +69,12 @@ func (c *Conn) getRoomPlayer() *gamemodel.RoomPlayerEntry { StatusFlags: 0, GuildEmblemImage: "guildmark", // TODO PlayerID: uint32(c.player.PlayerID), + BackgroundTypeID: uint32(c.player.BackgroundTypeID.Int64), + FrameTypeID: uint32(c.player.FrameTypeID.Int64), + StickerTypeID: uint32(c.player.StickerTypeID.Int64), + SlotTypeID: uint32(c.player.SlotTypeID.Int64), + CutInTypeID: uint32(c.player.CutInTypeID.Int64), + TitleTypeID: uint32(c.player.TitleTypeID.Int64), CharacterData: c.getPlayerEquippedCharacter(), } }