Skip to content

Commit c1515da

Browse files
committed
stat
1 parent 0f1ff12 commit c1515da

3 files changed

Lines changed: 78 additions & 0 deletions

File tree

Assets/AndroidIl2cppPatchDemo/Scene/0.unity

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,7 @@ GameObject:
18061806
serializedVersion: 6
18071807
m_Component:
18081808
- component: {fileID: 1796625708}
1809+
- component: {fileID: 1796625709}
18091810
m_Layer: 5
18101811
m_Name: GameObject
18111812
m_TagString: Untagged
@@ -1837,6 +1838,18 @@ RectTransform:
18371838
m_AnchoredPosition: {x: 0, y: 36}
18381839
m_SizeDelta: {x: 100, y: 100}
18391840
m_Pivot: {x: 0.5, y: 0.5}
1841+
--- !u!114 &1796625709
1842+
MonoBehaviour:
1843+
m_ObjectHideFlags: 0
1844+
m_CorrespondingSourceObject: {fileID: 0}
1845+
m_PrefabInstance: {fileID: 0}
1846+
m_PrefabAsset: {fileID: 0}
1847+
m_GameObject: {fileID: 1796625707}
1848+
m_Enabled: 1
1849+
m_EditorHideFlags: 0
1850+
m_Script: {fileID: 11500000, guid: 7f7da0d57003a1f47af91a9a15f58019, type: 3}
1851+
m_Name:
1852+
m_EditorClassIdentifier:
18401853
--- !u!1 &2048904140
18411854
GameObject:
18421855
m_ObjectHideFlags: 0
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
using System;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.Web;
5+
using UnityEngine;
6+
using UnityEngine.Networking;
7+
using UnityEngine.SceneManagement;
8+
9+
public class SupportPhoneStat : MonoBehaviour
10+
{
11+
// Start is called before the first frame update
12+
void Start()
13+
{
14+
StartCoroutine(ReportEnterScene());
15+
16+
}
17+
18+
IEnumerator ReportEnterScene()
19+
{
20+
string phoneId = SystemInfo.deviceUniqueIdentifier;
21+
string phoneType = SystemInfo.deviceModel;
22+
string androidVersion = SystemInfo.operatingSystem;
23+
int sceneNumber = SceneManager.GetActiveScene().buildIndex;
24+
int appVersion = 1;
25+
int random = UnityEngine.Random.Range(int.MinValue, int.MaxValue);
26+
27+
string url = "http://noodle1983.gz01.bdysite.com/index.php/PatchRecord/login?";
28+
string param = "phone_id=" + Uri.EscapeDataString(phoneId)
29+
+ "&phone_type=" + Uri.EscapeDataString(phoneType)
30+
+ "&android_version=" + Uri.EscapeDataString(androidVersion)
31+
+ "&enter_scene=" + sceneNumber
32+
+ "&app_version=" + appVersion
33+
+ "&rand=" + random;
34+
string req = url + param;
35+
Debug.Log(req);
36+
37+
UnityWebRequest www = UnityWebRequest.Get(req);
38+
www.SetRequestHeader("User-Agent", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36");
39+
yield return www.SendWebRequest();
40+
41+
if (www.isNetworkError || www.isHttpError)
42+
{
43+
Debug.Log(www.error);
44+
}
45+
else
46+
{
47+
// Show results as text
48+
Debug.Log(www.downloadHandler.text);
49+
50+
// Or retrieve results as binary data
51+
byte[] results = www.downloadHandler.data;
52+
}
53+
}
54+
}

Assets/Others/Script/SupportPhoneStat.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)