少年修仙传客户端代码仓库
client_Wu Xijin
2019-06-13 033958214c0b16d7e7b93cc821b018c295251867
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using Snxxz.UI;
using LitJson;
 
[XLua.LuaCallCSharp]
public class OperationLogCollect : Singleton<OperationLogCollect>
 
{
    const string url = "http://pub.game.2460web.com:11000/event_receiver?";
 
    public void RecordLauchEvent(int _step)
    {
#if !UNITY_EDITOR
        if (VersionConfig.Get().versionAuthority == VersionAuthority.Release)
        {
            var tables = new Dictionary<string, string>();
            tables["OperatorID"] = VersionConfig.Get().appId;
            tables["RegionName"] = "data";
            tables["EventID"] = 9001.ToString();
            tables["ProductID"] = "xbqy";
            tables["Device"] = SystemInfo.deviceName;
            tables["DeviceFlag"] = SDKUtility.Instance.Device.imei;
            tables["IP"] = DeviceUtility.GetIp();
            tables["DeviceFlag"] = DeviceUtility.GetDeviceUniquenessIdentify();
            tables["Flag"] = "1001";
            tables["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            tables["Step"] = _step.ToString();
 
            HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
        }
#endif
    }
 
    public void RecordEvent(int _step, uint coin = 0)
    {
#if !UNITY_EDITOR
        if (VersionConfig.Get().versionAuthority == VersionAuthority.Release)
        {
            var tables = new Dictionary<string, string>();
            tables["OperatorID"] = VersionConfig.Get().appId;
            tables["RegionName"] = "data";
            tables["AccountID"] = SDKUtility.Instance.FreePlatformInfo == null ? "" : SDKUtility.Instance.FreePlatformInfo.account;
            tables["EventID"] = 9001.ToString();
            tables["ProductID"] = "xbqy";
            tables["Device"] = SystemInfo.deviceName;
            tables["IP"] = DeviceUtility.GetIp();
            tables["DeviceFlag"] = SDKUtility.Instance.Device.imei;
            tables["Flag"] = VersionConfig.Get().clientPackageFlag;
            tables["Time"] = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            tables["Step"] = _step.ToString();
 
            if (coin != 0)
            {
                tables["Level"] = coin.ToString();
            }
 
            string _content = StringUtility.Contact(url, HttpRequest.HashtablaToString(tables));
            HttpRequest.Instance.RequestHttpGet(_content, HttpRequest.defaultHttpContentType);
        }
#endif
    }
 
    bool recordedDeviceDetail = false;
    public void RecordDeviceDetails()
    {
#if !UNITY_EDITOR
        if (VersionConfig.Get().versionAuthority != VersionAuthority.Release)
        {
            return;
        }
 
        if (!recordedDeviceDetail)
        {
            var tables = new Dictionary<string, string>();
            tables["OperatorID"] = VersionConfig.Get().appId;
            tables["RegionName"] = StringUtility.Contact("s" + ServerListCenter.Instance.currentServer.region_flag);
            tables["EventID"] = 1102.ToString();
            tables["ProductID"] = "xbqy";
            tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            tables["IP"] = DeviceUtility.GetIp();
            tables["AccountID"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
            tables["SessionID"] = "";
 
            var device = new Dictionary<string, string>();
            device["IMEI"] = DeviceUtility.GetDeviceUniquenessIdentify();
            device["DeviceFlag"] = SDKUtility.Instance.Device.imei;
#if UNITY_ANDROID
            device["IMEI2"] = SDKUtility.Instance.Device.imei;
#endif
            device["Brand"] = DeviceUtility.GetDeviceName();
            device["MI5"] = DeviceUtility.GetDeviceModel();
            tables["Device"] = JsonMapper.ToJson(device);
 
            var runtime = new Dictionary<string, string>();
            runtime["os_version"] = DeviceUtility.GetDeviceOSLevel();
            tables["Runtime"] = JsonMapper.ToJson(runtime);
            tables["Version"] = StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex);
            
            HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(url, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
        }
 
        recordedDeviceDetail = true;
#endif
    }
 
 
    const string bugReportUrl = "http://pub.game.2460web.com:11000/event_receiver?";
 
    public void BugReport(string _title, string _content)
    {
        var tables = new Dictionary<string, string>();
        tables["OperatorID"] = VersionConfig.Get().appId;
        tables["RegionName"] = "data";
        tables["RegionID"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
        tables["EventID"] = 9002.ToString();
        tables["ProductID"] = "xbqy";
        tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        tables["IP"] = DeviceUtility.GetIp();
        tables["AccountID"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
        tables["Level"] = PlayerDatas.Instance.baseData.LV.ToString();
        tables["RoleID"] = PlayerDatas.Instance.baseData.PlayerName;
        tables["VIPLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
        tables["DeviceFlag"] = SDKUtility.Instance.Device.imei;
 
        var contentPrefix = StringUtility.Contact("IMEI:", DeviceUtility.GetDeviceUniquenessIdentify(), ";");
        contentPrefix = StringUtility.Contact(contentPrefix, "Brand:", DeviceUtility.GetDeviceName(), ";");
        contentPrefix = StringUtility.Contact(contentPrefix, "MI5:", DeviceUtility.GetDeviceModel(), ";");
        contentPrefix = StringUtility.Contact(contentPrefix, "os_version:", DeviceUtility.GetDeviceOSLevel(), ";");
        contentPrefix = StringUtility.Contact(contentPrefix, "Version:", StringUtility.Contact(VersionConfig.Get().version, "_", VersionConfig.Get().buildIndex), ";");
 
        tables["Title"] = _title;
        tables["Content"] = StringUtility.Contact(contentPrefix, _content);
 
        HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(bugReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
 
    }
 
    const string chatReportUrl = "http://monitor.secondworld.net.cn:12000/chat_receiver?";
    public void ChatReport(string content, string channelName, string toPlayer, ChatInfoType chatType)
    {
#if !UNITY_EDITOR
        bool isFairy = chatType == ChatInfoType.Fairy;
        var tables = new Dictionary<string, string>();
        tables["ProductID"] = "xbqy";
        tables["OperatorID"] = VersionConfig.Get().appId;
        tables["OperatorName"] = string.Empty;
        tables["RegionName"] = StringUtility.Contact("s", ServerListCenter.Instance.currentServer.region_flag);
        tables["RegionID"] = ServerListCenter.Instance.currentServer.region_flag.ToString();
        tables["EventID"] = 9003.ToString();
        tables["Time"] = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        tables["IP"] = DeviceUtility.GetIp();
        tables["ChatChannel"] = channelName;
        tables["AccountID"] = ModelCenter.Instance.GetModel<LoginModel>().sdkLoginResult.account;
        tables["RoleID"] = StringUtility.Contact(isFairy ? UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.FamilyName) : string.Empty,
           isFairy ? "-" : string.Empty, UIHelper.ServerStringTrim(PlayerDatas.Instance.baseData.PlayerName));
        tables["ToRoleID"] = UIHelper.ServerStringTrim(toPlayer);
        tables["Level"] = PlayerDatas.Instance.baseData.LV.ToString();
        tables["VIPLevel"] = PlayerDatas.Instance.baseData.VIPLv.ToString();
        tables["Content"] = WWW.EscapeURL(UIHelper.TrimContentToServer(content));
        tables["DeviceFlag"] = SDKUtility.Instance.Device.imei;
 
        HttpRequest.Instance.RequestHttpGet(StringUtility.Contact(chatReportUrl, HttpRequest.HashtablaToString(tables)), HttpRequest.defaultHttpContentType);
#endif
    }
 
}