diff --git a/UnityProject/Assets/AssetRaw/UI/UIGameEndForm.prefab b/UnityProject/Assets/AssetRaw/UI/UIGameEndForm.prefab index 4d80f4ac..f8ca420a 100644 --- a/UnityProject/Assets/AssetRaw/UI/UIGameEndForm.prefab +++ b/UnityProject/Assets/AssetRaw/UI/UIGameEndForm.prefab @@ -885,6 +885,7 @@ GameObject: - component: {fileID: 3152446807514931330} - component: {fileID: 989524148600500988} - component: {fileID: 4036430822919996928} + - component: {fileID: 3210026789478774212} m_Layer: 5 m_Name: m_btn_Close m_TagString: Untagged @@ -949,6 +950,50 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 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 GameObject: m_ObjectHideFlags: 0 diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/CommonData.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/CommonData.cs index 3983a907..fa9417fa 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/CommonData.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/CommonData.cs @@ -18,6 +18,15 @@ namespace GameLogic } + public class UploadScoreRequest + { + public string roomId; + public string roundId; + public string anchorUid; + public string winSide; + public List rankVos; + } + public class GameEndData { public string m_WinTeamName; diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs index d4f32a87..163b9218 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Common/EventConts.cs @@ -38,8 +38,8 @@ namespace GameLogic 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 UploadScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/uploadScores"; - public const string UploadScoreTest = "http://test-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/round/upload_scores"; 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 GetAnchorScore = "http://wmsj-api.ganfanxiaozu.com/api/dm/getAnchorScore"; diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameModelManager.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameModelManager.cs index a61b5bfb..9cab8b9a 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameModelManager.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameModelManager.cs @@ -3,10 +3,13 @@ using System.Threading.Tasks; using GameLogic; using TEngine; using System; +using JetBrains.Annotations; public class DataGameModelManager : GameBase.Singleton { + public int RoundId = 1; + #region 游戏结算上报 public void C2S_GameRankEnd() { @@ -93,8 +96,19 @@ public class DataGameModelManager : GameBase.Singleton } }); + // 新接口额外包装了一层数据 + + 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()}"); - 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}"); diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs index 5509344b..dd10e6b1 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/Manager/DataGameSceneManager.cs @@ -704,14 +704,14 @@ namespace GameLogic Log.Debug("当前积分最高的玩家"); var topPlayer = GetTopGongXianPlayer(); - + if (topPlayer == null) { Log.Error("当前没有玩家数据"); return; } - string sbyrPlayerName = GetSbyrPlayerName().protCustMessageData.nickName; + string sbyrPlayerName = GetSbyrPlayerName(winActorTeam).protCustMessageData.nickName; Log.Debug("当前虽败犹荣阵营的玩家:" + sbyrPlayerName); @@ -744,17 +744,20 @@ namespace GameLogic /// 获取除了胜利阵营外积分最高的玩家 /// /// - private UnitPlayerData GetSbyrPlayerName() + private UnitPlayerData GetSbyrPlayerName(ActorHItem winActor) { List m_tempList = new List(); 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) => { - if (a.m_LikeCount > b.m_LikeCount) + if (a.m_Score > b.m_Score) { return -1; } diff --git a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameEndForm.cs b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameEndForm.cs index deeeaedf..65cbd611 100644 --- a/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameEndForm.cs +++ b/UnityProject/Assets/GameScripts/HotFix/GameLogic/UI/UIGameEndForm.cs @@ -59,7 +59,10 @@ namespace GameLogic GameModule.Timer.AddTimer((e) => { - MoveGameLoaclRank(); + if (GameModule.UI.HasWindow()) + { + MoveGameLoaclRank(); + } }, 5); @@ -86,15 +89,8 @@ namespace GameLogic private void MoveGameLoaclRank() { - // ý DataGameModelManager.Instance.C2S_GameRankEnd(); - - //// ʾ - - //GameModule.UI.CloseUI(); - - } } }