mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-08-02 16:13:00 -05:00
33 lines
1.1 KiB
Go
33 lines
1.1 KiB
Go
package friends_3ds
|
|
|
|
import (
|
|
database_3ds "github.com/PretendoNetwork/friends-secure/database/3ds"
|
|
"github.com/PretendoNetwork/friends-secure/globals"
|
|
notifications_3ds "github.com/PretendoNetwork/friends-secure/notifications/3ds"
|
|
nex "github.com/PretendoNetwork/nex-go"
|
|
nexproto "github.com/PretendoNetwork/nex-protocols-go"
|
|
)
|
|
|
|
func UpdateComment(err error, client *nex.Client, callID uint32, comment string) {
|
|
go notifications_3ds.SendCommentUpdate(client, comment)
|
|
database_3ds.UpdateUserComment(client.PID(), comment)
|
|
|
|
rmcResponse := nex.NewRMCResponse(nexproto.Friends3DSProtocolID, callID)
|
|
rmcResponse.SetSuccess(nexproto.Friends3DSMethodUpdateComment, nil)
|
|
|
|
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)
|
|
|
|
globals.NEXServer.Send(responsePacket)
|
|
}
|