remove Bunny from CompleteAttachFile

This commit is contained in:
Jonathan Barrow 2023-10-17 13:00:16 -04:00
parent 33263e61b6
commit 7f42de1a8c
No known key found for this signature in database
GPG Key ID: E86E9FE9049C741F

View File

@ -3,6 +3,7 @@ package nex_datastore_super_mario_maker
import (
"fmt"
"os"
"time"
nex "github.com/PretendoNetwork/nex-go"
datastore_super_mario_maker "github.com/PretendoNetwork/nex-protocols-go/datastore/super-mario-maker"
@ -11,11 +12,19 @@ import (
)
func CompleteAttachFile(err error, client *nex.Client, callID uint32, dataStoreCompletePostParam *datastore_types.DataStoreCompletePostParam) uint32 {
rmcResponseStream := nex.NewStreamOut(globals.SecureServer)
// TODO: complete this
rmcResponseStream.WriteString(fmt.Sprintf("http://%s.b-cdn.net/image/%d.jpg", os.Getenv("PN_SMM_CONFIG_S3_BUCKET"), dataStoreCompletePostParam.DataID))
bucket := os.Getenv("PN_SMM_CONFIG_S3_BUCKET")
key := fmt.Sprintf("%d.bin", dataStoreCompletePostParam.DataID)
URL, err := globals.Presigner.GetObject(bucket, key, time.Minute*15)
if err != nil {
globals.Logger.Error(err.Error())
return nex.Errors.DataStore.OperationNotAllowed
}
rmcResponseStream := nex.NewStreamOut(globals.SecureServer)
rmcResponseStream.WriteString(URL.String())
rmcResponseBody := rmcResponseStream.Bytes()