load else player

This commit is contained in:
Le Duc Anh
2025-11-25 18:52:32 +07:00
parent 50812676ce
commit 28bdab60d8
7 changed files with 25 additions and 21 deletions
@@ -56,9 +56,10 @@ namespace PerfectWorld.Scripts.Managers
OnMsgPlayerStopMove(Msg);
break;
}
case int value when value == EC_MsgDef.MSG_PM_FACTION_PVP_MASK_MODIFY:
case int value1 when value1 == EC_MsgDef.MSG_PM_PLAYERATKRESULT:
Debug.Log("EC_MsgDef.MSG_PM_FACTION_PVP_MASK_MODIFY");
case EC_MsgDef.MSG_PM_PLAYERBASEINFO:
case EC_MsgDef.MSG_PM_FACTION_PVP_MASK_MODIFY:
case EC_MsgDef.MSG_PM_PLAYERATKRESULT:
case EC_MsgDef.MSG_PM_CASTSKILL:
TransmitMessage(Msg);
break;
case int value when value == EC_MsgDef.MSG_PM_PLAYERDIED:
@@ -70,9 +71,6 @@ namespace PerfectWorld.Scripts.Managers
case int value when value == EC_MsgDef.MSG_PM_PLAYERRUNOUT:
OnMsgPlayerRunOut(Msg);
break;
case int value when value == EC_MsgDef.MSG_PM_CASTSKILL:
TransmitMessage(Msg);
break;
case EC_MsgDef.MSG_PM_PICKUPMATTER:
OnMsgPlayerPickupMatter(Msg);
break;
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: d0c06c588e2a6442488a3542551fb243
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -178,11 +178,11 @@ namespace CSNetwork
// #define MSG_PM_TEAMMEMBERDATA 363 // Team member data
public static int MSG_PM_LEAVETEAM = 364; // Player leave team
public static int MSG_PM_PLAYEREQUIPDATA = 365; // Player equipment data
public static int MSG_PM_CASTSKILL = 366; // Player cast skill
public const int MSG_PM_CASTSKILL = 366; // Player cast skill
public const int MSG_PM_PLAYERBASEINFO = 367; // Player custom data
public static int MSG_PM_PLAYERFLY = 368; // Player take off or land on
public static int MSG_PM_PLAYERSITDOWN = 369; // Player sit down / stand up
public static int MSG_PM_PLAYERATKRESULT = 370; // Player attack result
public const int MSG_PM_PLAYERATKRESULT = 370; // Player attack result
public static int MSG_PM_PLAYEREXTSTATE = 371; // Player extend states changed
public static int MSG_PM_PLAYERDOEMOTE = 372; // Player do emotion
public static int MSG_PM_PLAYERUSEITEM = 373; // Player use item
@@ -229,7 +229,7 @@ namespace CSNetwork
public static int MSG_PM_REINCARNATION = 414;
public static int MSG_PM_REALMLEVEL = 415;
public static int MSG_PM_PLAYER_IN_OUT_BATTLE = 416;
public static int MSG_PM_FACTION_PVP_MASK_MODIFY = 417;
public const int MSG_PM_FACTION_PVP_MASK_MODIFY = 417;
// Messages to NPC manager
public static int MSG_NM_NPCINFO = 400; // NPC information, p1 - protocol object address
@@ -1084,6 +1084,7 @@ namespace CSNetwork
private void OnPrtcPlayerBaseInfoRe(Protocol pProtocol)
{
playerbaseinfo_re p = (playerbaseinfo_re)pProtocol;
BMLogger.Log($"OnPrtcPlayerBaseInfoRe: {p.Roleid} {p.Player.cls} {p.Player.gender}");
EC_ManMessage.PostMessage(EC_MsgDef.MSG_PM_PLAYERBASEINFO, MANAGER_INDEX.MAN_PLAYER, -1, p);
}
@@ -320,6 +320,7 @@ namespace BrewMonster.Network
public static void GetRoleBaseInfo(int iNumRole, List<int> aRoleIDs)
{
BMLogger.Log($"GetRoleBaseInfo: {iNumRole} {string.Join(", ", aRoleIDs)}");
Instance._gameSession.GetRoleBaseInfo(iNumRole, aRoleIDs);
}
@@ -70,11 +70,6 @@ namespace PerfectWorld.Scripts.Player
m_aabbServer.Center = vPos + new A3DVECTOR3(0.0f, m_aabbServer.Extents.y, 0.0f);
m_aabbServer.CompleteMinsMaxs();
if (TryGetComponent<PlayerVisual>(out var visual))
{
visual.InitPlayerEventDoneHandler();
}
LoadAppearGfx();
}
public void MoveTo(cmd_object_move Cmd)
@@ -442,7 +437,13 @@ namespace PerfectWorld.Scripts.Player
EventBus.Publish(new NPCINFO(strName, 100,100, p.Roleid));
BMLogger.Log($"SetPlayerModel: {roleBase.cls} {roleBase.gender}");
await SetPlayerModel((byte)roleBase.cls, (byte)roleBase.gender);
if (TryGetComponent<PlayerVisual>(out var visual))
{
visual.InitPlayerEventDoneHandler();
}
}
void OnMsgPlayerAtkResult(ECMSG Msg)
@@ -14,11 +14,21 @@ namespace BrewMonster.PerfectWorld.Scripts.UI
private void Start()
{
hostplayer = GetComponentInParent<CECHostPlayer>();
if (hostplayer == null)
{
Debug.LogError("Host player not found");
return;
}
EventBus.SubscribeChannel<cmd_self_info_00>(hostplayer.m_PlayerInfo.cid,UpdateHostPlayerInfoUI);
}
private void OnDestroy()
{
if (hostplayer == null)
{
Debug.LogError("Host player not found");
return;
}
EventBus.UnsubscribeChannel<cmd_self_info_00>(hostplayer.m_PlayerInfo.cid,UpdateHostPlayerInfoUI);
}