zhaoyang 2 years ago
parent
commit
4a1b1608f5
32 changed files with 613 additions and 16 deletions
  1. 4 1
      FGUIProject/assets/League/LeagueCreatUI.xml
  2. 0 0
      FGUIProject/assets/League/imageTest/bpjly_jtjt_3.png
  3. 0 0
      FGUIProject/assets/League/imageTest/grxx_bjbj.png
  4. 0 0
      FGUIProject/assets/League/imageTest/grxx_yx_dk.png
  5. 0 0
      FGUIProject/assets/League/imageTest/grxx_yx_gb.png
  6. 0 0
      FGUIProject/assets/League/imageTest/hz_zdzddg_1.png
  7. 0 0
      FGUIProject/assets/League/imageTest/hz_zdzddg_2.png
  8. 0 0
      FGUIProject/assets/League/imageTest/xz_wss.png
  9. 0 0
      FGUIProject/assets/League/imageTest/zjm_ej_suo.png
  10. 0 0
      FGUIProject/assets/League/imageTest/zjm_rk_6.png
  11. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_1.png
  12. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_2.png
  13. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_3.png
  14. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_4.png
  15. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_5.png
  16. 0 0
      FGUIProject/assets/League/imageTest/zjm_tptp_6.png
  17. BIN
      FGUIProject/assets/League/images/back.png
  18. BIN
      FGUIProject/assets/League/images/biaotizi.png
  19. BIN
      FGUIProject/assets/League/images/db_weixuanz.png
  20. BIN
      FGUIProject/assets/League/images/db_xuanzhong.png
  21. BIN
      FGUIProject/assets/League/images/lm_an.png
  22. BIN
      FGUIProject/assets/League/images/lm_db.png
  23. BIN
      FGUIProject/assets/League/images/lm_db2.png
  24. BIN
      FGUIProject/assets/League/images/lm_sousuok.png
  25. BIN
      FGUIProject/assets/League/images/lm_tb.png
  26. 24 15
      FGUIProject/assets/League/package.xml
  27. 50 0
      GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs
  28. 11 0
      GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs.meta
  29. 52 0
      GameClient/Assets/Game/HotUpdate/Data/VO/LeagueData.cs
  30. 11 0
      GameClient/Assets/Game/HotUpdate/Data/VO/LeagueData.cs.meta
  31. 450 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs
  32. 11 0
      GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs.meta

+ 4 - 1
FGUIProject/assets/League/LeagueCreatUI.xml

@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1080,1920">
+<component size="1080,1113">
   <displayList>
+    <image id="n5_a0cf" name="n5" src="a0cf2e" fileName="images/lm_db.png" xy="0,0"/>
     <text id="n1_rv09" name="txtName" xy="285,474" size="509,42" fontSize="30" autoSize="none" text="" input="true" prompt="[color=#C3B4A6]输入联盟名字,支持模糊搜索[/color]" maxLength="7"/>
     <list id="n2_rv09" name="listIcon" xy="162,670" size="756,487" layout="flow_hz" overflow="scroll" defaultItem="ui://tw70qm9drv091h"/>
     <component id="n3_rv09" name="btnCreat" src="rv091g" fileName="components/Button6.xml" xy="442,1530"/>
     <component id="n4_rv09" name="comCost" src="n3xha1" fileName="components/ComCostCurrency.xml" pkg="eg2y0ldp" xy="421,1617" size="237,46"/>
+    <image id="n6_a0cf" name="n6" src="a0cf2a" fileName="images/biaotizi.png" xy="203,70"/>
+    <image id="n7_a0cf" name="n7" src="a0cf2g" fileName="images/lm_sousuok.png" xy="187,200"/>
   </displayList>
 </component>

+ 0 - 0
FGUIProject/assets/League/images/bpjly_jtjt_3.png → FGUIProject/assets/League/imageTest/bpjly_jtjt_3.png


+ 0 - 0
FGUIProject/assets/League/images/grxx_bjbj.png → FGUIProject/assets/League/imageTest/grxx_bjbj.png


