Compare commits
2 Commits
b144fee5af
...
6f9db3c84f
| Author | SHA1 | Date |
|---|---|---|
|
|
6f9db3c84f | |
|
|
a74a4af74c |
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
4
|
5
|
||||||
|
|
@ -21854,6 +21854,7 @@ GameObject:
|
||||||
- component: {fileID: 500962030}
|
- component: {fileID: 500962030}
|
||||||
- component: {fileID: 500962029}
|
- component: {fileID: 500962029}
|
||||||
- component: {fileID: 500962031}
|
- component: {fileID: 500962031}
|
||||||
|
- component: {fileID: 500962032}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Infos
|
m_Name: Infos
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -22015,6 +22016,19 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 4177bc10460c0264eb933d4c43a6f313, type: 3}
|
m_Script: {fileID: 11500000, guid: 4177bc10460c0264eb933d4c43a6f313, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!114 &500962032
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 500962021}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 36517ed5b97a5fc43b782b438a60e64d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
webhookUrl: https://discord.com/api/webhooks/1458685956029939905/mjzyM7JuC7KWIjR4INNpGNCUK2EKanBace1nuwd114E5VIicTvrB3IKHSuI22ID0AtlP
|
||||||
--- !u!1 &503960960
|
--- !u!1 &503960960
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.Networking;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
|
public class DiscordWebhookSender : MonoBehaviourSingletonTemplate<DiscordWebhookSender>
|
||||||
|
{
|
||||||
|
[SerializeField] private string webhookUrl;
|
||||||
|
|
||||||
|
public void Send_Message(string message)
|
||||||
|
{
|
||||||
|
StartCoroutine(SendCoroutine(message));
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator SendCoroutine(string message)
|
||||||
|
{
|
||||||
|
string json = "{\"content\":\"" + message + "\"}";
|
||||||
|
//Debug.Log("DiscordWebhookSender : " + json);
|
||||||
|
|
||||||
|
using (UnityWebRequest request = new UnityWebRequest(webhookUrl, "POST"))
|
||||||
|
{
|
||||||
|
byte[] bodyRaw = System.Text.Encoding.UTF8.GetBytes(json);
|
||||||
|
request.uploadHandler = new UploadHandlerRaw(bodyRaw);
|
||||||
|
request.downloadHandler = new DownloadHandlerBuffer();
|
||||||
|
request.SetRequestHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
|
yield return request.SendWebRequest();
|
||||||
|
|
||||||
|
//Debug.Log("DiscordWebhookSender Result : " + request.result);
|
||||||
|
if (request.result != UnityWebRequest.Result.Success)
|
||||||
|
Debug.LogError("Discord Error: " + request.error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 36517ed5b97a5fc43b782b438a60e64d
|
||||||
|
|
@ -3,11 +3,13 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using OneStore.Auth;
|
using OneStore.Auth;
|
||||||
using OneStore.Common;
|
using OneStore.Common;
|
||||||
using OneStore.Purchasing;
|
using OneStore.Purchasing;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Purchasing;
|
using UnityEngine.Purchasing;
|
||||||
|
using UnityEngine.Purchasing.MiniJSON;
|
||||||
|
|
||||||
public class InappInfo : MonoBehaviourSingletonTemplate<InappInfo>
|
public class InappInfo : MonoBehaviourSingletonTemplate<InappInfo>
|
||||||
{
|
{
|
||||||
|
|
@ -107,9 +109,18 @@ public class InappInfo : MonoBehaviourSingletonTemplate<InappInfo>
|
||||||
private void OnPurchaseConfirmed(Order order)
|
private void OnPurchaseConfirmed(Order order)
|
||||||
{
|
{
|
||||||
//NetWait.Ins.Set(false);
|
//NetWait.Ins.Set(false);
|
||||||
Debug.Log($"Purchase confirmed: {order.CartOrdered.Items().First().Product.definition.id}");
|
var id = order.CartOrdered.Items().First().Product.definition.id;
|
||||||
|
var data = table_shop.Ins.Get_Data(id);
|
||||||
|
//Debug.Log($"Purchase confirmed : {id}");
|
||||||
|
var json = JsonUtility.FromJson<OrderReceipt>(order.Info.Receipt);
|
||||||
|
//Debug.Log($"order.Info.Receipt : {json.Payload}");
|
||||||
|
|
||||||
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
|
DiscordWebhookSender.Ins.Send_Message($"[Google]{id} / {DSUtil.GetThousandCommaText(data.n_Price)}원 / {json.Payload}");
|
||||||
|
#endif
|
||||||
act_success?.Invoke();
|
act_success?.Invoke();
|
||||||
}
|
}
|
||||||
|
class OrderReceipt { public string Payload; }
|
||||||
|
|
||||||
private void OnPurchaseFailed(FailedOrder order)
|
private void OnPurchaseFailed(FailedOrder order)
|
||||||
{
|
{
|
||||||
|
|
@ -168,6 +179,10 @@ public class InappInfo : MonoBehaviourSingletonTemplate<InappInfo>
|
||||||
act_success();
|
act_success();
|
||||||
else
|
else
|
||||||
SaveMgr.Ins.list_inapp.Add(purchase.ProductId);
|
SaveMgr.Ins.list_inapp.Add(purchase.ProductId);
|
||||||
|
|
||||||
|
var data = table_shop.Ins.Get_Data(purchase.ProductId);
|
||||||
|
DiscordWebhookSender.Ins.Send_Message($"[OneStore, {Application.productName}, {purchase.PackageName}]" +
|
||||||
|
$"{purchase.ProductId} / {DSUtil.GetThousandCommaText(data.n_Price)}원 / {purchase.PurchaseToken}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnManageRecurringProduct(IapResult iapResult, PurchaseData purchase, RecurringAction action)
|
public void OnManageRecurringProduct(IapResult iapResult, PurchaseData purchase, RecurringAction action)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using GUPS.AntiCheat.Protected;
|
using GUPS.AntiCheat.Protected;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using OneStore.Common;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
public class SaveMgr : MonoBehaviourSingletonTemplate<SaveMgr>
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public static class AutoBuild
|
||||||
//PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel23;
|
//PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel23;
|
||||||
|
|
||||||
EditorUserBuildSettings.buildAppBundle = false;
|
EditorUserBuildSettings.buildAppBundle = false;
|
||||||
BuildStart("AndroidData/NightWard_Test_OneStore_" + Application.version + "_(" + PlayerSettings.Android.bundleVersionCode + ").apk", BuildTarget.Android);
|
BuildStart("AndroidData/NightWard_OneStore_" + Application.version + "_(" + PlayerSettings.Android.bundleVersionCode + ").apk", BuildTarget.Android);
|
||||||
EmptySymbol();
|
EmptySymbol();
|
||||||
}
|
}
|
||||||
[MenuItem("AutoBuild/Build Live AAB")]
|
[MenuItem("AutoBuild/Build Live AAB")]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue