1
This commit is contained in:
@@ -20,6 +20,7 @@ public class GameManager : MonoSingleton<GameManager>
|
||||
public BotConfig botConfig; // 人机AI详细配置(Inspector可调,本地测试用)
|
||||
|
||||
public GameConfig gameConfig;
|
||||
public ActivityConfig activityConfig;
|
||||
public Dictionary<string, FishTypeConfig> dic_fishTypeConfigs = new Dictionary<string, FishTypeConfig>();
|
||||
public UserData user;
|
||||
public GameData gameData = new GameData();
|
||||
@@ -222,6 +223,8 @@ public class GameManager : MonoSingleton<GameManager>
|
||||
}
|
||||
});
|
||||
|
||||
APIRequestList.GetActivityConfig(res => { activityConfig = res; });
|
||||
|
||||
}
|
||||
public async Task InItLoad()
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace Assets.MyGame.Scripts.Net
|
||||
dic_API[APIType.ActivityConfig_RegisterConfig] = "/api/ActivityConfig/registerConfig";
|
||||
dic_API[APIType.ActivityConfig_BattleOrderConfig] = "/api/ActivityConfig/battleOrderConfig";
|
||||
dic_API[APIType.ActivityConfig_FishingReturnConfig] = "/api/ActivityConfig/fishingReturnConfig";
|
||||
dic_API[APIType.ActivityConfig_RankingRewardConfig] = "/api/ActivityConfig/rankingRewardConfig";
|
||||
|
||||
// ---------------- Hall ----------------
|
||||
dic_API[APIType.Hall_SaveSafeBox] = "/api/Hall/SaveSafeBox";
|
||||
@@ -162,6 +163,7 @@ namespace Assets.MyGame.Scripts.Net
|
||||
dic_API[APIType.Rank_GetUserList] = "/api/User/GetUserList";
|
||||
dic_API[APIType.Hall_GetRanking] = "/api/Hall/GetRanking";
|
||||
dic_API[APIType.Hall_GetChessRoomPartitionCount] = "/api/Hall/GetChessRoomPartitionCount";
|
||||
dic_API[APIType.Hall_SendBroadcast] = "/api/Hall/SendBroadcast";
|
||||
|
||||
// ---------------- Customer ----------------
|
||||
dic_API[APIType.Customer_Start] = "/customerapi/Customer/start";
|
||||
|
||||
@@ -194,4 +194,11 @@ namespace Assets.MyGame.Scripts.Net.APIRequest.Params
|
||||
{
|
||||
public int taskType = -1; // -1=全部
|
||||
}
|
||||
|
||||
/// <summary>发送全服广播(GET)</summary>
|
||||
[Serializable]
|
||||
public class SendBroadcastParam : RequestParamBase
|
||||
{
|
||||
public string message;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,15 @@ namespace Assets.MyGame.Scripts.Net
|
||||
APIManager.Response<FishingReturnConfig>(APIType.ActivityConfig_FishingReturnConfig, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取排行榜奖励配置(GET)
|
||||
/// 返回:RankingRewardConfig
|
||||
/// </summary>
|
||||
public static void GetRankingRewardConfig(Action<RankingRewardConfig> callback)
|
||||
{
|
||||
APIManager.Response<RankingRewardConfig>(APIType.ActivityConfig_RankingRewardConfig, callback);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,6 +296,18 @@ namespace Assets.MyGame.Scripts.Net
|
||||
APIManager.Response<int>(APIType.Hall_GetChessRoomPartitionCount, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 发送全服广播(GET /api/Hall/SendBroadcast?message=xxx)
|
||||
/// 返回:string
|
||||
/// </summary>
|
||||
public static void SendBroadcast(string message, Action<string> callback = null)
|
||||
{
|
||||
APIManager.Response<string>(APIType.Hall_SendBroadcast, new SendBroadcastParam
|
||||
{
|
||||
message = message
|
||||
}, callback);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,5 +66,10 @@ namespace Assets.MyGame.Scripts.Net.API
|
||||
/// 抽奖活动配置
|
||||
/// </summary>
|
||||
public LotteryActivityConfig lotteryActivityConfig;
|
||||
|
||||
/// <summary>
|
||||
/// 排名奖励配置
|
||||
/// </summary>
|
||||
public RankingRewardConfig rankingRewardConfig;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using Assets.MyGame.Scripts.Net.API.GameConfig_SubClass;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Net.API
|
||||
{
|
||||
/// <summary>
|
||||
/// 排行榜奖励配置
|
||||
/// Swagger: /api/ActivityConfig/rankingRewardConfig
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RankingRewardConfig
|
||||
{
|
||||
/// <summary>总开关</summary>
|
||||
public bool isEnabled;
|
||||
/// <summary>排行榜奖励分组列表</summary>
|
||||
public List<RankingRewardGroup> groups;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排行榜奖励分组(按排行类型区分:金币榜/等级榜/消耗榜)
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RankingRewardGroup
|
||||
{
|
||||
/// <summary>排行榜类型 1=金币 2=等级 3=今日消耗</summary>
|
||||
public int rankingType;
|
||||
/// <summary>排行榜名称</summary>
|
||||
public string name;
|
||||
/// <summary>排名奖励列表</summary>
|
||||
public List<RankingRewardItem> rewards;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 单个排名奖励
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class RankingRewardItem
|
||||
{
|
||||
/// <summary>排名起始</summary>
|
||||
public int rankMin;
|
||||
/// <summary>排名结束</summary>
|
||||
public int rankMax;
|
||||
/// <summary>金币奖励</summary>
|
||||
public long gold;
|
||||
/// <summary>钻石奖励</summary>
|
||||
public int diamond;
|
||||
/// <summary>道具奖励</summary>
|
||||
public List<GiftConfig> items;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 74847fe813711e846b11b409958a96ea
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -43,6 +43,9 @@ namespace Assets.MyGame.Scripts.Net
|
||||
/// <summary>捕鱼返利配置(GET)</summary>
|
||||
ActivityConfig_FishingReturnConfig,
|
||||
|
||||
/// <summary>排行榜奖励配置(GET)</summary>
|
||||
ActivityConfig_RankingRewardConfig,
|
||||
|
||||
|
||||
// ---------------- Hall ----------------
|
||||
/// <summary>存入保险箱(GET)</summary>
|
||||
@@ -330,6 +333,9 @@ namespace Assets.MyGame.Scripts.Net
|
||||
/// <summary>获取象棋分区总数(GET)</summary>
|
||||
Hall_GetChessRoomPartitionCount,
|
||||
|
||||
/// <summary>发送全服广播(GET)</summary>
|
||||
Hall_SendBroadcast,
|
||||
|
||||
|
||||
// ---------------- Customer ----------------
|
||||
/// <summary>发起会话(POST)</summary>
|
||||
|
||||
@@ -103,6 +103,10 @@ namespace Assets.MyGame.Scripts.Net
|
||||
roomMainPanel.subUIManager.CloseAll();
|
||||
roomMainPanel.subUIManager.ShowAsync(UIPanel.ZGXQGameExplain, msg);
|
||||
|
||||
break;
|
||||
// 房主开始游戏 → 通知红方配金币
|
||||
case "GoldConfigRequired":
|
||||
roomMainPanel.OnGoldConfigRequired(msg);
|
||||
break;
|
||||
//单发给触发人
|
||||
case "GoldConfigSuccess":
|
||||
|
||||
@@ -39,6 +39,11 @@ public partial class WebSocketSendList
|
||||
|
||||
// ======== 新增缺失方法 ========
|
||||
|
||||
public static void StartGameChineseChess(string gameId, string userId)
|
||||
{
|
||||
WebSocketManager.Instance.Send(SocketType.chess, "{\"type\":1,\"target\":\"StartGame\",\"invocationId\":\"1\",\"arguments\":[\"" + gameId + "\",\"" + userId + "\"]}");
|
||||
}
|
||||
|
||||
public static void RestartGameChineseChess(string gameId, string userId)
|
||||
{
|
||||
WebSocketManager.Instance.Send(SocketType.chess, "{\"type\":1,\"target\":\"RestartGame\",\"invocationId\":\"1\",\"arguments\":[\"" + gameId + "\",\"" + userId + "\"]}");
|
||||
|
||||
Reference in New Issue
Block a user