支付接口接入,打点数据完善
parent
b099f0e251
commit
a1acdd13fb
|
@ -24,6 +24,10 @@
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<!--刘海屏打开刘海处的使用权限-->
|
||||||
|
<meta-data android:name="android.notch_support" android:value="true" />
|
||||||
|
<meta-data android:name="notch.config" android:value="portrait|landscape"/>
|
||||||
</application>
|
</application>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
|
|
@ -250,8 +250,8 @@ public class MhtActivity extends IUnityPlayerActivity {
|
||||||
|
|
||||||
Map<String, String> map2 = new HashMap<>();
|
Map<String, String> map2 = new HashMap<>();
|
||||||
//必传
|
//必传
|
||||||
map2.put("consumerId", roleID);//用户ID
|
// map2.put("consumerId", roleID);//用户ID
|
||||||
map2.put("consumerName", roleName);//玩家昵称
|
// map2.put("consumerName", roleName);//玩家昵称
|
||||||
map2.put("mhtCurrency", String.valueOf(coinNum));//充值50元宝(数量)
|
map2.put("mhtCurrency", String.valueOf(coinNum));//充值50元宝(数量)
|
||||||
map2.put("vipLevel", vip);// vip等级
|
map2.put("vipLevel", vip);// vip等级
|
||||||
map2.put("playerName",guildlD);// 工会,帮派
|
map2.put("playerName",guildlD);// 工会,帮派
|
||||||
|
|
|
@ -23,12 +23,16 @@ namespace GameLogic
|
||||||
|
|
||||||
private Dictionary<string, object> stringToDic(string s)
|
private Dictionary<string, object> stringToDic(string s)
|
||||||
{
|
{
|
||||||
|
Debug.Log("stringToDic***************" + s);
|
||||||
Dictionary<string, object> d = new Dictionary<string, object>();
|
Dictionary<string, object> d = new Dictionary<string, object>();
|
||||||
|
if (s == "") return d;
|
||||||
string[] kvs = s.Split('|');
|
string[] kvs = s.Split('|');
|
||||||
foreach (string ss in kvs)
|
foreach (string ss in kvs)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Debug.Log("***************" + ss);
|
||||||
string[] kv = ss.Split('#');
|
string[] kv = ss.Split('#');
|
||||||
if (kv[3] == "1")
|
if (kv[2] == "1")
|
||||||
{
|
{
|
||||||
d.Add(kv[0], Convert.ToInt32(kv[1]));
|
d.Add(kv[0], Convert.ToInt32(kv[1]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace SDK
|
||||||
",goodDec= " + args.productName +
|
",goodDec= " + args.productName +
|
||||||
",count= " + args.buyNum +
|
",count= " + args.buyNum +
|
||||||
",goodsId= " + args.productId +
|
",goodsId= " + args.productId +
|
||||||
",ext= " + GameLogic.Util.Base64Encode(args.extension)
|
",ext= " + args.extension //GameLogic.Util.Base64Encode(args.extension)
|
||||||
);
|
);
|
||||||
|
|
||||||
currentActivity.Call("Pay",args.productId,
|
currentActivity.Call("Pay",args.productId,
|
||||||
|
@ -89,7 +89,8 @@ namespace SDK
|
||||||
args.vip,
|
args.vip,
|
||||||
args.guildID,
|
args.guildID,
|
||||||
args.payNotifyUrl,
|
args.payNotifyUrl,
|
||||||
GameLogic.Util.Base64Encode(args.extension));
|
args.extension);
|
||||||
|
//GameLogic.Util.Base64Encode(args.extension));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool IsSupportExit()
|
public override bool IsSupportExit()
|
||||||
|
|
|
@ -189,7 +189,7 @@ namespace SDK
|
||||||
//sdk SwitchAccount回调
|
//sdk SwitchAccount回调
|
||||||
public void SwitchAccountCallback(string data)
|
public void SwitchAccountCallback(string data)
|
||||||
{
|
{
|
||||||
Debug.Log("Helper : PayCallback - data: " + data);
|
Debug.Log("Helper : SwitchAccountCallback - data: " + data);
|
||||||
proxy.PushMessage(new Message
|
proxy.PushMessage(new Message
|
||||||
{
|
{
|
||||||
msgId = MessageDef.MSG_SwitchAccountCallback,
|
msgId = MessageDef.MSG_SwitchAccountCallback,
|
||||||
|
@ -200,7 +200,7 @@ namespace SDK
|
||||||
//sdk Logout回调
|
//sdk Logout回调
|
||||||
public void LogoutCallback(string data)
|
public void LogoutCallback(string data)
|
||||||
{
|
{
|
||||||
Debug.Log("Helper : PayCallback - data: " + data);
|
Debug.Log("Helper : LogoutCallback - data: " + data);
|
||||||
proxy.PushMessage(new Message
|
proxy.PushMessage(new Message
|
||||||
{
|
{
|
||||||
msgId = MessageDef.MSG_LogoutCallback,
|
msgId = MessageDef.MSG_LogoutCallback,
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
--- 管理器名字
|
--- 管理器名字
|
||||||
|
|
||||||
local ManagerNames = {
|
local ManagerNames = {
|
||||||
|
--数据中心管理
|
||||||
|
"DataCenterService/DataCenterManager",
|
||||||
|
"DataCenterService/ThinkingAnalyticsManager",
|
||||||
|
"DataCenterService/TapDBManager",
|
||||||
-- 游戏设置管理
|
-- 游戏设置管理
|
||||||
"Setting/SettingManager",
|
"Setting/SettingManager",
|
||||||
--通信管理,所有的通信接口
|
--通信管理,所有的通信接口
|
||||||
|
@ -95,10 +99,6 @@ local ManagerNames = {
|
||||||
"Pay/PayManager",
|
"Pay/PayManager",
|
||||||
--首充
|
--首充
|
||||||
"FirstRecharge/FirstRechargeManager",
|
"FirstRecharge/FirstRechargeManager",
|
||||||
--数据中心管理
|
|
||||||
"DataCenterService/DataCenterManager",
|
|
||||||
"DataCenterService/ThinkingAnalyticsManager",
|
|
||||||
"DataCenterService/TapDBManager",
|
|
||||||
-- 云梦祈祷
|
-- 云梦祈祷
|
||||||
"Pray/PrayManager",
|
"Pray/PrayManager",
|
||||||
-- 无尽副本数据
|
-- 无尽副本数据
|
||||||
|
|
|
@ -17,6 +17,7 @@ local function _DicToStr(data)
|
||||||
str = str .."|"
|
str = str .."|"
|
||||||
end
|
end
|
||||||
str = str..string.format(fmt, key, tostring(value), type(value) == "number" and 1 or 0)
|
str = str..string.format(fmt, key, tostring(value), type(value) == "number" and 1 or 0)
|
||||||
|
index = index + 1
|
||||||
end
|
end
|
||||||
return str
|
return str
|
||||||
end
|
end
|
||||||
|
@ -61,6 +62,7 @@ function this.SetSuperProperties(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
local sData = _DicToStr(_SuperPropertise)
|
local sData = _DicToStr(_SuperPropertise)
|
||||||
|
Log("打点静态数据:"..sData)
|
||||||
App.TAMgr:SetSuperProperties(sData)
|
App.TAMgr:SetSuperProperties(sData)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -74,7 +76,9 @@ end
|
||||||
|
|
||||||
-- 打点事件
|
-- 打点事件
|
||||||
function this.Track(event, data)
|
function this.Track(event, data)
|
||||||
local dStr = _DicToStr(data)
|
Log("打点事件:"..event)
|
||||||
|
local dStr = data and _DicToStr(data) or ""
|
||||||
|
Log("打点数据:"..dStr)
|
||||||
App.TAMgr:Track(event, dStr)
|
App.TAMgr:Track(event, dStr)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -23,21 +23,26 @@ function this.Initialize()
|
||||||
|
|
||||||
SDKMgr.onLoginCallback = function(loginResp)
|
SDKMgr.onLoginCallback = function(loginResp)
|
||||||
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,loginResp)
|
Game.GlobalEvent:DispatchEvent(GameEvent.LoginSuccess.OnLoginSuccess,loginResp)
|
||||||
|
ThinkingAnalyticsManager.Track("app_login")
|
||||||
end
|
end
|
||||||
|
|
||||||
SDKMgr.onSwitchAccountCallback = function(resp)
|
SDKMgr.onSwitchAccountCallback = function(resp)
|
||||||
|
Log("onSwitchAccountCallback::"..resp)
|
||||||
local result = string.split(resp, "#")
|
local result = string.split(resp, "#")
|
||||||
--Util.LogError(debug.traceback("<color=#00ccee>onSwitchAccountCallback:" .. result[1] .. "</color>"))
|
--Util.LogError(debug.traceback("<color=#00ccee>onSwitchAccountCallback:" .. result[1] .. "</color>"))
|
||||||
if LoginManager.IsLogin and tonumber(result[1]) == SDKCodeResult.CODE_SW_LOGIN_SUCCESS then
|
if LoginManager.IsLogin and tonumber(result[1]) == SDK_RESULT.SUCCESS then
|
||||||
|
ThinkingAnalyticsManager.Track("change_account")
|
||||||
Framework.Dispose()
|
Framework.Dispose()
|
||||||
App.Instance:ReStart()
|
App.Instance:ReStart()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
SDKMgr.onLogoutCallback = function(resp)
|
SDKMgr.onLogoutCallback = function(resp)
|
||||||
|
Log("onLogoutCallback::"..resp)
|
||||||
local result = string.split(resp, "#")
|
local result = string.split(resp, "#")
|
||||||
--Util.LogError(debug.traceback("<color=#00ccee>onLogoutCallback:" .. result[1] .. "</color>"))
|
--Util.LogError(debug.traceback("<color=#00ccee>onLogoutCallback:" .. result[1] .. "</color>"))
|
||||||
if LoginManager.IsLogin and tonumber(result[1]) == SDKCodeResult.CODE_LOGOUT_SUCCESS then
|
if LoginManager.IsLogin and tonumber(result[1]) == SDK_RESULT.SUCCESS then
|
||||||
|
ThinkingAnalyticsManager.Track("quit_account")
|
||||||
Framework.Dispose()
|
Framework.Dispose()
|
||||||
App.Instance:ReStart()
|
App.Instance:ReStart()
|
||||||
end
|
end
|
||||||
|
|
|
@ -139,11 +139,12 @@ function this:OnOpen(...)
|
||||||
end
|
end
|
||||||
|
|
||||||
if IsSDKLogin then
|
if IsSDKLogin then
|
||||||
this.sdkLoginBtn:SetActive(true)
|
this.sdkLoginBtn:SetActive(false)
|
||||||
this.inputField.gameObject:SetActive(false)
|
this.inputField.gameObject:SetActive(false)
|
||||||
this.UserBtn:SetActive(false)
|
this.UserBtn:SetActive(false)
|
||||||
this.btnUser:SetActive(false)
|
this.btnUser:SetActive(false)
|
||||||
this.btnNotice.transform.position = this.btnUser.transform.position
|
this.btnNotice.transform.position = this.btnUser.transform.position
|
||||||
|
this.SDKLogin()
|
||||||
else
|
else
|
||||||
this.sdkLoginBtn:SetActive(false)
|
this.sdkLoginBtn:SetActive(false)
|
||||||
|
|
||||||
|
|
|
@ -119,8 +119,6 @@ function this.PlayerInfoRequest(func)
|
||||||
|
|
||||||
-- 数据打点
|
-- 数据打点
|
||||||
ThinkingAnalyticsManager.SetSuperProperties({
|
ThinkingAnalyticsManager.SetSuperProperties({
|
||||||
server_id = 1,
|
|
||||||
account = AppConst.OpenId,
|
|
||||||
role_id = PlayerManager.uid,
|
role_id = PlayerManager.uid,
|
||||||
role_name = PlayerManager.nickName,
|
role_name = PlayerManager.nickName,
|
||||||
vip_level = msg.player.vipLevel,
|
vip_level = msg.player.vipLevel,
|
||||||
|
|
|
@ -30,16 +30,18 @@ end
|
||||||
|
|
||||||
function this.RequestPay(context)
|
function this.RequestPay(context)
|
||||||
SDKMgr.onPayCallback = function(payResp)
|
SDKMgr.onPayCallback = function(payResp)
|
||||||
|
Log("onPayCallback::"..payResp)
|
||||||
local str = string.split(payResp, "#")
|
local str = string.split(payResp, "#")
|
||||||
local result = tonumber(str[1])
|
local result = tonumber(str[1])
|
||||||
if code == SDK_RESULT.SUCCESS then
|
local orderId = str[2]
|
||||||
|
if result == SDK_RESULT.SUCCESS then
|
||||||
DataCenterManager.CommitPayStatus(
|
DataCenterManager.CommitPayStatus(
|
||||||
"IN_GAME_"..context.Type,
|
"IN_GAME_"..context.Type,
|
||||||
SDKMgr:GetPayOrderID(),
|
SDKMgr:GetPayOrderID(),
|
||||||
"VALID",
|
"VALID",
|
||||||
tostring(context.Price)
|
tostring(context.Price)
|
||||||
)
|
)
|
||||||
elseif code == SDK_RESULT.FAILED then
|
elseif result == SDK_RESULT.FAILED then
|
||||||
DataCenterManager.CommitPayStatus(
|
DataCenterManager.CommitPayStatus(
|
||||||
"IN_GAME_"..context.Type,
|
"IN_GAME_"..context.Type,
|
||||||
SDKMgr:GetPayOrderID(),
|
SDKMgr:GetPayOrderID(),
|
||||||
|
@ -76,11 +78,17 @@ function this.RequestPay(context)
|
||||||
params.guildID = PlayerManager.familyId
|
params.guildID = PlayerManager.familyId
|
||||||
-- 其他
|
-- 其他
|
||||||
params.payNotifyUrl = ""
|
params.payNotifyUrl = ""
|
||||||
params.extension = tostring(context.Id)
|
params.extension = string.format("%s#%s", PlayerManager.uid, context.Id)--tostring(context.Id)
|
||||||
-- string.format("%s_%s_%s_%s_%s_%s",
|
--string.format("%s_%s_%s_%s_%s_%s",
|
||||||
-- AppConst.OpenId,context.Id,context.Price,PlayerManager.uid,
|
-- AppConst.OpenId,context.Id,context.Price,PlayerManager.uid,
|
||||||
-- PlayerManager.serverInfo.server_id,PlayerManager.serverInfo.name)
|
-- PlayerManager.serverInfo.server_id,PlayerManager.serverInfo.name)
|
||||||
SDKMgr:Pay(params)
|
SDKMgr:Pay(params)
|
||||||
|
|
||||||
|
--
|
||||||
|
ThinkingAnalyticsManager.Track("create_order", {
|
||||||
|
goods_id = context.Id,
|
||||||
|
order_money_amount = context.Price,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return this
|
return this
|
|
@ -176,6 +176,11 @@ function this.PromoteLevel(exp)
|
||||||
-- Log("玩家升级成功!")
|
-- Log("玩家升级成功!")
|
||||||
-- Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnLevelChange)
|
-- Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnLevelChange)
|
||||||
--end
|
--end
|
||||||
|
-- 打点数据
|
||||||
|
TapDBManager.SetLevel(this.level)
|
||||||
|
-- ThinkingAnalyticsManager.SetSuperProperties({
|
||||||
|
|
||||||
|
-- })
|
||||||
end
|
end
|
||||||
function this.SetMaxEnergy()
|
function this.SetMaxEnergy()
|
||||||
this.maxEnergy = this.userLevelData[this.level].MaxEnergy
|
this.maxEnergy = this.userLevelData[this.level].MaxEnergy
|
||||||
|
|
|
@ -49,6 +49,10 @@ function this.ChangeUserName(type, name, teamPosId, sex, callBack)
|
||||||
this.roleName = name
|
this.roleName = name
|
||||||
PlayerManager.nickName = name
|
PlayerManager.nickName = name
|
||||||
|
|
||||||
|
-- 打点静态数据修改
|
||||||
|
ThinkingAnalyticsManager.SetSuperProperties({
|
||||||
|
role_name = PlayerManager.nickName,
|
||||||
|
})
|
||||||
-- 创建角色时保存一下头像数据
|
-- 创建角色时保存一下头像数据
|
||||||
if type == 1 then
|
if type == 1 then
|
||||||
local config = ConfigManager.GetConfigDataByKey(ConfigName.PlayerRole, "Role", sex)
|
local config = ConfigManager.GetConfigDataByKey(ConfigName.PlayerRole, "Role", sex)
|
||||||
|
|
|
@ -44,6 +44,9 @@
|
||||||
<meta-data android:name="channellevel1" android:value="MHT" />
|
<meta-data android:name="channellevel1" android:value="MHT" />
|
||||||
<meta-data android:name="channellevel2" android:value="MHT" />
|
<meta-data android:name="channellevel2" android:value="MHT" />
|
||||||
|
|
||||||
|
<!--刘海屏打开刘海处的使用权限-->
|
||||||
|
<meta-data android:name="android.notch_support" android:value="true" />
|
||||||
|
<meta-data android:name="notch.config" android:value="portrait|landscape"/>
|
||||||
</application>
|
</application>
|
||||||
<uses-feature android:glEsVersion="0x00020000" />
|
<uses-feature android:glEsVersion="0x00020000" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
Binary file not shown.
|
@ -430,7 +430,7 @@ namespace Assets.Scripts.Editor.LanguageTool
|
||||||
for (int lIndex = 0; lIndex < lines.Length; lIndex++)
|
for (int lIndex = 0; lIndex < lines.Length; lIndex++)
|
||||||
{
|
{
|
||||||
string line = lines[lIndex].Trim();
|
string line = lines[lIndex].Trim();
|
||||||
if (!line.StartsWith("--") && !line.StartsWith("log"))
|
if (!line.StartsWith("--") && !line.StartsWith("Log"))
|
||||||
{
|
{
|
||||||
Regex reg = new Regex("\"[^\"]*?[\u4e00-\u9fa5][^\"]*?\"");//正则表达式,判断是否包含中文字符
|
Regex reg = new Regex("\"[^\"]*?[\u4e00-\u9fa5][^\"]*?\"");//正则表达式,判断是否包含中文字符
|
||||||
if (reg.IsMatch(line))
|
if (reg.IsMatch(line))
|
||||||
|
|
Loading…
Reference in New Issue