diff --git a/Erupe/network/mhfpacket/msg_mhf_acquire_ud_item.go b/Erupe/network/mhfpacket/msg_mhf_acquire_ud_item.go index d8e8600dc..255294616 100644 --- a/Erupe/network/mhfpacket/msg_mhf_acquire_ud_item.go +++ b/Erupe/network/mhfpacket/msg_mhf_acquire_ud_item.go @@ -1,7 +1,7 @@ package mhfpacket -import ( - "errors" +import ( + "errors" "github.com/Solenataris/Erupe/network/clientctx" "github.com/Solenataris/Erupe/network" @@ -9,7 +9,12 @@ import ( ) // MsgMhfAcquireUdItem represents the MSG_MHF_ACQUIRE_UD_ITEM -type MsgMhfAcquireUdItem struct{} +type MsgMhfAcquireUdItem struct{ + AckHandle uint32 + // Valid field size(s), not sure about the types. + Unk0 uint8 + Unk1 uint32 +} // Opcode returns the ID associated with this packet type. func (m *MsgMhfAcquireUdItem) Opcode() network.PacketID { @@ -18,7 +23,11 @@ func (m *MsgMhfAcquireUdItem) Opcode() network.PacketID { // Parse parses the packet from binary func (m *MsgMhfAcquireUdItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { - return errors.New("NOT IMPLEMENTED") + m.AckHandle = bf.ReadUint32() + m.Unk0 = bf.ReadUint8() + m.Unk1 = bf.ReadUint32() + return nil + //return errors.New("NOT IMPLEMENTED") } // Build builds a binary packet from the current data. diff --git a/Erupe/server/channelserver/handlers_diva.go b/Erupe/server/channelserver/handlers_diva.go index 99318d5b7..09a8029ec 100644 --- a/Erupe/server/channelserver/handlers_diva.go +++ b/Erupe/server/channelserver/handlers_diva.go @@ -191,7 +191,10 @@ func handleMsgMhfGetUdNormaPresentList(s *Session, p mhfpacket.MHFPacket) { doAckBufSucceed(s, pkt.AckHandle, data) } -func handleMsgMhfAcquireUdItem(s *Session, p mhfpacket.MHFPacket) {} +func handleMsgMhfAcquireUdItem(s *Session, p mhfpacket.MHFPacket) { + pkt := p.(*mhfpacket.MsgMhfAcquireUdItem) + doAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00}) +} func handleMsgMhfGetUdRanking(s *Session, p mhfpacket.MHFPacket) {} diff --git a/Erupe/server/channelserver/handlers_guild.go b/Erupe/server/channelserver/handlers_guild.go index 13601a6b5..41faf3924 100644 --- a/Erupe/server/channelserver/handlers_guild.go +++ b/Erupe/server/channelserver/handlers_guild.go @@ -135,7 +135,7 @@ func (guild *Guild) Save(s *Session) error { func (guild *Guild) CreateApplication(s *Session, charID uint32, applicationType GuildApplicationType, transaction *sql.Tx) error { sql := ` - INSERT INTO guild_applications (guild_id, character_id, actor_id, application_type) + INSERT INTO guild_applications (guild_id, character_id, actor_id, application_type) VALUES ($1, $2, $3, $4) ` @@ -415,8 +415,8 @@ func CreateGuild(s *Session, guildName string) (int32, error) { } guildResult, err := transaction.Query( - "INSERT INTO guilds (name, leader_id) VALUES ($1, $2) RETURNING id", - guildName, s.charID, + "INSERT INTO guilds (name, leader_id, rp, guild_hall) VALUES ($1, $2, $3, $4) RETURNING id", + guildName, s.charID, 48, 17, ) if err != nil { @@ -507,7 +507,7 @@ func FindGuildsByName(s *Session, name string) ([]*Guild, error) { func GetGuildInfoByID(s *Session, guildID uint32) (*Guild, error) { rows, err := s.server.db.Queryx(fmt.Sprintf(` %s - WHERE g.id = $1 + WHERE g.id = $1 LIMIT 1 `, guildInfoSelectQuery), guildID)