From ed98029a88cd89702980ac7c40b711afddc5aeb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 20 十一月 2025 14:44:59 +0800
Subject: [PATCH] Merge branch 'master' of http://mobile.secondworld.net.cn:10010/r/Project_SG_scripts
---
Main/Core/GameEngine/Player/PlayerBaseData.cs | 199 ++++++++++++++++++++++---------------------------
1 files changed, 91 insertions(+), 108 deletions(-)
diff --git a/Main/Core/GameEngine/Player/PlayerBaseData.cs b/Main/Core/GameEngine/Player/PlayerBaseData.cs
index f76d5c8..56f00f0 100644
--- a/Main/Core/GameEngine/Player/PlayerBaseData.cs
+++ b/Main/Core/GameEngine/Player/PlayerBaseData.cs
@@ -1,9 +1,8 @@
锘縰sing System;
+using Cysharp.Threading.Tasks;
public class PlayerBaseData
{
- public ushort mainServerMapIdRecord = 0;
-
public string AccID; //_KEY_i_甯愬彿鍚�, 璇ヨ鑹叉墍鍦ㄧ殑甯愬彿鐨勭敤鎴峰悕
public uint PlayerID; //_IDT_
public string PlayerName; //size = 14
@@ -11,19 +10,41 @@
public byte Job; //鑱屼笟,
public ushort LV; //绛夌骇
public int TitleID;
- public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟
- public uint TotalExp; //鎬荤粡楠�
- public uint FamilyId; //瀹舵棌
+ public uint ExpPoint; //鎵╁厖缁忛獙鐐规暟锛堜嚎锛�
+ public uint TotalExp; //鎬荤粡楠�(灏忎簬浜块儴鍒�)
+ public long curExp { get { return TotalExp + ExpPoint * Constants.ExpPointValue; } }
+
+ uint m_FamilyId;
+ public uint FamilyId
+ {
+ get
+ {
+ return m_FamilyId;
+ }
+ set
+ {
+ var beforeFamilyId = m_FamilyId;
+ m_FamilyId = value;
+ if (beforeFamilyId == 0 && m_FamilyId != 0)
+ {
+ GuildManager.Instance.AfterEnterGuild().Forget();
+ }
+ else if (beforeFamilyId != 0 && m_FamilyId == 0)
+ {
+ GuildManager.Instance.AfterQuitGuild();
+ }
+ }
+ }
public string FamilyName; //瀹舵棌鍚嶇О
public uint diamond; //浠欑帀
public uint bindDiamond; //鐏电煶
public uint copper; //閾滈挶
- public ulong allCopper { get { return (ulong)copper + (ulong)copperExtend * Constants.ExpPointValue; } }
- public ulong FightPoint; //鎴樻枟鍊�
+ public long allCopper { get { return copper + copperExtend * Constants.ExpPointValue; } }
+ public long UseHarmerCount; //娑堣�楅敜瀛愪釜鏁�(鍊嶆暟)
public ushort MapID; //瑙掕壊鎵�鍦ㄥ湴鍥� 鍦板浘瑙勫垯锛欳/S涓�涓�瀵瑰簲鐨勫父瑙勫湴鍥撅紝C鍋囧湴鍥撅紙ExAttr14锛夛紝澶欳涓�涓猄鍦板浘锛圗xAttr3锛�
public ushort PosX; //瑙掕壊鍧愭爣
public ushort PosY;
- public ulong HP; //褰撳墠HP
+ public long HP; //褰撳墠HP
public uint FreePoint; //鏈垎閰嶇偣鏁�
public uint FreeSkillPoint; //鏈垎閰嶇殑鎶�鑳界偣
public int STR; //鍔涢噺
@@ -33,10 +54,10 @@
public string Setting; //璁惧畾
public byte AttackMode; //鏀诲嚮妯″紡
public byte FBID; //fb id
- public byte realmLevel; //鏃ф湇鍔$瀹橀樁锛岀幇椤圭洰鐢ㄤ簬澧冪晫
+ public byte realmLevel; //瀹樿亴
public byte VIPLv; //VIP绛夌骇
- public uint ExAttr1; // 鍗忓姪鐩爣鐜╁ID锛岄潪0鍙�0閫�鍑哄崗鍔�
- public uint teamAutoOperateFlag; //鎵╁睍灞炴��2锛屽悇椤圭洰涓撶敤
+ public int ExAttr1; // 绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏�
+ public int ExAttr2; // 鐢ㄤ簬璁板綍涓荤嚎褰撳墠鍒锋�墍鍦ㄧ珷鑺傚叧鍗¤褰曪紝璁板綍鍊� = 绔犺妭*10000+鍏冲崱缂栧彿*100+绗瑇娉� 锛� 0418鍒锋柊绫诲瀷103
public int dungeonLineId; // 鍓湰绾胯矾id
public int dungeonMapId; // 鍓湰鐢ㄤ綔 DataMapId,鍗曚汉鍓湰瀛樺湪1.鍋囧壇鏈� 2.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥惧悓鍒嗙嚎 3.鏈嶅姟绔�1瀵瑰鎴风澶氬湴鍥句笉鍚屽垎绾�
public uint shield; //鎶ょ浘鍊�
@@ -53,10 +74,13 @@
uint m_coinPointTotal;
public int face;//澶村儚
public int facePic;//澶村儚澶栨
+ public long FightPower; //鎴樻枟鍔�
- public uint coinPointTotal {
+ public uint coinPointTotal
+ {
private get { return m_coinPointTotal; }
- set {
+ set
+ {
CoinChangeEvent?.Invoke((int)m_coinPointTotal, (int)value);
m_coinPointTotal = value;
}
@@ -77,7 +101,7 @@
public int BasicsDefense;//鍩虹闃插尽
public int BasicsScoreAHit;//鍩虹鍛戒腑
public int BasicsDodge;//鍩虹闂伩
- public uint equipShowSwitch;//瑁呭鏄鹃殣寮�鍏�
+ public uint equipShowSwitch;//褰撳墠閰嶇疆鐨勫潗楠戝瑙侷D瀛樺偍鍦紙鏈�澶ф敮鎸� 1~999锛�
public int mater;//鐏垫牴灞炴�р�斺�旈噾
public int wood;//鐏垫牴灞炴�р�斺�旀湪
public int water;//鐏垫牴灞炴�р�斺�旀按
@@ -111,6 +135,7 @@
public int mapRealmSelect; //鍦板浘澧冪晫闅惧害
public int leaveFamilyTime; //绂诲紑瀹舵棌鏃堕棿
+ public int leaveGuildInfo; //鍏細锛氫富鍔ㄧ寮�娆℃暟*100 + 琚涪娆℃暟*10 + 鏈�鍚庝竴娆℃槸鍚︿富鍔ㄧ寮�鐨勶紝鏆傛椂鏈�澶氱疮璁¤褰曞埌9娆�
public bool IsActive90Off = true; //浠h〃榛樿婵�娲�0.1鎶�
public long treasurePotentialSp
@@ -138,102 +163,64 @@
}
}
- public void UpdateData(int temp/*H0102_tagCDBPlayer _serverInfo*/)
+ public void UpdateData(H0102_tagCDBPlayer _serverInfo)
{
-// if (_serverInfo.socketType == ServerType.Main)
-// {
-// AccID = _serverInfo.AccID;
-// PlayerID = _serverInfo.PlayerID;
-// PlayerName = _serverInfo.PlayerName.Trim().Replace("\0", "");
-// GMLevel = _serverInfo.GMLevel;
-// Job = _serverInfo.Job;
-// LV = _serverInfo.LV;
-// ExpPoint = _serverInfo.ExpPoint;
-// TotalExp = _serverInfo.TotalExp;
-// FamilyId = _serverInfo.Family;
-// FamilyName = _serverInfo.FamilyName.Trim().Replace("\0", "");
-// diamond = _serverInfo.Gold;
-// bindDiamond = _serverInfo.GoldPaper;
-// copper = _serverInfo.Silver;
-// MapID = _serverInfo.MapID;
-// mainServerMapIdRecord = MapID;
-// PosX = _serverInfo.PosX;
-// PosY = _serverInfo.PosY;
-// FreePoint = _serverInfo.FreePoint;
-// FreeSkillPoint = _serverInfo.FreeSkillPoint;
-// STR = _serverInfo.STR;
-// PNE = _serverInfo.PNE;
-// PHY = _serverInfo.PHY;
-// CON = _serverInfo.CON;
-// Setting = _serverInfo.Setting;
-// FBID = _serverInfo.FBID;
-// ExAttr1 = _serverInfo.ExAttr1;
-// teamAutoOperateFlag = _serverInfo.ExAttr2;
-// dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
-// dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
-// shield = _serverInfo.ExAttr4;
-// CrossServerFlag = _serverInfo.ExAttr5;
-// realmLevel = _serverInfo.OfficialRank;
-// VIPLv = _serverInfo.VIPLv;
-// copperExtend = _serverInfo.ExAttr6;
-// sp = _serverInfo.ExAttr7;
-// spExtend = _serverInfo.ExAttr8;
-// bubbleId = _serverInfo.ExAttr10;
-// ExAttr11 = _serverInfo.ExAttr11;
-// ExAttr16 = _serverInfo.ExAttr16;
-// ServerGroupId = _serverInfo.ExAttr13;
-// faction = _serverInfo.Faction;
-// coinPointTotal = _serverInfo.ChangeCoinPointTotal;
-// equipShowSwitch = _serverInfo.EquipShowSwitch;
-// mapRealmSelect = (int)_serverInfo.ExAttr18;
-// leaveFamilyTime = (int)_serverInfo.ExAttr19;
-// face = (int)_serverInfo.Face;
-// facePic = (int)_serverInfo.FacePic;
-// }
-// else
-// {
-// PlayerName = _serverInfo.PlayerName.Trim().Replace("\0", "");
-// MapID = _serverInfo.MapID;
-// dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
-// dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
-// FBID = _serverInfo.FBID;
-// PosX = _serverInfo.PosX;
-// PosY = _serverInfo.PosY;
-// }
-// if (CrossServerUtility.IsCrossServer())
-// {
-// if (_serverInfo.socketType == ServerType.CrossSever)
-// {
-// HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue;
-// AttackMode = _serverInfo.AttackMode;
-// }
-// }
-// else
-// {
-// HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue;
-// AttackMode = _serverInfo.AttackMode;
-// }
+ AccID = _serverInfo.AccID.Trim().Replace("\0", "");
+ PlayerID = _serverInfo.PlayerID;
+ PlayerName = _serverInfo.PlayerName.Trim().Replace("\0", "");
+ GMLevel = _serverInfo.GMLevel;
+ Job = _serverInfo.Job;
+ LV = _serverInfo.LV;
+ ExpPoint = _serverInfo.ExpPoint;
+ TotalExp = _serverInfo.TotalExp;
+ FamilyId = _serverInfo.Family;
+ FamilyName = _serverInfo.FamilyName.Trim().Replace("\0", "");
+ diamond = _serverInfo.Gold;
+ bindDiamond = _serverInfo.GoldPaper;
+ copper = _serverInfo.Silver;
+ MapID = _serverInfo.MapID;
+ PosX = _serverInfo.PosX;
+ PosY = _serverInfo.PosY;
+ FreePoint = _serverInfo.FreePoint;
+ FreeSkillPoint = _serverInfo.FreeSkillPoint;
+ STR = _serverInfo.STR;
+ PNE = _serverInfo.PNE;
+ PHY = _serverInfo.PHY;
+ CON = _serverInfo.CON;
+ Setting = _serverInfo.Setting;
+ FBID = _serverInfo.FBID;
+ ExAttr1 = Math.Max((int)_serverInfo.ExAttr1, 10100); //绛栧垝閰嶇疆鍏冲崱ID涓�201锛屽嵆 杩囧叧2-1(0/1) ,浣跨敤 ExAttr1 鍊煎垽鏂紝濡侲xAttr1鍊间负20103浠h〃褰撳墠宸茬粡杩囦簡绗�2绔犵1鍏崇3娉紝鍖呭惈浜嗘尝锛岄渶瑕佸嚮璐ヨ鍏冲崱boss鍚庢墠绠楄鍏宠繃鍏�
+ ExAttr2 = Math.Max((int)_serverInfo.ExAttr2, 10101); //鐢ㄤ簬璁板綍涓荤嚎褰撳墠鍒锋�墍鍦ㄧ珷鑺傚叧鍗¤褰曪紝璁板綍鍊� = 绔犺妭*10000+鍏冲崱缂栧彿*100+绗瑇娉� 锛� 0418鍒锋柊绫诲瀷103
+ dungeonLineId = (int)_serverInfo.ExAttr3 % 1000;
+ dungeonMapId = (int)_serverInfo.ExAttr3 / 1000;
+ shield = _serverInfo.ExAttr4;
+ CrossServerFlag = _serverInfo.ExAttr5;
+ realmLevel = _serverInfo.OfficialRank;
+ VIPLv = _serverInfo.VIPLv;
+ copperExtend = _serverInfo.ExAttr6;
+ sp = _serverInfo.ExAttr7;
+ spExtend = _serverInfo.ExAttr8;
+ bubbleId = _serverInfo.ExAttr10;
+ ExAttr11 = _serverInfo.ExAttr11;
+ leaveGuildInfo = (int)_serverInfo.ExAttr12;
+ ExAttr16 = _serverInfo.ExAttr16;
+ ServerGroupId = _serverInfo.ExAttr13;
+ faction = _serverInfo.Faction;
+ coinPointTotal = _serverInfo.ChangeCoinPointTotal;
+ equipShowSwitch = _serverInfo.EquipShowSwitch;
+ mapRealmSelect = (int)_serverInfo.ExAttr18;
+ leaveFamilyTime = (int)_serverInfo.ExAttr19;
+ face = (int)_serverInfo.Face;
+ facePic = (int)_serverInfo.FacePic;
-// if (PlayerDatas.Instance.hero != null)
-// {
-// PlayerDatas.Instance.hero.ActorInfo.familyID = FamilyId;
-// if (CrossServerUtility.IsCrossServer())
-// {
-// if (_serverInfo.socketType == ServerType.CrossSever)
-// {
-// PlayerDatas.Instance.hero.ActorInfo.ResetHp((long)HP);
-// }
-// }
-// else
-// {
-// PlayerDatas.Instance.hero.ActorInfo.ResetHp((long)HP);
-// }
-// }
+ HP = _serverInfo.HP + _serverInfo.HPEx * Constants.ExpPointValue;
+ AttackMode = _serverInfo.AttackMode;
+ UseHarmerCount = (int)_serverInfo.FightPoint; //閿ゅ瓙鍊嶆暟锛岄潪鎴樻枟鍔�
}
- // 姣斿璺ㄦ湇鏁版嵁鏇存柊鍚庯紝鐜╁鍥炲埌鏈湇浼氬悓姝ユ柊鏁版嵁锛岄渶鏇存柊
+ // 閮ㄥ垎鎯呭喌闇�瑕佹湇鍔$闈為噸鐧绘儏鍐典笅鍚屾鎵�鏈夋暟鎹�
public void UpdateData(/*HA112_tagMCDBPlayer serverInfo*/)
{
// AccID = serverInfo.AccID;
@@ -250,10 +237,6 @@
// bindDiamond = serverInfo.GoldPaper;
// copper = serverInfo.Silver;
// MapID = serverInfo.MapID;
- // if (serverInfo.socketType == ServerType.Main)
- // {
- // mainServerMapIdRecord = MapID;
- // }
// PosX = serverInfo.PosX;
// PosY = serverInfo.PosY;
// FreePoint = serverInfo.FreePoint;
--
Gitblit v1.8.0