friends/update_comment_wiiu.go
2022-09-04 22:59:45 -04:00

37 lines
1015 B
Go

package main
import (
nex "github.com/PretendoNetwork/nex-go"
nexproto "github.com/PretendoNetwork/nex-protocols-go"
)
func updateCommentWiiU(err error, client *nex.Client, callID uint32, comment *nexproto.Comment) {
// TODO: Do something with this
changed := updateUserComment(client.PID(), comment.Contents)
rmcResponseStream := nex.NewStreamOut(nexServer)
rmcResponseStream.WriteUInt64LE(changed)
rmcResponseBody := rmcResponseStream.Bytes()
rmcResponse := nex.NewRMCResponse(nexproto.FriendsWiiUProtocolID, callID)
rmcResponse.SetSuccess(nexproto.FriendsWiiUMethodUpdateComment, rmcResponseBody)
rmcResponseBytes := rmcResponse.Bytes()
responsePacket, _ := nex.NewPacketV0(client, nil)
responsePacket.SetVersion(0)
responsePacket.SetSource(0xA1)
responsePacket.SetDestination(0xAF)
responsePacket.SetType(nex.DataPacket)
responsePacket.SetPayload(rmcResponseBytes)
responsePacket.AddFlag(nex.FlagNeedsAck)
responsePacket.AddFlag(nex.FlagReliable)
nexServer.Send(responsePacket)
}