From a0102cef97e9eeaddd4181a6f4f614d7c814ce0d Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Fri, 31 Dec 2021 09:24:51 -0500 Subject: [PATCH] stubbed GetDeletionReason --- get_deletion_reason.go | 42 ++++++++++++++++++++++++++++++++++++++++++ main.go | 1 + 2 files changed, 43 insertions(+) create mode 100644 get_deletion_reason.go diff --git a/get_deletion_reason.go b/get_deletion_reason.go new file mode 100644 index 0000000..06adfc0 --- /dev/null +++ b/get_deletion_reason.go @@ -0,0 +1,42 @@ +package main + +import ( + nex "github.com/PretendoNetwork/nex-go" + nexproto "github.com/PretendoNetwork/nex-protocols-go" +) + +func getDeletionReason(err error, client *nex.Client, callID uint32, dataIdLst []uint64) { + // TODO: Complete this + + pDeletionReasons := make([]uint32, 0) + + for range dataIdLst { + // We don't need the values right now + // stub this + pDeletionReasons = append(pDeletionReasons, 0x690007) + } + + rmcResponseStream := nex.NewStreamOut(nexServer) + + rmcResponseStream.WriteListUInt32LE(pDeletionReasons) + + rmcResponseBody := rmcResponseStream.Bytes() + + rmcResponse := nex.NewRMCResponse(nexproto.DataStoreSMMProtocolID, callID) + rmcResponse.SetSuccess(nexproto.DataStoreSMMMethodGetDeletionReason, rmcResponseBody) + + rmcResponseBytes := rmcResponse.Bytes() + + responsePacket, _ := nex.NewPacketV1(client, nil) + + responsePacket.SetVersion(1) + responsePacket.SetSource(0xA1) + responsePacket.SetDestination(0xAF) + responsePacket.SetType(nex.DataPacket) + responsePacket.SetPayload(rmcResponseBytes) + + responsePacket.AddFlag(nex.FlagNeedsAck) + responsePacket.AddFlag(nex.FlagReliable) + + nexServer.Send(responsePacket) +} diff --git a/main.go b/main.go index c588275..4e62607 100644 --- a/main.go +++ b/main.go @@ -84,6 +84,7 @@ func main() { dataStoreSmmServer.UploadCourseRecord(uploadCourseRecord) dataStoreSmmServer.GetCourseRecord(getCourseRecord) dataStoreSmmServer.GetApplicationConfigString(getApplicationConfigString) + dataStoreSmmServer.GetDeletionReason(getDeletionReason) dataStoreSmmServer.GetMetasWithCourseRecord(getMetasWithCourseRecord) dataStoreSmmServer.CheckRateCustomRankingCounter(checkRateCustomRankingCounter) dataStoreSmmServer.CTRPickUpCourseSearchObject(ctrPickUpCourseSearchObject)