+ 0 - 0
FGUIProject/assets/League/images/grxx_yx_dk.png → FGUIProject/assets/League/imageTest/grxx_yx_dk.png


+ 0 - 0
FGUIProject/assets/League/images/grxx_yx_gb.png → FGUIProject/assets/League/imageTest/grxx_yx_gb.png


+ 0 - 0
FGUIProject/assets/League/images/hz_zdzddg_1.png → FGUIProject/assets/League/imageTest/hz_zdzddg_1.png


+ 0 - 0
FGUIProject/assets/League/images/hz_zdzddg_2.png → FGUIProject/assets/League/imageTest/hz_zdzddg_2.png


+ 0 - 0
FGUIProject/assets/League/images/xz_wss.png → FGUIProject/assets/League/imageTest/xz_wss.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_ej_suo.png → FGUIProject/assets/League/imageTest/zjm_ej_suo.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_rk_6.png → FGUIProject/assets/League/imageTest/zjm_rk_6.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_1.png → FGUIProject/assets/League/imageTest/zjm_tptp_1.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_2.png → FGUIProject/assets/League/imageTest/zjm_tptp_2.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_3.png → FGUIProject/assets/League/imageTest/zjm_tptp_3.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_4.png → FGUIProject/assets/League/imageTest/zjm_tptp_4.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_5.png → FGUIProject/assets/League/imageTest/zjm_tptp_5.png


+ 0 - 0
FGUIProject/assets/League/images/zjm_tptp_6.png → FGUIProject/assets/League/imageTest/zjm_tptp_6.png


BIN
FGUIProject/assets/League/images/back.png


BIN
FGUIProject/assets/League/images/biaotizi.png


BIN
FGUIProject/assets/League/images/db_weixuanz.png


BIN
FGUIProject/assets/League/images/db_xuanzhong.png


BIN
FGUIProject/assets/League/images/lm_an.png


BIN
FGUIProject/assets/League/images/lm_db.png


BIN
FGUIProject/assets/League/images/lm_db2.png


BIN
FGUIProject/assets/League/images/lm_sousuok.png


BIN
FGUIProject/assets/League/images/lm_tb.png


+ 24 - 15
FGUIProject/assets/League/package.xml

@@ -12,22 +12,22 @@
     <component id="u2u38" name="LeagueMemberLogUI.xml" path="/" exported="true"/>
     <component id="u2u39" name="LeagueConstructUI.xml" path="/" exported="true"/>
     <component id="u2u3a" name="LeaguePrayUI.xml" path="/" exported="true"/>
-    <image id="u2u3b" name="xz_wss.png" path="/images/"/>
+    <image id="u2u3b" name="xz_wss.png" path="/imageTest/"/>
     <component id="u2u3u" name="ButtonModle2.xml" path="/components/"/>
-    <image id="u2u3v" name="zjm_tptp_3.png" path="/images/"/>
-    <image id="u2u3w" name="zjm_rk_6.png" path="/images/"/>
-    <image id="u2u3x" name="zjm_ej_suo.png" path="/images/"/>
+    <image id="u2u3v" name="zjm_tptp_3.png" path="/imageTest/"/>
+    <image id="u2u3w" name="zjm_rk_6.png" path="/imageTest/"/>
+    <image id="u2u3x" name="zjm_ej_suo.png" path="/imageTest/"/>
     <component id="u2u3y" name="ButtonModle3.xml" path="/components/"/>
-    <image id="u2u3z" name="zjm_tptp_2.png" path="/images/"/>
+    <image id="u2u3z" name="zjm_tptp_2.png" path="/imageTest/"/>
     <component id="u2u310" name="ButtonModle4.xml" path="/components/"/>
-    <image id="u2u311" name="zjm_tptp_5.png" path="/images/"/>
+    <image id="u2u311" name="zjm_tptp_5.png" path="/imageTest/"/>
     <component id="u2u312" name="ButtonModle5.xml" path="/components/"/>
-    <image id="u2u313" name="zjm_tptp_6.png" path="/images/"/>
+    <image id="u2u313" name="zjm_tptp_6.png" path="/imageTest/"/>
     <component id="u2u314" name="ButtonModle6.xml" path="/components/"/>
