海外sdk测试修改

zhangqiang 2020-08-14 12:23:32 +08:00
parent ea7c7c2eb4
commit f4cf94d61f
21 changed files with 235 additions and 10 deletions

View File

@ -0,0 +1 @@
{"subChannel":"1000", "buglyId":"261348dcd3", "channel":"MHT", "resUrl":"http://cdn-jl.lanjingshidai.com/mht_test/", "packageVersion":"0.4", "version":"0.1.0", "serverUrl":"http://119.28.117.110:8080/"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -125,7 +125,7 @@ namespace SDK
//sdk打点功能
public override void CustomEvent(string events, string desc)
{
currentActivity.Call<string>("CustomEvent", events, desc);
currentActivity.Call("CustomEvent", events, desc);
}
//登出
public override void Logout()

View File

@ -159,7 +159,11 @@ namespace SDK
{
proxy.Logout();
}
//sdk 埋点
public void CustomEvent(string events, string desc)
{
proxy.CustomEvent(events,desc);
}
/// <summary>
/// ///////// sdk层回调
/// </summary>

View File

@ -28,7 +28,8 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 2080994024284284624}
m_Father: {fileID: 224105024955911190}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -91,7 +92,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &224247026787075430
RectTransform:
m_ObjectHideFlags: 0
@ -680,3 +681,82 @@ MonoBehaviour:
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
--- !u!1 &3026680573370723225
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2080994024284284624}
- component: {fileID: 3526028211582355677}
- component: {fileID: 2180795285031342783}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2080994024284284624
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3026680573370723225}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224338872786980214}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 42.6}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3526028211582355677
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3026680573370723225}
m_CullTransparentMesh: 0
--- !u!114 &2180795285031342783
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3026680573370723225}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.972549, b: 0.9254902, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 12800000, guid: 4b73e9e4512d17e4daeea351e090d33c, type: 3}
m_FontSize: 35
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: 56%

View File

@ -2029,4 +2029,13 @@ HeroPanelBgByPropertyName = {
[2] = "r_hero_bg_fo",--佛
[3] = "r_hero_bg_yao",--妖
[4] = "r_hero_bg_dao",--道
}
FBSDKCustomEventType = {
LoginNum = 1,--几留
VipLv = 2,--Vip等级
FinishGuide = 3,--是否完成新手引导
RoleLv = 4,--玩家等级
FirstBuyMonthCard = 5,--首次购买普通月卡
FirstBuyHeightMonthCard = 6,--首次购买豪华月卡
FirstRecharge = 7,--完成首次充值
}

View File

@ -6,6 +6,7 @@ local ManagerNames = {
"DataCenterService/ThinkingAnalyticsManager",
"DataCenterService/TapDBManager",
"DataCenterService/BuglyManager",
"DataCenterService/CustomEventManager",
-- 游戏设置管理
"Setting/SettingManager",
--通信管理,所有的通信接口

View File

@ -0,0 +1,60 @@
CustomEventManager = {}
local this = CustomEventManager
local IsSDKLogin = AppConst.isSDKLogin
local FBSDKCustomEvents = {
[1] = {id = 1, info = 1,FBSDKCustomEventType = 1,event = "Registration",data = "用户完成注册或使用第三方渠道首次登陆"},
[2] = {id = 2, info = 2,FBSDKCustomEventType = 1,event = "Next day login",data = "次日登陆,即 次留"},
[3] = {id = 3, info = 3,FBSDKCustomEventType = 1,event = "3rd day login",data = "3留" },
[4] = {id = 4, info = 7,FBSDKCustomEventType = 1,event = "7th day login",data = "7留" },
[5] = {id = 5, info = 2,FBSDKCustomEventType = 2,event = "特权等级 2",data = "特权等级达到2" },
[6] = {id = 6, info = 4,FBSDKCustomEventType = 2,event = "特权等级 4",data = "特权等级达到4" },
[7] = {id = 7, info = 6,FBSDKCustomEventType = 2,event = "特权等级 6",data = "特权等级达到6" },
[8] = {id = 8, info = 8,FBSDKCustomEventType = 2,event = "特权等级 8",data = "特权等级达到8" },
[9] = {id = 9, info = 10,FBSDKCustomEventType = 2,event = "特权等级 10",data = "特权等级达到10" },
[10] = {id = 10, info = 13,FBSDKCustomEventType = 2,event = "特权等级 13",data = "特权等级达到13"},
[11] = {id = 11, info = 0,FBSDKCustomEventType = 3,event = "New role tutorial",data = "完成新手指引"},
[12] = {id = 12, info = 10,FBSDKCustomEventType = 4,event = "Levels achieved",data = "角色等级10"},
[13] = {id = 13, info = 20,FBSDKCustomEventType = 4,event = "Lv. 20",data = "角色等级20" },
[14] = {id = 14, info = 40,FBSDKCustomEventType = 4,event = "Lv. 40",data = "角色等级40"},
[15] = {id = 15, info = 80,FBSDKCustomEventType = 4,event = "Lv. 80",data = "角色等级80" },
[16] = {id = 16, info = 100,FBSDKCustomEventType = 4,event = "Lv. 100",data = "角色等级100" },
[17] = {id = 17, info = 0,FBSDKCustomEventType = 5,event = "Monthly card",data = "首次购买普通月卡" },
[18] = {id = 18, info = 0,FBSDKCustomEventType = 6,event = "Supreme card",data = "首次购买豪华月卡" },
[19] = {id = 19, info = 0,FBSDKCustomEventType = 7,event = "First topup",data = "完成首次充值" },
}
function this.SetisFirstLogVal(isDayFirst)
if isDayFirst == 0 then--今天第一次登陆
LogGreen("埋点上报数据 "..CalculateSecondsNowTo_N_OClock(24).." "..GetTimeStamp().." "..PlayerManager.userCreateTime)
local cur24Times = CalculateSecondsNowTo_N_OClock(24) + GetTimeStamp()
local day = math.floor((cur24Times - PlayerManager.userCreateTime)/86400) + 1
LogGreen("day "..day)
--发送埋点数据
this.SendCustomEvents(FBSDKCustomEventType.LoginNum,day)
end
end
function this.SendCustomEvents(CustomType,info)
local index = 0
for i = 1, #FBSDKCustomEvents do
local curFBSDKCustomEvents = FBSDKCustomEvents[i]
-- LogGreen("埋点上报数据1 "..curFBSDKCustomEvents.event.." "..curFBSDKCustomEvents.data.." "..CustomType.." "..info)
if CustomType == curFBSDKCustomEvents.FBSDKCustomEventType and info == curFBSDKCustomEvents.info then
-- LogGreen("埋点上报数据2 "..curFBSDKCustomEvents.id)
index = curFBSDKCustomEvents.id
break
end
end
if index > 0 then
LogGreen("埋点上报数据 成功 "..FBSDKCustomEvents[index].event.." "..FBSDKCustomEvents[index].data)
this.SendCustomEvent(FBSDKCustomEvents[index].event,FBSDKCustomEvents[index].data)
end
end
-- 打点事件
function this.SendCustomEvent(event, data)
if IsSDKLogin then
SDKMgr:CustomEvent(event,data)
end
end
return CustomEventManager

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 578bbd1f1a098954da54e78b6730b685
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -155,4 +155,12 @@ end
function this.PlayerPrefsGetStrItemId()
return PlayerPrefs.GetInt(PlayerManager.uid.."FirstRechatgePace", 0)--1 已经查看过不需要显示新红点 0 显示红点
end
function this.IsShowFirstChatge()
if FirstRechargeManager.isFirstRecharge == 1 and FirstRechargeManager.PlayerPrefsGetStrItemId() == 0 and ActTimeCtrlManager.IsQualifiled(38) and FirstRechargeManager.GetFirstRechargeExist() then
return true
else
return false
end
end
return this

View File

@ -125,6 +125,10 @@ function this.ShowGuide(id, ...)
step_id = id,
guild_start_time = math.floor(GetTimeStamp()),
})
if id == -1 then
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.FinishGuide,0)
end
-- 引导结束回调
local function onGuideClose()
if GuideConfig[id].Type == GuideType.Force then

View File

@ -1029,8 +1029,10 @@ function this:OnShow()
-- 刷新拍脸
local patFaceAllData = PatFaceManager.GetPatFaceAllDataTabs()
if patFaceAllData and #patFaceAllData <= 0 and not UIManager.IsOpen(UIName.PatFacePanel) then
if FirstRechargeManager.isFirstRecharge == 1 and FirstRechargeManager.PlayerPrefsGetStrItemId() == 0 and ActTimeCtrlManager.IsQualifiled(38) and FirstRechargeManager.GetFirstRechargeExist() then
if FirstRechargeManager.IsShowFirstChatge() then
FirstRechargeManager.PlayerPrefsSetStrItemId(1)
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.FirstRecharge,0)
UIManager.OpenPanel(UIName.FirstRechargePanel,nil,function()
AdventureManager.GetIsMaxTime()
end)

View File

@ -6,6 +6,7 @@ function LoadingPanel:InitComponent()
Log("LoadingPanel:InitComponent")
this.Slider = Util.GetGameObject(self.gameObject, "Slider"):GetComponent("Slider")
this.Tip = Util.GetGameObject(self.gameObject, "Slider/Image/LoadingText"):GetComponent("Text")
this.SliderText = Util.GetGameObject(self.gameObject, "Slider/Fill Area/Fill/Image/Text"):GetComponent("Text")
screenAdapte(Util.GetGameObject(self.gameObject, "bg1"))
screenAdapte(Util.GetGameObject(self.gameObject, "bg2"))
@ -17,7 +18,11 @@ local lerp = 0
local maxIndex = 0
local function update()
lerp = math.clamp(lerp + Time.fixedDeltaTime * 15,0,1)
this.Slider.value = this.Slider.value * (1-lerp) + curIndex * lerp
local curValue = this.Slider.value * (1-lerp) + curIndex * lerp
this.Slider.value = curValue
local curTextValue = math.floor(((this.Slider.value * (1-lerp) + curIndex * lerp)/32)*100)
curTextValue = curTextValue > 100 and 100 or curTextValue
this.SliderText.text = curTextValue .."%"
end
function LoadingPanel.AddStep(func)

View File

@ -105,8 +105,8 @@ function this.PlayerInfoRequest(func)
PlayerManager.maxForce = msg.player.maxForce
-- RecruitManager.randCount = msg.randCount % 100 --钻石抽卡已招募次数 用不上了 协议没删
RecruitManager.isTenRecruit = msg.firstTenth --首次十连
PatFaceManager.SetisFirstLogVal(msg.isDayFirst)
PlayerManager.userCreateTime = msg.userCreateTime
PatFaceManager.SetisFirstLogVal(msg.isDayFirst)
SoulPrintManager.soulEquipPool = msg.SoulEquipPool
PlayerManager.designation = msg.player.designation--称号
PlayerManager.skin = msg.player.decrotion--皮肤
@ -148,6 +148,7 @@ function this.PlayerInfoRequest(func)
PlayerManager.InitHandBookData(msg.heroHandBook, msg.equipHandBook)
PlayerManager.serverTime = msg.player.serverTime
CustomEventManager.SetisFirstLogVal(msg.isDayFirst)
AdventureManager.serverTime = msg.player.serverTime
ActivityGiftManager.serverTime = msg.player.serverTime

View File

@ -560,6 +560,8 @@ function this.UpdateMonthCardData(msg)
end
end
monthCardData = {}
local curActiveMONTHCARD = false
local curActiveLUXURYMONTHCARD = false
for i = 1, #msg.monthinfos do
--LogError("月卡信息推送 "..msg.monthinfos[i].id.." "..msg.monthinfos[i].endingTime.." "..msg.monthinfos[i].state)
local singleMonthCard = {}
@ -568,14 +570,24 @@ function this.UpdateMonthCardData(msg)
singleMonthCard.state = msg.monthinfos[i].state--0 未领取 1 已领取
if i == MONTH_CARD_TYPE.MONTHCARD then
monthSaveAmt = msg.monthinfos[i].totleAmt
curActiveMONTHCARD = true
elseif i == MONTH_CARD_TYPE.LUXURYMONTHCARD then
smonthSaveAmt = msg.monthinfos[i].totleAmt
curActiveLUXURYMONTHCARD = true
end
table.insert(monthCardData,singleMonthCard)
end
CheckRedPointStatus(RedPointType.MonthCard)
if showStr ~= "" then
if ActTimeCtrlManager.SingleFuncState(JumpType.Welfare) then
if curActiveMONTHCARD then
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.FirstBuyMonthCard,0)
end
if curActiveLUXURYMONTHCARD then
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.FirstBuyHeightMonthCard,0)
end
MsgPanel.ShowTwo(showStr, function()
JumpManager.GoJump(36004)
end,

View File

@ -146,6 +146,10 @@ function this.BcakUpdateUserExp(_msg)
CheckRedPointStatus(RedPointType.EpicExplore_OpenCarbon)
--FightManager.SetAndGetSingleFightState3(this.level)
RedPointManager.SetExploreRedPoint({ level = this.level })
-- 打点数据
TapDBManager.SetLevel(this.level)
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.RoleLv,this.level)
end
Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnPlayerLvChange)
if this.userLevelData and this.userLevelData[this.level] then
@ -180,8 +184,6 @@ function this.PromoteLevel(exp)
-- Log("玩家升级成功!")
-- Game.GlobalEvent:DispatchEvent(GameEvent.Player.OnLevelChange)
--end
-- 打点数据
TapDBManager.SetLevel(this.level)
-- ThinkingAnalyticsManager.SetSuperProperties({
-- })

View File

@ -66,6 +66,8 @@ function this.SetVipLevel(level)
GoodFriendManager.OnRefreshEnegryData()
CheckRedPointStatus(RedPointType.LuckyCat_GetReward)
Game.GlobalEvent:DispatchEvent(GameEvent.Bag.BagGold)
--发送埋点数据
CustomEventManager.SendCustomEvents(FBSDKCustomEventType.VipLv,vipLevel)
end
-- 刷新累充数量,更新VIP等级

View File

@ -0,0 +1 @@
{"subChannel":"1000", "buglyId":"261348dcd3", "channel":"MHT", "resUrl":"http://cdn-jl.lanjingshidai.com/mht_test/", "packageVersion":"0.4", "version":"0.1.0", "serverUrl":"http://119.28.117.110:8080/"}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: a55ba8deae549bf4d9e47cfd56709856
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -288,7 +288,7 @@ namespace GameLogic
void OnResUpdateProgress(ResUpdateProgress progress)
{
slider.UpdateValue(progress.Progress);
tipsText.text = string.Format("下载进度:{0}/{1}MB", progress.SizeMB, progress.TotalSizeMB);
tipsText.text = string.Format("下载进度:{0}/{1}MB({2}%)", progress.SizeMB, progress.TotalSizeMB, (progress.SizeMB/progress.TotalSizeMB)*100);
}
/// <summary>

View File

@ -17,6 +17,7 @@ public class SDK_SDKManagerWrap
L.RegFunction("GetPayOrderID", GetPayOrderID);
L.RegFunction("CaptureShot", CaptureShot);
L.RegFunction("Logout", Logout);
L.RegFunction("CustomEvent", CustomEvent);
L.RegFunction("InitCallback", InitCallback);
L.RegFunction("RegisterCallback", RegisterCallback);
L.RegFunction("LoginCallback", LoginCallback);
@ -205,6 +206,24 @@ public class SDK_SDKManagerWrap
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int CustomEvent(IntPtr L)
{
try
{
ToLua.CheckArgsCount(L, 3);
SDK.SDKManager obj = (SDK.SDKManager)ToLua.CheckObject<SDK.SDKManager>(L, 1);
string arg0 = ToLua.CheckString(L, 2);
string arg1 = ToLua.CheckString(L, 3);
obj.CustomEvent(arg0, arg1);
return 0;
}
catch (Exception e)
{
return LuaDLL.toluaL_exception(L, e);
}
}
[MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
static int InitCallback(IntPtr L)
{