Merge branch 'china/test' into china/dev

dev_chengFeng
wangzhenxing 2022-07-19 17:50:54 +08:00
commit ff2d384861
5 changed files with 87 additions and 9 deletions

View File

@ -52,7 +52,7 @@ namespace GameLogic
Reset();
}
/// <summary>
/// 析构函数
/// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/// </summary>
void OnDestroy()
{
@ -114,7 +114,6 @@ namespace GameLogic
}
yield break;
}
UnityWebRequest request = UnityWebRequest.Get(url);
request.certificateHandler = new AcceptAllCertificatesSignedWithASpecificPublicKey();
@ -150,16 +149,78 @@ namespace GameLogic
public void SendHttpPost_Json_Lua(string url, string data, LuaFunction callback, LuaFunction errorLuaFunc)
{
//Debug.LogError("data==="+data);
var strs = data.Split(';');
Hashtable table = new Hashtable();
for (int i = 0; i < strs.Length; i = i + 2)
{
table.Add(strs[i], strs[i + 1]);
string v1 = strs[i];
string v3 = strs[i + 1];
//long v2 = 0;
//if (strs[i].Equals("total_amount") || strs[i].Equals("trade_time") || strs[i].Equals("valid_time"))
//{
// long.TryParse(v3, out v2);
// Debug.LogError("v2=="+v2);
// table.Add(v1, v2);
//}
//else
//{
// table.Add(v1, strs[i + 1]);
//}
table.Add(v1, v3);
}
var jsonData = MiniJSON.jsonEncode(table);
StartCoroutine(HttpPost_Co(url, jsonData, callback, null, null, errorLuaFunc));
Debug.LogError("url " + jsonData);
// StartCoroutine(HttpPost_Co(url, jsonData, callback, null, null, errorLuaFunc));
StartCoroutine(PostData(url, jsonData, callback, null, null, errorLuaFunc));
}
public IEnumerator PostData(string url, string data, LuaFunction callback, Action<string> sharpFunc, Action errorAction, LuaFunction errorLuaFunc)
{
//UnityWebRequest _request;
//byte[] databyte = Encoding.UTF8.GetBytes(data);
//_request = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST);
//_request.uploadHandler = new UploadHandlerRaw(databyte);
//_request.downloadHandler = new DownloadHandlerBuffer();
//_request.SetRequestHeader("Content-Type", "application/json;charset=utf-8");
//yield return _request.SendWebRequest();
//Debug.Log(_request.responseCode);
//if (_request.isHttpError || _request.isNetworkError)
//{
// Debug.LogError(_request.error);
//}
//else
//{
// Debug.Log(_request.downloadHandler.text);
//if (callback != null)
//{
// callback.Call(_request.downloadHandler.text);
//}
//}
UnityWebRequest www = UnityWebRequest.Post(url, data);
www.SetRequestHeader("Content-Type", "application/json;charset=utf-8");
byte[] bodyRaw = Encoding.UTF8.GetBytes(data);
www.uploadHandler = new UploadHandlerRaw(bodyRaw);
yield return www.SendWebRequest();
Debug.LogError("111111111111");
if (www.isNetworkError)
{
Debug.LogError(www.error);
}
Debug.LogError(www.downloadHandler.text);
if (callback != null)
{
callback.Call(www.downloadHandler.text);
}
}
public void SendHttpPost_Raw_CSharp(string url, string data, Action<string> sharpFunc, Action errorAction)
{
StartCoroutine(HttpPost_Co(url, data, null, sharpFunc, errorAction, null));
@ -198,6 +259,12 @@ namespace GameLogic
Dictionary<string, string> header = new Dictionary<string, string>();
header.Add("Content-Type", "application/json");
header.Add("charset", "utf-8");
Debug.LogError("data=="+data);
Debug.LogError("utf8=="+Encoding.UTF8.GetBytes(data));
byte[] b=Encoding.UTF8.GetBytes(data);
for (int i=0;i<b.Length;i++){
Debug.LogError(b[i]);
}
WWW postData = new WWW(url, Encoding.UTF8.GetBytes(data), header);
while (!postData.isDone)
{

View File

@ -2714,7 +2714,7 @@ RectTransform:
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: 1.5999999, y: -80.600006}
m_AnchoredPosition: {x: 1.5999999, y: -88}
m_SizeDelta: {x: 81.99, y: 31.18}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &12772199742531326
@ -3341,7 +3341,7 @@ RectTransform:
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: 1.5999999, y: -93.7}
m_AnchoredPosition: {x: 1.5999999, y: -88}
m_SizeDelta: {x: 170, y: 31.18}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8115985040223735316
@ -5222,7 +5222,7 @@ RectTransform:
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: 1.5999999, y: -93.7}
m_AnchoredPosition: {x: 1.5999999, y: -88}
m_SizeDelta: {x: 170, y: 31.18}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1891371567561976640
@ -5804,7 +5804,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 155.3, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 100.75}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2932693287766199764

View File

@ -67,6 +67,9 @@ function ActivityMainPanel:CheckActOpen(_index)
_index = i
end
end
if tabs[_index].IsRecharge == 1 and (not RECHARGEABLE) then
return
end
if tabs[_index].IfBack == 1 then
if tabs[_index].ActiveType > 0 then
local id = ActivityGiftManager.IsActivityTypeOpen(tabs[_index].ActiveType)

View File

@ -621,6 +621,9 @@ function this.IsQualifiled(id)
if not openRule or #openRule < 1 then
return true
end
if data.IsRecharge == 1 and (not RECHARGEABLE) then
return false
end
if openRule[1] == 1 then -- 关卡开启
qualifiled = FightPointPassManager.IsFightPointPass(openRule[2])
elseif openRule[1] == 2 then -- 等级开启

View File

@ -282,7 +282,12 @@ function this:UpdateHeroInfoData()
--角色定位按钮
this.posBtn.gameObject:SetActive(heroConFigData.ShowHeroLocation==1)
this.posBtn.gameObject:SetActive(false)
self.talismanBtn.gameObject:SetActive(true)
if heroConFigData.EquipTalismana then
self.talismanBtn.gameObject:SetActive(true)
else
self.talismanBtn.gameObject:SetActive(false)
end
if heroConFigData.EquipTalismana~=nil then
self.talismanIcon.sprite = this.spLoader:LoadSprite(GetResourcePath(itemConfig[heroConFigData.EquipTalismana[2]].ResourceID))
end