-    <image id="u2u315" name="zjm_tptp_1.png" path="/images/"/>
+    <image id="u2u315" name="zjm_tptp_1.png" path="/imageTest/"/>
     <component id="u2u316" name="ButtonModle7.xml" path="/components/"/>
-    <image id="u2u317" name="zjm_tptp_4.png" path="/images/"/>
-    <image id="u2u318" name="grxx_bjbj.png" path="/images/"/>
+    <image id="u2u317" name="zjm_tptp_4.png" path="/imageTest/"/>
+    <image id="u2u318" name="grxx_bjbj.png" path="/imageTest/"/>
     <component id="u2u319" name="Button1.xml" path="/components/"/>
     <component id="u2u31a" name="Button2.xml" path="/components/"/>
     <component id="u2u31b" name="Button3.xml" path="/components/"/>
@@ -47,22 +47,31 @@
     <component id="rv091q" name="Button13.xml" path="/components/"/>
     <component id="rv091r" name="Button14.xml" path="/components/"/>
     <component id="rv091s" name="Button15.xml" path="/components/"/>
-    <image id="rv091t" name="hz_zdzddg_1.png" path="/images/"/>
-    <image id="rv091u" name="hz_zdzddg_2.png" path="/images/"/>
+    <image id="rv091t" name="hz_zdzddg_1.png" path="/imageTest/"/>
+    <image id="rv091u" name="hz_zdzddg_2.png" path="/imageTest/"/>
     <component id="rv091w" name="Button16.xml" path="/components/"/>
     <component id="rv091x" name="Button17.xml" path="/components/"/>
     <component id="rv091y" name="Button18.xml" path="/components/"/>
     <component id="rv091z" name="ListApplyItem.xml" path="/components/"/>
     <component id="rv0920" name="ButtonToggle.xml" path="/components/"/>
-    <image id="rv0921" name="grxx_yx_dk.png" path="/images/"/>
-    <image id="rv0922" name="grxx_yx_gb.png" path="/images/"/>
+    <image id="rv0921" name="grxx_yx_dk.png" path="/imageTest/"/>
+    <image id="rv0922" name="grxx_yx_gb.png" path="/imageTest/"/>
     <component id="rv0923" name="ListLogItem.xml" path="/components/"/>
-    <image id="rv0924" name="bpjly_jtjt_3.png" path="/images/"/>
+    <image id="rv0924" name="bpjly_jtjt_3.png" path="/imageTest/"/>
     <component id="rv0925" name="ComConstruct.xml" path="/components/"/>
     <component id="rv0926" name="ComCurrency.xml" path="/components/"/>
     <component id="rv0927" name="ComGain.xml" path="/components/"/>
     <component id="rv0928" name="Button19.xml" path="/components/"/>
     <component id="rv0929" name="ComPary.xml" path="/components/"/>
+    <image id="a0cf2a" name="biaotizi.png" path="/images/"/>
+    <image id="a0cf2b" name="db_weixuanz.png" path="/images/"/>
+    <image id="a0cf2c" name="db_xuanzhong.png" path="/images/"/>
+    <image id="a0cf2d" name="lm_an.png" path="/images/"/>
+    <image id="a0cf2e" name="lm_db.png" path="/images/"/>
+    <image id="a0cf2f" name="lm_db2.png" path="/images/"/>
+    <image id="a0cf2g" name="lm_sousuok.png" path="/images/"/>
+    <image id="a0cf2h" name="lm_tb.png" path="/images/"/>
+    <image id="a0cf2i" name="back.png" path="/images/"/>
   </resources>
   <publish name="" path="..\GameClient\Assets\ResIn\UI\League" packageCount="2" genCode="true" maxAtlasSize="2048" extractAlpha="true"/>
 </packageDescription>

+ 50 - 0
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs

@@ -0,0 +1,50 @@
+using System.Collections.Generic;
+using ET;
+namespace GFGGame
+{
+    public class LeagueDataManager : SingletonBase<LeagueDataManager>
+    {
+        public int Type = 2;// 1:已经加入军团 2:未加入军团
+        public LeagueData LeagueData;//联盟信息
+        public Dictionary<long, LeagueListData> ListDatas = new Dictionary<long, LeagueListData>();//联盟列表
+        public Dictionary<long, OtherRoleInfoData> ListApplyDatas = new Dictionary<long, OtherRoleInfoData>();//联盟申请列表
+        public List<LeagueLogData> ListLogDatas = new List<LeagueLogData>();//日志数据
+
+
+        public void Clear()
+        {
+            Type = 2;
+            ListDatas.Clear();
+            LeagueData = null;
+            ListApplyDatas.Clear();
+            ListLogDatas.Clear();
+        }
+        public void UpdateNumeric(int type, long value)
+        {
+            switch (type)
+            {
+                case LeagueNumericType.HallLevel:
+                    LeagueData.HallLevel = value;
+                    break;
+                case LeagueNumericType.HotelLevel:
+                    LeagueData.HotelLevel = value;
+                    break;
+                case LeagueNumericType.StoreLevel:
+                    LeagueData.StoreLevel = value;
+                    break;
+                case LeagueNumericType.LowKeepDay:
+                    LeagueData.LowKeepDay = value;
+                    break;
+                case LeagueNumericType.LeagueCoin:
+                    LeagueData.LeagueCoin = value;
+                    break;
+                case LeagueNumericType.DayAdd:
+                    LeagueData.DayAdd = value;
+                    break;
+                case LeagueNumericType.NeedAudit:
+                    LeagueData.NeedAudit = value;
+                    break;
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/LeagueDataManager.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3219f7fcb301af3488eff597de4aa9b0
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 52 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/LeagueData.cs

@@ -0,0 +1,52 @@
+using System.Collections.Generic;
+
+namespace GFGGame
+{
+    public class LeagueData
+    {
+        public long LeagueId;//联盟id
+        public string Name;//联盟名字
+        public string Icon;//联盟徽章(资源名)
+        public string Notice;//联盟公告
+        public int Num;//联盟人数
+        public int AdEndTime;//广告结束时间
+        public long HallLevel { get; set; } //会客厅等级 影响 小酒馆等级上限,小金库等级上限,
+        public long HotelLevel { get; set; } //小酒馆等级 影响 人数上限 会花上限 每日新加入联盟成员上限 招募额外增加的成员上限,
+        public long StoreLevel { get; set; } //金库等级 影响 联盟资金储存上限
+        public long LowKeepDay { get; set; } //低维护天数
+        public long LeagueCoin { get; set; } //联盟资金
+        public long DayAdd { get; set; } //新加入联盟成员人数
+        public long NeedAudit { get; set; } //是否需要审核 0不用 1需要
+        public Dictionary<long, LeagueMemberData> LeagueMemberDatas = new Dictionary<long, LeagueMemberData>();//联盟成员
+    }
+
+    public class LeagueMemberData
+    {
+        public OtherRoleInfoData RoleInfo;
+        public int Pos;//有 LeaguePos 定义
+        public long WeekContribution;//本周贡献值
+        public long AllContribution;//累计贡献值
+        public long JoinLeagueTime;//加入联盟时间
+    }
+
+    public class LeagueListData
+    {
+        public long LeagueId;//联盟id
+        public string Name;//联盟名字
+        public string Icon;//联盟徽章(资源名)
+        public int Num;//联盟人数
+        public bool NeedAudit;//是否需要审核
+        public bool IsAd;//是否是广告
+        public int ApplyStatus;//0:可申请,1:申请中, 3:拒绝
+
+    }
+
+    public class LeagueLogData
+    {
+        public int Type;//LeagueJoinQuitLogType 1:加入 2:退出 3:变更 4:踢掉
+        public OtherRoleInfoData RoleInfo = new OtherRoleInfoData();
+        public long Time;//操作时间
+        public int OldPos;//旧职位 职位变更时需要
+        public int NewPos;//新职位 职位变更时需要
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/LeagueData.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 40bd3f3ad7f25514b9b52a6b05b11d52
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 450 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs

@@ -0,0 +1,450 @@
+using System;
+using System.Collections.Generic;
+using ET;
+
+namespace GFGGame
+{
+
+    //通知联盟值变化
+    public class NoticeLeagueNumeric : AMHandler<L2C_NoticeLeagueNumeric>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeLeagueNumeric message)
+        {
+            if (message.LeagueId == LeagueDataManager.Instance.LeagueData.LeagueId)
+            {
+                LeagueDataManager.Instance.UpdateNumeric(message.NumericType, message.NewValue);
+                EventAgent.DispatchEvent(ConstMessage.LEAGUE_NUMBERIC_CHANGE);
+            }
+            await ETTask.CompletedTask;
+        }
+    }
+    //通知有人离开了联盟
+    //通知有人申请加入联盟
+    public class NoticeApplyLeague : AMHandler<L2C_NoticeApplyLeague>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeApplyLeague message)
+        {
+            OtherRoleInfoData otherRoleInfo = LeagueSproxy.GetOtherRoleInfoData(message.RoleInfo);
+            LeagueDataManager.Instance.ListApplyDatas[otherRoleInfo.roleId] = otherRoleInfo;
+            await ETTask.CompletedTask;
+        }
+    }
+    //通知有人离开了联盟
+    public class NoticeLeaveLeague : AMHandler<L2C_NoticeLeaveLeague>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeLeaveLeague message)
+        {
+            if (message.LeagueId == LeagueDataManager.Instance.LeagueData.LeagueId)
+            {
+                if (message.LeaveRoleId == RoleDataManager.roleId)//自己离开联盟
+                {
+                    LeagueDataManager.Instance.Clear();
+                    LeagueSproxy.ReqGetLeagueInfo().Coroutine();
+                    if (ViewManager.isViewOpen(typeof(LeagueView).FullName))
+                    {
+                        ViewManager.Show<MainUIView>(null, null, true);
+                    }
+                    PromptController.Instance.ShowFloatTextPrompt("您已离开雅集");
+                }
+                else
+                {
+                    LeagueDataManager.Instance.LeagueData.LeagueMemberDatas.Remove(message.LeaveRoleId);
+                }
+                EventAgent.DispatchEvent(ConstMessage.LEAGUE_MEMBER_CHANGE);
+            }
+            await ETTask.CompletedTask;
+        }
+    }
+    //通知有人加入了联盟
+    public class NoticeJoinLeague : AMHandler<L2C_NoticeJoinLeague>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeJoinLeague message)
+        {
+            LeagueMemberData memberData = LeagueSproxy.GetLeagueMemberData(message.RoleInfo);
+            LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[memberData.RoleInfo.roleId] = memberData;
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_MEMBER_CHANGE);
+            await ETTask.CompletedTask;
+        }
+    }
+    //通知职位变化
+    public class NoticeLeaguePosChange : AMHandler<L2C_NoticeLeaguePosChange>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeLeaguePosChange message)
+        {
+            if (message.LeagueId == LeagueDataManager.Instance.LeagueData.LeagueId)
+            {
+                LeagueDataManager.Instance.LeagueData.LeagueMemberDatas[message.RoleId].Pos = message.Position;
+                EventAgent.DispatchEvent(ConstMessage.LEAGUE_MEMBER_CHANGE);
+            }
+            await ETTask.CompletedTask;
+        }
+    }
+
+    //通知有人加入了联盟
+    public class NoticeLeagueInfoChange : AMHandler<L2C_NoticeLeagueInfoChange>
+    {
+        protected override async ETTask Run(Session session, L2C_NoticeLeagueInfoChange message)
+        {
+            if (message.LeagueId == LeagueDataManager.Instance.LeagueData.LeagueId)
+            {
+                if (message.Type == 1)//1为名字
+                {
+                    LeagueDataManager.Instance.LeagueData.Name = message.Changed;
+                }
+                else if (message.Type == 2) //2为徽章
+                {
+                    LeagueDataManager.Instance.LeagueData.Icon = message.Changed;
+                }
+                else if (message.Type == 3)//3为公告
+                {
+                    LeagueDataManager.Instance.LeagueData.Notice = message.Changed;
+                }
+
+                EventAgent.DispatchEvent(ConstMessage.LEAGUE_INFO_CHANGE);
+            }
+
+            await ETTask.CompletedTask;
+        }
+    }
+    //获取加入退出日志
+    public class NoticeLeagueJoinQuitLog : AMHandler<S2C_LeagueJoinQuitLog>
+    {
+        protected override async ETTask Run(Session session, S2C_LeagueJoinQuitLog message)
+        {
+            LeagueLogData logData = LeagueSproxy.GetLeagueLogData(message.Logs);
+            LeagueDataManager.Instance.ListLogDatas.Insert(0, logData);
+            EventAgent.DispatchEvent(ConstMessage.LEAGUE_LOG_CHANGE);
+            await ETTask.CompletedTask;
+        }
+    }
+
+
+    public static class LeagueSproxy
+    {
+        //获取联盟信息
+        public static async ETTask<bool> ReqGetLeagueInfo()
+        {
+            S2C_GetLeagueInfo response = null;
+            response = (S2C_GetLeagueInfo)await MessageHelper.SendToServer(new C2S_GetLeagueInfo() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.Type = response.Type;
+                    LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
+                    LeagueDataManager.Instance.ListDatas.Clear();
+                    for (int i = 0; i < response.list.Count; i++)
+                    {
+                        LeagueListData leagueListData = GetLeagueListData(response.list[i]);
+                        LeagueDataManager.Instance.ListDatas[leagueListData.LeagueId] = leagueListData;
+                    }
+
+                    return true;
+                }
+            }
+            return false;
+        }
+        // 搜索联盟信息,leagueName为空则刷新
+        public static async ETTask<bool> ReqSearchLeagueInfo(string leagueName)
+        {
+            S2C_SearchLeagueInfo response = null;
+            response = (S2C_SearchLeagueInfo)await MessageHelper.SendToServer(new C2S_SearchLeagueInfo() { RoleId = RoleDataManager.roleId, Name = leagueName });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.ListDatas.Clear();
+                    for (int i = 0; i < response.list.Count; i++)
+                    {
+                        LeagueListData leagueListData = GetLeagueListData(response.list[i]);
+                        LeagueDataManager.Instance.ListDatas[leagueListData.LeagueId] = leagueListData;
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        //创建联盟
+        public static async ETTask<bool> ReqCreateLeague(string leagueName, string icon)
+        {
+            S2C_CreateLeague response = null;
+            response = (S2C_CreateLeague)await MessageHelper.SendToServer(new C2S_CreateLeague() { Name = leagueName, IconName = icon });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
+                    return true;
+                }
+            }
+            return false;
+        }
+        //申请加入联盟
+        public static async ETTask<bool> ReqJoinLeague(long leagueId)
+        {
+            S2C_ApplyJoinLeague response = null;
+            response = (S2C_ApplyJoinLeague)await MessageHelper.SendToServer(new C2S_ApplyJoinLeague() { RoleId = RoleDataManager.roleId, LeagueId = leagueId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    if (response.Type == 2)//加入成功
+                    {
+                        LeagueDataManager.Instance.LeagueData = GetLeagueData(response.LeagueDetailInfo);
+                    }
+                    else if (response.Type == 1)//等待审核
+                    {
+                        LeagueDataManager.Instance.ListDatas[leagueId].ApplyStatus = LeagueApplyStatus.Applying;
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        //获取申请加入联盟列表
+        public static async ETTask<bool> ReqGetApplyJoinLeagueList()
+        {
+            S2C_GetApplyJoinLeagueList response = null;
+            response = (S2C_GetApplyJoinLeagueList)await MessageHelper.SendToServer(new C2S_GetApplyJoinLeagueList() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    for (int i = 0; i < response.RoleInfo.Count; i++)
+                    {
+                        LeagueDataManager.Instance.ListApplyDatas[response.RoleInfo[i].RoleId] = GetOtherRoleInfoData(response.RoleInfo[i]);
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        //设置是否需要审批
+        public static async ETTask<bool> ReqSetLeagueApply(bool isNeed)
+        {
+            S2C_SetLeagueApply response = null;
+            response = (S2C_SetLeagueApply)await MessageHelper.SendToServer(new C2S_SetLeagueApply() { IsNeed = isNeed });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        //审核是否同意加入
+        public static async ETTask<bool> ReqAuditJoinLeague(long targetRoleId, bool IsAgreed)
+        {
+            S2C_AuditJoinLeague response = null;
+            response = (S2C_AuditJoinLeague)await MessageHelper.SendToServer(new C2S_AuditJoinLeague() { TargetRoleId = targetRoleId, IsAgreed = IsAgreed });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.ListApplyDatas.Remove(targetRoleId);
+
+                    return true;
+                }
+            }
+            return false;
+        }
+        //修改职位
+        public static async ETTask<bool> ReqChangeLeaguePos(long targetRoleId, int pos)
+        {
+            S2C_ChangeLeaguePos response = null;
+            response = (S2C_ChangeLeaguePos)await MessageHelper.SendToServer(new C2S_ChangeLeaguePos() { TargetRoleId = targetRoleId, Position = pos });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        //踢出联盟
+        public static async ETTask<bool> ReqKickLeague(long targetRoleId)
+        {
+            S2C_KickLeague response = null;
+            response = (S2C_KickLeague)await MessageHelper.SendToServer(new C2S_KickLeague() { TargetRoleId = targetRoleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        //退出联盟
+        public static async ETTask<bool> ReqQuitLeague()
+        {
+            S2C_QuitLeague response = null;
+            response = (S2C_QuitLeague)await MessageHelper.SendToServer(new C2S_QuitLeague() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        //修改联盟名字和联盟徽章
+        //type: 1为名字,2为徽章
+        public static async ETTask<bool> ReqChangeLeagueNameOrIcon(int type, string changed)
+        {
+            S2C_ChangeLeagueNameOrIcon response = null;
+            response = (S2C_ChangeLeagueNameOrIcon)await MessageHelper.SendToServer(new C2S_ChangeLeagueNameOrIcon() { Type = type, Changed = changed });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    if (type == 1)
+                    {
+                        LeagueDataManager.Instance.LeagueData.Name = changed;
+                    }
+                    else
+                    {
+                        LeagueDataManager.Instance.LeagueData.Icon = changed;
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        //修改公告
+        public static async ETTask<bool> ReqChangeLeagueNotice(string changed)
+        {
+            S2C_ChangeLeagueNotice response = null;
+            response = (S2C_ChangeLeagueNotice)await MessageHelper.SendToServer(new C2S_ChangeLeagueNotice() { RoleId = RoleDataManager.roleId, Notice = changed });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.LeagueData.Notice = changed;
+                    return true;
+                }
+            }
+            return false;
+        }
+        //获取加入退出日志
+        public static async ETTask<bool> ReqLeagueJoinQuitLog()
+        {
+            S2C_GetLeagueJoinQuitLog response = null;
+            response = (S2C_GetLeagueJoinQuitLog)await MessageHelper.SendToServer(new C2S_GetLeagueJoinQuitLog() { RoleId = RoleDataManager.roleId });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    LeagueDataManager.Instance.ListLogDatas.Clear();
+                    for (int i = 0; i < response.Logs.Count; i++)
+                    {
+                        LeagueLogData logData = GetLeagueLogData(response.Logs[i]);
+                        LeagueDataManager.Instance.ListLogDatas.Add(logData);
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        //建设联盟
+        //buildingType:由LeagueBuildingType定义
+        public static async ETTask<bool> ReqUpLeagueBuilding(int buildingType)
+        {
+            S2C_UpLeagueBuilding response = null;
+            response = (S2C_UpLeagueBuilding)await MessageHelper.SendToServer(new C2S_UpLeagueBuilding() { RoleId = RoleDataManager.roleId, BuildingType = buildingType });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+
+                    return true;
+                }
+            }
+            return false;
+        }
+        //联盟祈福
+        public static async ETTask<bool> ReqPrayLeague(int type)
+        {
+            S2C_PrayLeague response = null;
+            response = (S2C_PrayLeague)await MessageHelper.SendToServer(new C2S_PrayLeague() { Type = type });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+
+                    return true;
+                }
+            }
+            return false;
+        }
+
+
+        private static LeagueData GetLeagueData(LeagueDetailInfoProto leagueDetailInfo)
+        {
+            LeagueData leagueData = new LeagueData();
+            leagueData.LeagueId = leagueDetailInfo.LeagueId;
+            leagueData.Name = leagueDetailInfo.Name;
+            leagueData.Icon = leagueDetailInfo.Icon;
+            leagueData.Notice = leagueDetailInfo.Notice;
+            leagueData.Num = leagueDetailInfo.Num;
+            leagueData.LeagueMemberDatas.Clear();
+            for (int i = 0; i < leagueDetailInfo.LeagueMemberDetailInfo.Count; i++)
+            {
+                LeagueMemberData memberData = GetLeagueMemberData(leagueDetailInfo.LeagueMemberDetailInfo[i]);
+                leagueData.LeagueMemberDatas[memberData.RoleInfo.roleId] = memberData;
+            }
+            for (int i = 0; i < leagueDetailInfo.NumberKeys.Count; i++)
+            {
+                LeagueDataManager.Instance.UpdateNumeric(leagueDetailInfo.NumberKeys[i], leagueDetailInfo.Values[i]);
+            }
+            return leagueData;
+        }
+
+        public static LeagueMemberData GetLeagueMemberData(LeagueMemberDetailInfoProto memberDetailInfoProto)
+        {
+            LeagueMemberData memberData = new LeagueMemberData();
+            memberData.RoleInfo = GetOtherRoleInfoData(memberDetailInfoProto.RoleInfo);
+            memberData.Pos = memberDetailInfoProto.Pos;
+            memberData.WeekContribution = memberDetailInfoProto.WeekContribution;
+            memberData.AllContribution = memberDetailInfoProto.AllContribution;
+            memberData.JoinLeagueTime = memberDetailInfoProto.JoinLeagueTime;
+            return memberData;
+        }
+
+        private static LeagueListData GetLeagueListData(LeagueListInfoProto listInfoProto)
+        {
+            LeagueListData listData = new LeagueListData();
+
+            listData.LeagueId = listInfoProto.LeagueId;
+            listData.Name = listInfoProto.Name;
+            listData.Icon = listInfoProto.Icon;
+            listData.Num = listInfoProto.Num;
+            listData.NeedAudit = listInfoProto.NeedAudit;
+            listData.IsAd = listInfoProto.IsAd;
+            listData.ApplyStatus = listInfoProto.ApplyStatus;
+            return listData;
+        }
+        public static LeagueLogData GetLeagueLogData(LeagueJoinQuitLogProto logProto)
+        {
+            LeagueLogData logData = new LeagueLogData();
+            logData.RoleInfo = GetOtherRoleInfoData(logProto.RoleInfo);
+            logData.Time = logProto.Time;
+            logData.OldPos = logProto.OldPos;
+            logData.NewPos = logProto.NewPos;
+            return logData;
+        }
+        public static OtherRoleInfoData GetOtherRoleInfoData(OtherRoleInfoProto otherRoleInfo)
+        {
+            OtherRoleInfoData otherRoleInfoData = new OtherRoleInfoData();
+            otherRoleInfoData.headId = otherRoleInfo.HeadItemId;
+            otherRoleInfoData.headBorderId = otherRoleInfo.HeadBorderItemId;
+            otherRoleInfoData.roleName = otherRoleInfo.RoleName;
+            otherRoleInfoData.roleLv = otherRoleInfo.RoleLvl;
+            otherRoleInfoData.offlineTimeSec = otherRoleInfo.OfflineTimeSec;
+            return otherRoleInfoData;
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/HotUpdate/ServerProxy/LeagueSproxy.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a8530e8489fd3b34f92e8816060dc8b8
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: