Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // C0 01 跨服PK匹配成功 #tagGCCrossRealmPKMatchOK
|
| | |
|
| | | public class HC001_tagGCCrossRealmPKMatchOK : GameNetPackBasic
|
| | | {
|
| | | public ushort RoomID; // 房间ID
|
| | | public byte NameLen;
|
| | | public string PlayerName; // 跨服名字
|
| | | public byte Number; // 位置编号;1-左,2-右
|
| | | public byte MatchPlayerCount;
|
| | | public tagGCCrossRealmPKMatchPlayer[] MatchPlayer = null; // 匹配到的玩家
|
| | |
|
| | | public HC001_tagGCCrossRealmPKMatchOK()
|
| | | {
|
| | | _cmd = (ushort)0xC001;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes(byte[] vBytes)
|
| | | {
|
| | | TransBytes(out RoomID, vBytes, NetDataType.WORD);
|
| | | TransBytes(out NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out PlayerName, vBytes, NetDataType.Chars, NameLen);
|
| | | TransBytes(out Number, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out MatchPlayerCount, vBytes, NetDataType.BYTE);
|
| | | MatchPlayer = new tagGCCrossRealmPKMatchPlayer[MatchPlayerCount];
|
| | | for (int i = 0; i < MatchPlayerCount; i++)
|
| | | {
|
| | | MatchPlayer[i] = new tagGCCrossRealmPKMatchPlayer();
|
| | | TransBytes(out MatchPlayer[i].PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes(out MatchPlayer[i].NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out MatchPlayer[i].PlayerName, vBytes, NetDataType.Chars, MatchPlayer[i].NameLen);
|
| | | TransBytes(out MatchPlayer[i].Job, vBytes, NetDataType.BYTE);
|
| | | TransBytes(out MatchPlayer[i].LV, vBytes, NetDataType.WORD);
|
| | | TransBytes(out MatchPlayer[i].MaxHP, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagGCCrossRealmPKMatchPlayer
|
| | | {
|
| | | public uint PlayerID;
|
| | | public byte NameLen;
|
| | | public string PlayerName; // 跨服名字
|
| | | public byte Job;
|
| | | public ushort LV;
|
| | | public uint MaxHP; // 默认满血
|
| | | }
|
| | |
|
| | | } |
| | | // C0 01 跨服PK匹配成功 #tagGCCrossRealmPKMatchOK
|
| | |
|
| | | public class HC001_tagGCCrossRealmPKMatchOK : GameNetPackBasic {
|
| | | public ushort RoomID; // 房间ID
|
| | | public byte NameLen;
|
| | | public string PlayerName; // 跨服名字
|
| | | public byte Number; // 位置编号;1-左,2-右
|
| | | public byte MatchPlayerCount;
|
| | | public tagGCCrossRealmPKMatchPlayer[] MatchPlayer; // 匹配到的玩家
|
| | |
|
| | | public HC001_tagGCCrossRealmPKMatchOK () {
|
| | | _cmd = (ushort)0xC001;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out RoomID, vBytes, NetDataType.WORD);
|
| | | TransBytes (out NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out PlayerName, vBytes, NetDataType.Chars, NameLen);
|
| | | TransBytes (out Number, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MatchPlayerCount, vBytes, NetDataType.BYTE);
|
| | | MatchPlayer = new tagGCCrossRealmPKMatchPlayer[MatchPlayerCount];
|
| | | for (int i = 0; i < MatchPlayerCount; i ++) {
|
| | | MatchPlayer[i] = new tagGCCrossRealmPKMatchPlayer();
|
| | | TransBytes (out MatchPlayer[i].PlayerID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MatchPlayer[i].NameLen, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MatchPlayer[i].PlayerName, vBytes, NetDataType.Chars, MatchPlayer[i].NameLen);
|
| | | TransBytes (out MatchPlayer[i].Job, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out MatchPlayer[i].LV, vBytes, NetDataType.WORD);
|
| | | TransBytes (out MatchPlayer[i].MaxHP, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out MatchPlayer[i].MaxProDef, vBytes, NetDataType.DWORD);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagGCCrossRealmPKMatchPlayer {
|
| | | public uint PlayerID;
|
| | | public byte NameLen;
|
| | | public string PlayerName; // 跨服名字
|
| | | public byte Job;
|
| | | public ushort LV;
|
| | | public uint MaxHP; // 默认满血
|
| | | public uint MaxProDef; // 最大护盾
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | {
|
| | | // Debug.LogFormat("{0} 血量改变: {1}", ServerInstID, value);
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | if (_hero != null && _hero.SelectTarget == this)
|
| | | if (_hero != null && (_hero.SelectTarget == this || GameNetSystem.Instance.crossServerSocketConnected))
|
| | | {
|
| | | if (s_OnRefreshLife != null)
|
| | | {
|
| | |
| | |
|
| | | private void ShieldUpdate(int playerID, int shieldNow)
|
| | | {
|
| | | if (playerID == CrossServerLogin.Instance.oneVsOnePlayerData.opponentPlayerId)
|
| | | {
|
| | | if (positionType == 1)
|
| | | {
|
| | | m_RoleInformation2.SetShieldNumber(CrossServerLogin.Instance.oneVsOnePlayerData.MaxProDef, shieldNow);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_RoleInformation1.SetShieldNumber(CrossServerLogin.Instance.oneVsOnePlayerData.MaxProDef, shieldNow);
|
| | | }
|
| | | }
|
| | | DebugEx.LogError("输出玩家的ID" + playerID+"输出当前护盾值"+ shieldNow);
|
| | | }
|
| | | private void OnHeroHandupAIStopPassive()
|
| | |
| | | string OpponentName = UIHelper.ServerStringTrim(CrossServerLogin.Instance.oneVsOnePlayerData.opponentName);
|
| | | m_RoleInformation2.SetHeroLvAndName((int)CrossServerLogin.Instance.oneVsOnePlayerData.opponentLevel, OpponentName);
|
| | | m_RoleInformation2.SetHeroHP(CrossServerLogin.Instance.oneVsOnePlayerData.opponentMaxHp, CrossServerLogin.Instance.oneVsOnePlayerData.opponentMaxHp);
|
| | | m_RoleInformation2.SetShieldNumber(1, 1);
|
| | | m_RoleInformation2.SetShieldNumber(100, 100);
|
| | | }
|
| | | else//右
|
| | | {
|
| | |
| | | string OpponentName = UIHelper.ServerStringTrim(CrossServerLogin.Instance.oneVsOnePlayerData.opponentName);
|
| | | m_RoleInformation1.SetHeroLvAndName((int)CrossServerLogin.Instance.oneVsOnePlayerData.opponentLevel, OpponentName);
|
| | | m_RoleInformation1.SetHeroHP(CrossServerLogin.Instance.oneVsOnePlayerData.opponentMaxHp, CrossServerLogin.Instance.oneVsOnePlayerData.opponentMaxHp);
|
| | | m_RoleInformation1.SetShieldNumber(1, 1);
|
| | | m_RoleInformation1.SetShieldNumber(100, 100);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | m_JobTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | // m_RankWhatTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | m_SegmentTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | m_SegmentTxt.color = UIHelper.GetUIColor(TextColType.NavyBrown);
|
| | | m_RankButton.RemoveAllListeners();
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | var config = Config.Instance.Get<CrossServerArenaConfig>(Danlv);
|
| | | m_SegmentTxt.text = config.Name;
|
| | | if (Danlv >= 24)
|
| | | {
|
| | | m_SegmentTxt.color = new Color32(255, 3, 3, 255);
|
| | | }
|
| | | else if (Danlv < 24 && Danlv > 15)
|
| | | {
|
| | | m_SegmentTxt.color = new Color32(255, 103, 1, 255);
|
| | | }
|
| | | else if (Danlv < 15 && Danlv > 10)
|
| | | {
|
| | | m_SegmentTxt.color = new Color32(218, 72, 213, 255);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SegmentTxt.color = new Color32(104, 104, 104, 255);
|
| | | }
|
| | | m_SegmentTxt.color= UIHelper.GetDanLVColor(Danlv, false);
|
| | | //if (Danlv >= 24)
|
| | | //{
|
| | | // m_SegmentTxt.color = new Color32(255, 3, 3, 255);
|
| | | //}
|
| | | //else if (Danlv < 24 && Danlv > 15)
|
| | | //{
|
| | | // m_SegmentTxt.color = new Color32(255, 103, 1, 255);
|
| | | //}
|
| | | //else if (Danlv < 15 && Danlv > 10)
|
| | | //{
|
| | | // m_SegmentTxt.color = new Color32(218, 72, 213, 255);
|
| | | //}
|
| | | //else
|
| | | //{
|
| | | // m_SegmentTxt.color = new Color32(104, 104, 104, 255);
|
| | | //}
|
| | | }
|
| | |
|
| | | } |
| | |
| | | opponentMaxHp = (int)matchOK.MatchPlayer[0].MaxHP, |
| | | opponentLevel = (int)matchOK.MatchPlayer[0].LV, |
| | | opponentPlayerId = (int)matchOK.MatchPlayer[0].PlayerID, |
| | | MaxProDef = (int)matchOK.MatchPlayer[0].MaxProDef, |
| | | }; |
| | | |
| | | Clock.Create(DateTime.Now + new TimeSpan(5 * TimeSpan.TicksPerSecond), () => |
| | |
| | | public int opponentJob; |
| | | public int opponentLevel; |
| | | public int opponentMaxHp; |
| | | public int MaxProDef;// 最大护盾
|
| | | |
| | | |
| | | public CrossServerOneVsOne SetWaitForLoginCrossServer(bool waitForLoginCrossServer) |
| | | { |
| | |
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System.Linq;
|
| | | using LitJson;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | m_Notice.gameObject.SetActive(GameNotice.HasNotice());
|
| | |
|
| | | m_AlphaTween.SetStartState();
|
| | | m_SwitchAccount.gameObject.SetActive(VersionConfig.Get().versionAuthority == VersionAuthority.Release && !VersionConfig.Get().isBanShu);
|
| | |
|
| | | if (Config.Instance.ContainKey<FuncSwitchConfig>(2))
|
| | | {
|
| | | var switchAccountJson = JsonMapper.ToObject(Config.Instance.Get<FuncSwitchConfig>(2).AppIdSwitch);
|
| | | if (switchAccountJson.Keys.Contains(VersionConfig.Get().appId) && switchAccountJson[VersionConfig.Get().appId].ToString() == "0")
|
| | | {
|
| | | m_SwitchAccount.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SwitchAccount.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_SwitchAccount.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | if (m_UserHelp)
|
| | | {
|