using System.Collections.Generic;
using UnityEngine;
using PhxhSDK;
using PhxhSDK.AOT.VersionUpdate;
#if UNITY_EDITOR
using UnityEditor;
#endif
///
/// BI事件 用于本地缓存一次性事件
///
public class StorageEvent
{
public List EventList { get; set; }
public StorageEvent()
{
EventList = new List();
}
public StorageEvent(List eventStringList)
{
EventList = eventStringList;
}
}
///
/// BI 需要上报的关卡内信息
///
public class BILevelInfo
{
public int level_id { get; set; }
// 0:主线 / 1:资源 / 2: 剧情 / 3: 战役 / 4: 非法值
public int level_type { get; set; } = 4;
// 0:无难度区分 / 1: 简单 / 2: 困难
public int difficulty { get; set; }
// 0:开始 /1: 成功 / 2 :失败 / 3: 中途退出
public int level_event { get; set; }
// 1:标识开启扫荡
public int param0 { get; set; }
// 标识扫荡次数
public int param1 { get; set; }
public BILevelInfo()
{
}
public BILevelInfo(int levelID, int levelType, int difficulty, int levelEvent, int param0, int param1, int param2)
{
level_id = levelID;
level_type = levelType;
this.difficulty = difficulty;
level_event = levelEvent;
this.param0 = param0;
this.param1 = param1;
}
public void Clone(BILevelInfo biLevelInfo)
{
level_id = biLevelInfo.level_id;
level_type = biLevelInfo.level_type;
difficulty = biLevelInfo.difficulty;
level_event = biLevelInfo.level_event;
param0 = biLevelInfo.param0;
param1 = biLevelInfo.param1;
}
}
///
/// BI 需要上报的关卡内信息
///
public class BIBaseInfo
{
///
/// 游戏ID
///
public string app_name;
///
/// 渠道
///
public string channel;
///
/// 设备型号
///
public string model;
///
/// 设备ID
///
public string uuid;
///
/// 分辨率
///
public string resolution;
///
/// 操作系统 安卓 ios
///
public string platform;
///
/// 操作系统
///
public string os;
///
/// 系统内存
///
public string storage_info;
///
/// 客户端版本
///
public string version;
///
/// build code
///
public string build_code;
///
/// 资源版本
///
public string assets_version;
///
/// 游戏语言
///
public string language;
///
/// 玩家id
///
public string actor_id;
///
/// 第三方账号源
///
public string third_platform;
///
/// 第三方id
///
public string third_id;
///
/// 中台access key
///
public string access_key;
public BIBaseInfo()
{
// TODO gameid获取
app_name = "nld";
channel = PackDataInst.Inst.localInfo.workSpace;
access_key = PackDataInst.Inst.localInfo.httpAccessKey;
model = SystemInfo.deviceModel;
uuid = SystemInfo.deviceUniqueIdentifier;
resolution = Screen.width + "x" + Screen.height;
#if UNITY_EDITOR
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
platform = "Android";
else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS)
platform = "iOS";
else
platform = "Editor";
#else
platform = Application.platform == RuntimePlatform.Android ? "Android" :
Application.platform == RuntimePlatform.IPhonePlayer ? "iOS" : "Other";
#endif
os = SystemInfo.operatingSystem;
storage_info = SystemInfo.systemMemorySize.ToString();
version = Application.version;
build_code = PackDataInst.Inst.localInfo.buildCode;
assets_version = PackDataInst.Inst.localInfo.localFullVersion;
language = LanguageManager.CurLanguage.ToString();
}
public void SetUserInfo()
{
actor_id = SDKManager.Instance.ApplicationUserID;
third_platform = SDKManager.Instance.ThirdPartyPlatform;
third_id = SDKManager.Instance.ThirdPartyUserID;
}
///
/// 打印所有属性值到控制台
///
public void PrintAllValues()
{
Debug.Log("===== BIBaseInfo 所有属性值 =====");
Debug.Log($"app_name: {app_name}");
Debug.Log($"channel: {channel}");
Debug.Log($"model: {model}");
Debug.Log($"uuid: {uuid}");
Debug.Log($"resolution: {resolution}");
Debug.Log($"platform: {platform}");
Debug.Log($"os: {os}");
Debug.Log($"version: {version}");
Debug.Log($"build_code: {build_code}");
Debug.Log($"assets_version: {assets_version}");
Debug.Log($"language: {language}");
Debug.Log($"actor_id: {actor_id}");
Debug.Log($"third_platform: {third_platform}");
Debug.Log($"third_id: {third_id}");
Debug.Log($"storage_info: {storage_info}");
Debug.Log("================================");
}
}