From 96c625cf59fa4b68aa7e32285e3df88cc6930799 Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期一, 10 九月 2018 15:49:06 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
---
System/Team/TeamModel.cs | 105 ++++++++++++++++++++++++++--------------------------
1 files changed, 53 insertions(+), 52 deletions(-)
diff --git a/System/Team/TeamModel.cs b/System/Team/TeamModel.cs
index d2cf2ab..3422774 100644
--- a/System/Team/TeamModel.cs
+++ b/System/Team/TeamModel.cs
@@ -16,11 +16,9 @@
FriendsModel friendsModel { get { return ModelCenter.Instance.GetModel<FriendsModel>(); } }
DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
- public bool autoAcceptApplication
- {
+ public bool autoAcceptApplication {
get { return (PlayerDatas.Instance.baseData.ExAttr2 / 10) % 10 == 0; }
- set
- {
+ set {
var sendInfo = new CB904_tagCMChangeTeamCheckState();
sendInfo.JoinReqCheck = (byte)(value ? 0 : 1);
sendInfo.InviteCheck = (byte)(autoAcceptInvitation ? 0 : 1);
@@ -28,11 +26,9 @@
}
}
- public bool autoAcceptInvitation
- {
+ public bool autoAcceptInvitation {
get { return PlayerDatas.Instance.baseData.ExAttr2 % 10 == 0; }
- set
- {
+ set {
if ((PlayerDatas.Instance.baseData.ExAttr2 % 10 == 0) != value)
{
var sendInfo = new CB904_tagCMChangeTeamCheckState();
@@ -51,18 +47,15 @@
public Dictionary<int, TeamTargetPreference> targetPreferences = new Dictionary<int, TeamTargetPreference>();
MyTeam m_MyTeam = new MyTeam();
- public MyTeam myTeam
- {
+ public MyTeam myTeam {
get { return m_MyTeam; }
private set { m_MyTeam = value; }
}
TeamMission m_CurrentMission;
- public TeamMission currentMission
- {
+ public TeamMission currentMission {
get { return m_CurrentMission; }
- set
- {
+ set {
if (m_CurrentMission != value)
{
m_CurrentMission = value;
@@ -71,11 +64,9 @@
}
TeamMission m_MissionBuf = new TeamMission(CURRENTMAP_MISSION, 0);
- public TeamMission missionBuf
- {
+ public TeamMission missionBuf {
get { return m_MissionBuf; }
- set
- {
+ set {
m_MissionBuf = value;
if (missionLevelLimitChangeEvent != null)
{
@@ -85,32 +76,27 @@
}
int m_LevelMinBuf = 1;
- public int levelMinBuf
- {
+ public int levelMinBuf {
get { return m_LevelMinBuf; }
set { m_LevelMinBuf = value; }
}
int m_LevelMaxBuf = 1;
- public int levelMaxBuf
- {
+ public int levelMaxBuf {
get { return m_LevelMaxBuf; }
set { m_LevelMaxBuf = value; }
}
TeamInviteType m_CurrentInviteType = TeamInviteType.Friend;
- public TeamInviteType currentInviteType
- {
+ public TeamInviteType currentInviteType {
get { return m_CurrentInviteType; }
private set { m_CurrentInviteType = value; }
}
int m_CurrentSelectedInvitation = 0;
- public int currentSelectedInvitation
- {
+ public int currentSelectedInvitation {
get { return m_CurrentSelectedInvitation; }
- set
- {
+ set {
if (m_CurrentSelectedInvitation != value)
{
m_CurrentSelectedInvitation = value;
@@ -126,11 +112,9 @@
public DateTime matchingEndTime { get; private set; }
bool m_IsMatching = false;
- public bool isMatching
- {
+ public bool isMatching {
get { return m_IsMatching; }
- set
- {
+ set {
if (m_IsMatching != value)
{
m_IsMatching = value;
@@ -168,15 +152,13 @@
}
DateTime m_PrepareBeginTime;
- public DateTime prepareBeginTime
- {
+ public DateTime prepareBeginTime {
get { return m_PrepareBeginTime; }
private set { m_PrepareBeginTime = value; }
}
TeamPrepare m_TeamPreapare = new TeamPrepare();
- public TeamPrepare teamPrepare
- {
+ public TeamPrepare teamPrepare {
get { return m_TeamPreapare; }
private set { m_TeamPreapare = value; }
}
@@ -408,21 +390,8 @@
case 311101:
if (Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel).IsBigRealm == 1)
{
- var index = 0;
- foreach (var item in Config.Instance.GetAllValues<RealmConfig>())
- {
- if (item.IsBigRealm == 1)
- {
- index++;
- }
-
- if (item.Lv == PlayerDatas.Instance.baseData.realmLevel)
- {
- break;
- }
- }
-
- if (index <= 2)
+ var index = GetBigRealmIndex();
+ if (index == 1 || index == 2)
{
invite = true;
int.TryParse(json["311101"][index - 1].ToString(), out level);
@@ -450,7 +419,7 @@
}
}
- var content = Language.Get("WorldInvite", missionName, levelRequirement);
+ var content = Language.Get(dungeonId == 311101 ? "RealmTeamWorldInvite" : "WorldInvite", missionName, levelRequirement);
ChatCtrl.Inst.SendInvite(content);
SysNotifyMgr.Instance.ShowTip("SendWorldMessage");
}
@@ -948,6 +917,16 @@
if (!oldInTeam && myTeam.inTeam)
{
+ var dungeonId = dungeonModel.DungeonMap(myTeam.mission.mapId, myTeam.mission.mapEx);
+ if (dungeonId == 311101)
+ {
+ var bigRealmIndex = GetBigRealmIndex();
+ if (bigRealmIndex == 1 || bigRealmIndex == 2)
+ {
+ RequestWorldInvite();
+ }
+ }
+
if (createTeamEvent != null)
{
createTeamEvent();
@@ -1185,6 +1164,28 @@
}
}
+ private int GetBigRealmIndex()
+ {
+ var index = 0;
+ if (Config.Instance.Get<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel).IsBigRealm == 1)
+ {
+ foreach (var item in Config.Instance.GetAllValues<RealmConfig>())
+ {
+ if (item.IsBigRealm == 1)
+ {
+ index++;
+ }
+
+ if (item.Lv == PlayerDatas.Instance.baseData.realmLevel)
+ {
+ break;
+ }
+ }
+ }
+
+ return index;
+ }
+
public bool autoHandupRecord = false;
public int moveToNPCRecord = 0;
public void RecordHeroAI()
--
Gitblit v1.8.0