修改结算接口,开始处理闭环相关的问题

This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-05-15 17:54:25 +08:00
parent a461151b9a
commit 26832b730a
6 changed files with 83 additions and 16 deletions

View File

@ -885,6 +885,7 @@ GameObject:
- component: {fileID: 3152446807514931330} - component: {fileID: 3152446807514931330}
- component: {fileID: 989524148600500988} - component: {fileID: 989524148600500988}
- component: {fileID: 4036430822919996928} - component: {fileID: 4036430822919996928}
- component: {fileID: 3210026789478774212}
m_Layer: 5 m_Layer: 5
m_Name: m_btn_Close m_Name: m_btn_Close
m_TagString: Untagged m_TagString: Untagged
@ -949,6 +950,50 @@ MonoBehaviour:
m_FillOrigin: 0 m_FillOrigin: 0
m_UseSpriteMesh: 0 m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1 m_PixelsPerUnitMultiplier: 1
--- !u!114 &3210026789478774212
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1862910006349227494}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4036430822919996928}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &2116892257331728460 --- !u!1 &2116892257331728460
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -18,6 +18,15 @@ namespace GameLogic
} }
public class UploadScoreRequest
{
public string roomId;
public string roundId;
public string anchorUid;
public string winSide;
public List<PostPlayRankData> rankVos;
}
public class GameEndData public class GameEndData
{ {
public string m_WinTeamName; public string m_WinTeamName;

View File

@ -38,8 +38,8 @@ namespace GameLogic
public const string GetAllRank = "http://wmsj-api.ganfanxiaozu.com/api/dm/getAllRanks"; public const string GetAllRank = "http://wmsj-api.ganfanxiaozu.com/api/dm/getAllRanks";
public const string GetAllRankTest = "http://test-api.ganfanxiaozu.com/api/dm/getAllRanks"; public const string GetAllRankTest = "http://test-api.ganfanxiaozu.com/api/dm/getAllRanks";
public const string UploadScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/uploadScores"; public const string UploadScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/round/upload_scores";
public const string UploadScoreTest = "http://test-api.ganfanxiaozu.com/api/dm/uploadScores"; public const string UploadScoreTest = "http://test-api.ganfanxiaozu.com/api/dm/round/upload_scores";
public const string UpLoadAnchorScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/uploadAnchorScore"; public const string UpLoadAnchorScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/uploadAnchorScore";
public const string UpLoadAnchorScoreTest = "http://test-api.ganfanxiaozu.com/api/dm/uploadAnchorScore"; public const string UpLoadAnchorScoreTest = "http://test-api.ganfanxiaozu.com/api/dm/uploadAnchorScore";
public const string GetAnchorScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/getAnchorScore"; public const string GetAnchorScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/getAnchorScore";

View File

@ -3,10 +3,13 @@ using System.Threading.Tasks;
using GameLogic; using GameLogic;
using TEngine; using TEngine;
using System; using System;
using JetBrains.Annotations;
public class DataGameModelManager : GameBase.Singleton<DataGameModelManager> public class DataGameModelManager : GameBase.Singleton<DataGameModelManager>
{ {
public int RoundId = 1;
#region #region
public void C2S_GameRankEnd() public void C2S_GameRankEnd()
{ {
@ -93,8 +96,19 @@ public class DataGameModelManager : GameBase.Singleton<DataGameModelManager>
} }
}); });
// 新接口额外包装了一层数据
UploadScoreRequest uploadScoreRequest = new UploadScoreRequest();
uploadScoreRequest.roomId = EventConts.RoomData.room_id;
uploadScoreRequest.roundId = RoundId.ToString();
uploadScoreRequest.rankVos = rankInfos;
uploadScoreRequest.anchorUid = EventConts.RoomData.anchor_open_id;
uploadScoreRequest.winSide = "blue";
RoundId++;
Log.Debug($"上传排行榜数据:{rankInfos.ToJson()}"); Log.Debug($"上传排行榜数据:{rankInfos.ToJson()}");
string m_Json = EventConts.PlatformType == PlatformType.None ? HttpSendHelper.HttpPostRequest(EventConts.UploadScoreTest, rankInfos.ToJson()) : HttpSendHelper.HttpPostRequest(EventConts.UploadScore, rankInfos.ToJson()); string m_Json = EventConts.PlatformType == PlatformType.None ? HttpSendHelper.HttpPostRequest(EventConts.UploadScoreTest, uploadScoreRequest.ToJson()) : HttpSendHelper.HttpPostRequest(EventConts.UploadScore, uploadScoreRequest.ToJson());
Log.Debug($"收到排行榜数据:{m_Json}"); Log.Debug($"收到排行榜数据:{m_Json}");

View File

@ -711,7 +711,7 @@ namespace GameLogic
return; return;
} }
string sbyrPlayerName = GetSbyrPlayerName().protCustMessageData.nickName; string sbyrPlayerName = GetSbyrPlayerName(winActorTeam).protCustMessageData.nickName;
Log.Debug("当前虽败犹荣阵营的玩家:" + sbyrPlayerName); Log.Debug("当前虽败犹荣阵营的玩家:" + sbyrPlayerName);
@ -744,17 +744,20 @@ namespace GameLogic
/// 获取除了胜利阵营外积分最高的玩家 /// 获取除了胜利阵营外积分最高的玩家
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
private UnitPlayerData GetSbyrPlayerName() private UnitPlayerData GetSbyrPlayerName(ActorHItem winActor)
{ {
List<UnitPlayerData> m_tempList = new List<UnitPlayerData>(); List<UnitPlayerData> m_tempList = new List<UnitPlayerData>();
foreach (var item in m_DicUnitPlayerDatas) foreach (var item in m_DicUnitPlayerDatas)
{ {
m_tempList.Add(item.Value); if (item.Value.teamId != winActor.m_Index.ToString())
{
m_tempList.Add(item.Value);
}
} }
m_tempList.Sort((a, b) => m_tempList.Sort((a, b) =>
{ {
if (a.m_LikeCount > b.m_LikeCount) if (a.m_Score > b.m_Score)
{ {
return -1; return -1;
} }

View File

@ -59,7 +59,10 @@ namespace GameLogic
GameModule.Timer.AddTimer((e) => GameModule.Timer.AddTimer((e) =>
{ {
MoveGameLoaclRank(); if (GameModule.UI.HasWindow<UIGameEndForm>())
{
MoveGameLoaclRank();
}
}, 5); }, 5);
@ -86,15 +89,8 @@ namespace GameLogic
private void MoveGameLoaclRank() private void MoveGameLoaclRank()
{ {
// 调用结算分配 // 调用结算分配
DataGameModelManager.Instance.C2S_GameRankEnd(); DataGameModelManager.Instance.C2S_GameRankEnd();
//// ĎÔĘž˝áËă˝çĂć
//GameModule.UI.CloseUI<UIGameEndForm>();
} }
} }
} }