Merge branch 'develop' into feature/ComboSkill

# Conflicts:
#	Assets/PerfectWorld/Scene/Bootstrap.unity
This commit is contained in:
VDH
2026-03-18 13:50:49 +07:00
261 changed files with 294727 additions and 420 deletions
+77 -41
View File
@@ -2,8 +2,9 @@
using BrewMonster.Scripts;
using CSNetwork;
using CSNetwork.GPDataType;
using System.Runtime.InteropServices;
using Cysharp.Threading.Tasks;
using System;
using System.Runtime.InteropServices;
using UnityEngine;
using static BrewMonster.Scripts.CECHPWork;
@@ -199,52 +200,77 @@ namespace BrewMonster
// 此方法实现了原始 C++ 代码中的 Goto 逻辑
private bool Goto(int idInst, Vector3 vPos, int iParallelWorldID)
{
Action actDone = () =>
{
// Stop all current work and goto specified position
// 停止所有当前工作并转到指定位置
if (m_pWorkMan != null)
{
// Stop auto-moving if active
// 如果正在自动移动则停止
// Note: IsAutoMoving check would go here if available
// 注意:如果可用,IsAutoMoving 检查将放在这里
if (IsAutoMoving())
{
CECHPWorkMove pWorkMove = (m_pWorkMan.GetRunningWork(CECHPWork.Host_work_ID.WORK_MOVETOPOS) as CECHPWorkMove);
pWorkMove.SetUseAutoMoveDialog(false);
pWorkMove.PressCancel();
pWorkMove.Finish();
}
// Finish all work
// 完成所有工作
m_pWorkMan.FinishAllWork(true);
}
if (!IsFlying())
ShowWing(false);
// Add a little height to ensure player's AABB won't embed with building
// 增加一点高度以确保玩家的 AABB 不会嵌入建筑物
vPos += EC_Utility.ToVector3(GPDataTypeHelper.g_vAxisY) * 0.1f;
// Ensure we are not under ground (terrain height check would go here)
// 确保我们不会在地下(地形高度检查将放在这里)
// Note: Terrain height check is skipped for now as it requires world access
// 注意:暂时跳过地形高度检查,因为它需要世界访问
A3DVECTOR3 vNormal = new A3DVECTOR3();
float vTerrainHeight = vPos.y;
if (Physics.RaycastNonAlloc(vPos, (Vector3.down), hits, 1000f, 1 << 6) > 0)
{
vTerrainHeight = hits[0].point.y;
vNormal = EC_Utility.ToA3DVECTOR3(hits[0].normal);
}
if (vPos.y < vTerrainHeight)
{
vPos.y = vTerrainHeight;
}
// Set position
// 设置位置
SetPos(vPos);
m_CDRInfo.vTPNormal = vPos.y <= vTerrainHeight + 0.1f ? vNormal : g_vOrigin;
m_CDRInfo.fYVel = 0.0f;
m_CDRInfo.vAbsVelocity.Clear();
// Reset jump state if available
// 如果可用则重置跳跃状态
ResetJump(); // Uncomment if ResetJump method exists
m_MoveCtrl.SetHostLastPos(EC_Utility.ToA3DVECTOR3(vPos));
m_MoveCtrl.SetLastSevPos(EC_Utility.ToA3DVECTOR3(vPos));
// Update camera if available
// 如果可用则更新相机
// UpdateFollowCamera(false, 10); // Uncomment if UpdateFollowCamera method exists
LitModelHolder.Instance.LoadAllObjectsNearTargetPosition(vPos).Forget();
};
// Jump to instance (change world/instance)
// 跳转到实例(更改世界/实例)
// Note: JumpToInstance is currently a stub in CECGameRun, so we skip the call for now
// 注意:JumpToInstance 目前在 CECGameRun 中是一个存根,所以我们现在跳过调用
// if (CECGameRun.Instance != null && !CECGameRun.Instance.JumpToInstance(idInst, vPos, iParallelWorldID))
// {
// Debug.LogError($"CECHostPlayer::Goto, Failed to jump to instance {idInst}");
// return false;
// }
// Stop all current work and goto specified position
// 停止所有当前工作并转到指定位置
if (m_pWorkMan != null)
if (CECGameRun.Instance != null && !CECGameRun.Instance.JumpToInstance(idInst, vPos, iParallelWorldID, actDone))
{
// Stop auto-moving if active
// 如果正在自动移动则停止
// Note: IsAutoMoving check would go here if available
// 注意:如果可用,IsAutoMoving 检查将放在这里
// Finish all work
// 完成所有工作
m_pWorkMan.FinishAllWork(true);
Debug.LogError($"CECHostPlayer::Goto, Failed to jump to instance {idInst}");
return false;
}
// Add a little height to ensure player's AABB won't embed with building
// 增加一点高度以确保玩家的 AABB 不会嵌入建筑物
vPos.y += 0.1f;
// Ensure we are not under ground (terrain height check would go here)
// 确保我们不会在地下(地形高度检查将放在这里)
// Note: Terrain height check is skipped for now as it requires world access
// 注意:暂时跳过地形高度检查,因为它需要世界访问
// Set position
// 设置位置
SetPos(vPos);
// Reset jump state if available
// 如果可用则重置跳跃状态
// ResetJump(); // Uncomment if ResetJump method exists
// Update camera if available
// 如果可用则更新相机
// UpdateFollowCamera(false, 10); // Uncomment if UpdateFollowCamera method exists
LitModelHolder.Instance.LoadAllObjectsNearTargetPosition(vPos).Forget();
return true;
}
@@ -263,5 +289,15 @@ namespace BrewMonster
{
return m_pWorkMan.IsMoving();
}
// Is auto moving ?
bool IsAutoMoving()
{
CECHPWork pWork = m_pWorkMan.GetRunningWork(CECHPWork.Host_work_ID.WORK_MOVETOPOS);
if (pWork != null)
return (pWork as CECHPWorkMove).GetAutoMove();
else
return false;
}
}
}
+2
View File
@@ -575,6 +575,7 @@ namespace BrewMonster
case EC_MsgDef.MSG_HST_SETPLAYERLIMIT: OnMsgHstSetPlayerLimit(Msg); break;
case EC_MsgDef.MSG_PM_PLAYERMOUNT: OnMsgPlayerMount(Msg); break;
case EC_MsgDef.MSG_HST_EMBEDITEM: OnMsgHstEmbedItem(Msg); break;
case EC_MsgDef.MSG_HST_CLEARTESSERA: OnMsgHstClearTessera(Msg); break;
case EC_MsgDef.MSG_HST_JOINTEAM: OnMsgHstJoinTeam(Msg); break;
case EC_MsgDef.MSG_HST_LEAVETEAM: OnMsgHstLeaveTeam(Msg); break;
case EC_MsgDef.MSG_HST_NEWTEAMMEM: OnMsgHstNewTeamMem(Msg); break;
@@ -584,6 +585,7 @@ namespace BrewMonster
case EC_MsgDef.MSG_PM_PLAYERCHGSHAPE :
OnMsgPlayerChgShape(Msg); break;
case EC_MsgDef.MSG_HST_SETMOVESTAMP: OnMsgHstSetMoveStamp(Msg); break;
case EC_MsgDef.MSG_HST_SANCTUARY: OnMsgHstSanctuary(Msg); break;
default:
// Uncomment to debug unhandled messages
+1 -1
View File
@@ -274,7 +274,7 @@ namespace BrewMonster
var nLocation = pArmor.equip_location;
// BMLogger.Log($"ShowEquipments():: Armor Essence: {pArmor.RealName}");
var armorSkinPath = _GenEquipmentSkinPath(UnityGameSession.Instance.GetRoleInfo().occupation, UnityGameSession.Instance.GetRoleInfo().gender, pArmor.RealName);
var armorSkinPath = _GenEquipmentSkinPath(m_iProfession, m_iGender, pArmor.RealName);
if (!armorSkinPath.EndsWith(".ecm"))
{
armorSkinPath += ".ecm";
+14 -14
View File
@@ -502,20 +502,20 @@ public class CECUIManager : MonoSingleton<CECUIManager>
AddChatMessage(GetStringFromTable(11168), GP_CHAT_MISC);*/
}
}
else if (pDlg is DlgInstall dlgInstall && dlgInstall.GetInstallMode == DlgInstall.InstallMode.Disenchase &&
DialogBoxCommandIDs.IDOK == iRetVal)
{
UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip(dlgInstall.FirstSlotIndex,
dlgInstall.SelectedEquip.GetTemplateID());
//else if (pDlg is DlgInstall dlgInstall && dlgInstall.GetInstallMode == DlgInstall.InstallMode.Disenchase &&
// DialogBoxCommandIDs.IDOK == iRetVal)
//{
// UnityGameSession.c2s_CmdNPCSevClearEmbeddedChip(dlgInstall.FirstSlotIndex,
// dlgInstall.SelectedEquip.GetTemplateID());
// UnityGameSession.c2s_CmdGetAllData(true, true, false);
// dlgInstall.Show(false);
// pHost.EndNPCService();
// // m_pCurNPCEssence = NULL;
// // m_pDlgInventory->Show(false);
// pHost.GetPack((int)InventoryType.IVTRTYPE_PACK).UnfreezeAllItems();
dlgInstall.Show(false);
pHost.EndNPCService();
// m_pCurNPCEssence = NULL;
// m_pDlgInventory->Show(false);
pHost.GetPack((int)InventoryType.IVTRTYPE_PACK).UnfreezeAllItems();
ShowMessageBoxGeneral("",pDlg.GetStringFromTable(228), null);
}
// ShowMessageBoxGeneral("", pDlg.GetStringFromTable(228), null);
//}
}
private bool OnNewMessageBox(int iRetVal)
@@ -795,4 +795,4 @@ public class CECUIManager : MonoSingleton<CECUIManager>
str = new string(chars);
}
}
}
+122 -58
View File
@@ -1,4 +1,5 @@
using BrewMonster;
using BrewMonster.Common;
using BrewMonster.Managers;
using BrewMonster.Network;
using BrewMonster.Scripts;
@@ -8,16 +9,17 @@ using BrewMonster.UI;
using CSNetwork;
using CSNetwork.GPDataType;
using CSNetwork.Protocols.RPCData;
using PerfectWorld.Scripts.Shop;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using PerfectWorld.Scripts.Shop;
using Unity.Cinemachine;
using Unity.VisualScripting;
using UnityEngine;
using BrewMonster.Common;
using UnityEngine.SceneManagement;
public partial class CECGameRun : ITickable
{
@@ -171,7 +173,7 @@ public partial class CECGameRun : ITickable
// memset(&m_WallowInfo, 0, sizeof(m_WallowInfo));
m_iGameState = (int)GameState.GS_GAME;
//
// if (!g_pGame->LoadInGameRes())
// if (!g_pGame.LoadInGameRes())
// {
// a_LogOutput(1, "CECGameRun::StartGame, Failed to call LoadInGameRes().");
// return false;
@@ -185,11 +187,11 @@ public partial class CECGameRun : ITickable
// }
//
// Create default game world
if (!JumpToInstance(idInst, vHostPos))
{
// a_LogOutput(1, "CECGameRun::StartGame, Failed to create game world.");
return false;
}
//if (!JumpToInstance(idInst, vHostPos))
//{
// // a_LogOutput(1, "CECGameRun::StartGame, Failed to create game world.");
// return false;
//}
//
// // ÉèÖÿç·þ³É¹¦±êʶ£¬ÒÔÀûÓÚ CECGameUIMan ¸ù¾Ý¿ç·þ״̬×öÏàÓ¦³õʼ»¯
// if (CECCrossServer::Instance().IsWaitLogin()){
@@ -214,7 +216,7 @@ public partial class CECGameRun : ITickable
// }
//
// // Reset faction manager
// g_pGame->GetFactionMan()->Release(false);
// g_pGame.GetFactionMan().Release(false);
//
// Create shortcuts
if (!CreateShortcuts())
@@ -224,23 +226,23 @@ public partial class CECGameRun : ITickable
}
//
// // Change UI manager
// if (!m_pUIManager->ChangeCurUIManager(CECUIManager::UIMAN_INGAME))
// if (!m_pUIManager.ChangeCurUIManager(CECUIManager::UIMAN_INGAME))
// {
// a_LogOutput(1, "CECGameRun::StartGame, Failed to change UI manager.");
// return false;
// }
// m_pInputFilter->LoadHotKey();
// m_pInputFilter.LoadHotKey();
//
// CECGameUIMan* pGameUIMan = m_pUIManager->GetInGameUIMan();
// CECGameUIMan* pGameUIMan = m_pUIManager.GetInGameUIMan();
// if (pGameUIMan)
// pGameUIMan->ChangeWorldInstance(idInst);
// pGameUIMan.ChangeWorldInstance(idInst);
//
// l_SaveCfgCnt.Reset();
//
// // Change cursor to default icon
// g_pGame->ChangeCursor(RES_CUR_NORMAL);
// g_pGame.ChangeCursor(RES_CUR_NORMAL);
// // Discard current frame
// g_pGame->DiscardFrame();
// g_pGame.DiscardFrame();
//
// // Clear frame controller
// memset(&l_fc, 0, sizeof (l_fc));
@@ -256,14 +258,76 @@ public partial class CECGameRun : ITickable
// m_SellingRoleID = 0;
//
// // ÏÂÔØÆ÷ÏìÓ¦½øÈëÓÎϷ״̬
// if( g_pGame->GetConfigs()->IsMiniClient() )
// if( g_pGame.GetConfigs().IsMiniClient() )
// CECMCDownload::GetInstance().SendSwitchGame(true);
//
return true;
}
private bool JumpToInstance(int idInst, Vector3 vHostPos, int iParallelWorldID = 0)
public bool JumpToInstance(int idInst, Vector3 vHostPos, int iParallelWorldID = 0, Action actDone = null)
{
CECInstance pInst = GetInstance(idInst);
string nameScene = UnityGameSession.Instance.GetWorldInstanceName(idInst);
if (pInst == null || string.IsNullOrEmpty(nameScene))
{
CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
if (pGameUI != null)
pGameUI.ShowErrorMsg(pGameUI.GetStringFromTable(10700), "");
//EC_Game.GetGameSession().SetBreakLinkFlag(CECGameSession::LBR_MAP_INVALID);
//a_LogOutput(1, "CECGameRun::JumpToInstance, wrong instance id: %d", idInst);
return false;
}
if(m_pWorld != null)
{
if (m_pWorld.GetInstanceID() == pInst.GetID() /*&& m_pWorld.IsValid()*/)
{
// TO DO: fix later
//int iLast = m_pWorld.GetCurParallelWorld();
//if (iLast == iParallelWorldID)
//{
// //m_pWorld.SetLoadCenter(vPos);
//}
//else
//{
// m_pWorld.OnParallelWorldChange(vPos, iParallelWorldID);
// CECUIHelper::UpdateParallelWorld();
// if (iLast != 0)
// {
// CECGameUIMan pGameUI = EC_Game.GetGameRun().GetUIManager().GetInGameUIMan();
// if (pGameUI != null)
// {
// ACString strMsg;
// strMsg.Format(pGameUI.GetStringFromTable(10703), pInst.GetName(), iParallelWorldID);
// CECUIHelper::AddHeartBeatHint(strMsg);
// }
// }
//}
return true;
}
else
{
// Release current world
ReleaseWorld();
}
}
SceneLoader.SceneLoadProcess = SceneLoadProcess.Loading;
SceneLoader.LoadingProgress = 0;
UnityGameSession.Instance.LoadScene(nameScene, LoadSceneMode.Single,
(progress) =>
{
LoadingSceneController.Instance.SetProgress(progress);
},
(value) =>
{
//isDoneWorldRender = value;
//isDoneNPCRender = true;
//isDoneWorldRender = true;
//actLoadChar?.Invoke();
//UnityGameSession.EnterWorldAsync(roleInfo, OnEnterWorldComplete);
m_pWorld.SetInstanceID(idInst);
actDone?.Invoke();
});
return true;
}
@@ -544,9 +608,9 @@ public partial class CECGameRun : ITickable
// CECGameRun.unique_data* data = GetUniqueData(0);
// if (data)
// {
// if(data->type ==1)
// if(data.type ==1)
// {
// return data->GetValueAsInt();
// return data.GetValueAsInt();
// }
// }
return -1;
@@ -873,22 +937,22 @@ public partial class CECGameRun : ITickable
public uint SaveConfigsToServer()
{
// if (!m_pWorld || !m_pWorld->GetHostPlayer() || !m_pWorld->GetHostPlayer()->HostIsReady() || !m_pUIManager->GetInGameUIMan())
// if (!m_pWorld || !m_pWorld.GetHostPlayer() || !m_pWorld.GetHostPlayer().HostIsReady() || !m_pUIManager.GetInGameUIMan())
// return 0;
CECHostPlayer pHost = GetHostPlayer();
CECGameUIMan pGameUI = m_pUIManager?.GetInGameUIMan() as CECGameUIMan;
if (m_pWorld == null || pHost == null || !pHost.HostIsReady() || pGameUI == null)
return 0;
// g_pGame->GetConfigs()->SaveBlockedID();
// g_pGame.GetConfigs().SaveBlockedID();
EC_Game.GetConfigs().SaveBlockedID(); // TODO: Check if this is needed here
// int iTotalSize = 0;
// iTotalSize += sizeof (DWORD);
// iTotalSize += sizeof (int);
// int iHostSize = 0;
// CECHostPlayer* pHost = m_pWorld->GetHostPlayer();
// pHost->SaveConfigData(NULL, &iHostSize);
// CECHostPlayer* pHost = m_pWorld.GetHostPlayer();
// pHost.SaveConfigData(NULL, &iHostSize);
// iTotalSize += iHostSize;
// iTotalSize += sizeof (int);
int iTotalSize = sizeof(uint);
@@ -898,8 +962,8 @@ public partial class CECGameRun : ITickable
iTotalSize += sizeof(int) + iHostSize;
// DWORD dwUISize = 0;
// CECGameUIMan* pGameUI = (CECGameUIMan*)m_pUIManager->GetInGameUIMan();
// pGameUI->GetUserLayout(NULL, dwUISize);
// CECGameUIMan* pGameUI = (CECGameUIMan*)m_pUIManager.GetInGameUIMan();
// pGameUI.GetUserLayout(NULL, dwUISize);
// iTotalSize += (int)dwUISize;
// iTotalSize += sizeof (int);
uint dwUISize = 0;
@@ -907,7 +971,7 @@ public partial class CECGameRun : ITickable
iTotalSize += sizeof(int) + (int)dwUISize;
// int iSettingSize = 0;
// g_pGame->GetConfigs()->SaveUserConfigData(NULL, &iSettingSize);
// g_pGame.GetConfigs().SaveUserConfigData(NULL, &iSettingSize);
// iTotalSize += iSettingSize;
int iSettingSize = 0;
EC_Game.GetConfigs().SaveUserConfigData(null, 0, out iSettingSize);
@@ -928,7 +992,7 @@ public partial class CECGameRun : ITickable
// *((int*)pData) = iHostSize;
// pData += sizeof (int);
// pHost->SaveConfigData(pData, &iHostSize);
// pHost.SaveConfigData(pData, &iHostSize);
// pData += iHostSize;
Buffer.BlockCopy(BitConverter.GetBytes(iHostSize), 0, pDataBuf, offset, sizeof(int));
offset += sizeof(int);
@@ -938,7 +1002,7 @@ public partial class CECGameRun : ITickable
// *((int*)pData) = (int)dwUISize;
// pData += sizeof (int);
// pGameUI->GetUserLayout(pData, dwUISize);
// pGameUI.GetUserLayout(pData, dwUISize);
// pData += dwUISize;
Buffer.BlockCopy(BitConverter.GetBytes((int)dwUISize), 0, pDataBuf, offset, sizeof(int));
offset += sizeof(int);
@@ -948,7 +1012,7 @@ public partial class CECGameRun : ITickable
// *((int*)pData) = iSettingSize;
// pData += sizeof (int);
// g_pGame->GetConfigs()->SaveUserConfigData(pData, &iSettingSize);
// g_pGame.GetConfigs().SaveUserConfigData(pData, &iSettingSize);
// pData += iSettingSize;
Buffer.BlockCopy(BitConverter.GetBytes(iSettingSize), 0, pDataBuf, offset, sizeof(int));
offset += sizeof(int);
@@ -993,7 +1057,7 @@ public partial class CECGameRun : ITickable
Buffer.BlockCopy(pDataBuf, 0, pCompBuf, 0, iVerLen);
int iRes = AFilePackage.Compress(pDataBuf, iVerLen,iTotalSize - iVerLen, pCompBuf, iVerLen, ref compLen);
// if (0 == iRes) { g_pGame->GetGameSession()->SaveConfigData(pCompBuf, dwCompLen+iVerLen); iRes = 2; }
// if (0 == iRes) { g_pGame.GetGameSession().SaveConfigData(pCompBuf, dwCompLen+iVerLen); iRes = 2; }
// else { a_LogOutput(1, "CECGameRun::SaveConfigsToServer, Failed to compress config data (%d:%d)", iRes, iTotalSize); iRes = 0; }
// a_freetemp(pDataBuf);
// a_freetemp(pCompBuf);
@@ -1023,27 +1087,27 @@ public partial class CECGameRun : ITickable
public bool Tick(uint dwDeltaTime)
{
// if (GetWallowInfo().anti_wallow_active &&
// g_pGame->GetGameSession()->IsConnected() &&
// g_pGame.GetGameSession().IsConnected() &&
// GetGameState() == GS_GAME)
// {
// if (CECUIConfig::Instance().GetGameUI().nWallowHintType != CECUIConfig::GameUI::WHT_KOREA)
// {
// // ·À³ÁÃÔµ½3Сʱ£¬ÈôAU²»ÌßÈË£¨ÏûÏ¢¶ªÊ§£©£¬Ôò×Ô¶¯ÏÂÏß
// int stime = g_pGame->GetServerGMTTime();
// int stime = g_pGame.GetServerGMTTime();
// int nTime = stime - GetWallowInfo().play_time;
// if (nTime >= 3 * 3600)
// {
// // ÒѾ­³¬¹ý3Сʱ
// g_pGame->GetGameSession()->SetBreakLinkFlag(CECGameSession::LBR_ANTI_WALLOW);
// g_pGame.GetGameSession().SetBreakLinkFlag(CECGameSession::LBR_ANTI_WALLOW);
// }
// }
// }
//
// DWORD dwTickTime = a_GetTime();
//
// CECGameSession* pSession = g_pGame->GetGameSession();
// pSession->ProcessNewProtocols();
// DWORD dwRealTime = g_pGame->GetRealTickTime();
// CECGameSession* pSession = g_pGame.GetGameSession();
// pSession.ProcessNewProtocols();
// DWORD dwRealTime = g_pGame.GetRealTickTime();
if (m_iLogoutFlag >= 0)
{
@@ -1054,16 +1118,16 @@ public partial class CECGameRun : ITickable
// CECReconnect::Instance().Tick();
//
// if (m_pUIManager)
// m_bUIHasCursor = m_pUIManager->UIControlCursor();
// m_bUIHasCursor = m_pUIManager.UIControlCursor();
// else
// m_bUIHasCursor = false;
//
// // Deal input first
// if (m_pInputCtrl)
// m_pInputCtrl->Tick();
// m_pInputCtrl.Tick();
//
// // Tick world
// if (!TickGameWorld(dwDeltaTime, g_pGame->GetViewport()))
// if (!TickGameWorld(dwDeltaTime, g_pGame.GetViewport()))
// return false;
// Tick UI
@@ -1071,10 +1135,10 @@ public partial class CECGameRun : ITickable
// m_pUIManager.Tick();
// // Tick GFX caster
// g_pGame->GetGFXCaster()->Tick(dwDeltaTime);
// g_pGame.GetGFXCaster().Tick(dwDeltaTime);
//
// // Tick GFX Manager
// g_pGame->GetA3DGFXExMan()->Tick(dwDeltaTime);
// g_pGame.GetA3DGFXExMan().Tick(dwDeltaTime);
//
// // A3DEngine::TickAnimation trigger animation of many objects.
// // For example: A3DSky objects, GFX objects etc.
@@ -1083,7 +1147,7 @@ public partial class CECGameRun : ITickable
// while (dwAnimTime >= TIME_TICKANIMATION)
// {
// dwAnimTime -= TIME_TICKANIMATION;
// g_pGame->GetA3DEngine()->TickAnimation();
// g_pGame.GetA3DEngine().TickAnimation();
// }
//
// // Update ear position so that all 3D sounds' positions are correct
@@ -1094,30 +1158,30 @@ public partial class CECGameRun : ITickable
//
// CECHostPlayer* pHostPlayer = NULL;
// if (m_pWorld)
// pHostPlayer = m_pWorld->GetHostPlayer();
// pHostPlayer = m_pWorld.GetHostPlayer();
//
// A3DCamera * pCamera = g_pGame->GetViewport()->GetA3DCamera();
// A3DCamera * pCamera = g_pGame.GetViewport().GetA3DCamera();
//
// if (GetGameState() == CECGameRun::GS_GAME && pHostPlayer && pHostPlayer->HostIsReady())
// if (GetGameState() == CECGameRun::GS_GAME && pHostPlayer && pHostPlayer.HostIsReady())
// {
// AM3DSoundDevice * pAM3DSoundDevice = g_pGame->GetA3DEngine()->GetAMSoundEngine()->GetAM3DSoundDevice();
// A3DVECTOR3 vecDir = pCamera->GetDirH();
// AM3DSoundDevice * pAM3DSoundDevice = g_pGame.GetA3DEngine().GetAMSoundEngine().GetAM3DSoundDevice();
// A3DVECTOR3 vecDir = pCamera.GetDirH();
// A3DVECTOR3 vecUp = A3DVECTOR3(0.0f, 1.0f, 0.0f);
//
// // Now we should adjust the 3d sound device's pos and orientation;
// if (pAM3DSoundDevice)
// {
// pAM3DSoundDevice->SetPosition(pHostPlayer->GetPos() + A3DVECTOR3(0.0f, 0.8f, 0.0f));
// pAM3DSoundDevice->SetOrientation(vecDir, vecUp);
// pAM3DSoundDevice->UpdateChanges();
// pAM3DSoundDevice.SetPosition(pHostPlayer.GetPos() + A3DVECTOR3(0.0f, 0.8f, 0.0f));
// pAM3DSoundDevice.SetOrientation(vecDir, vecUp);
// pAM3DSoundDevice.UpdateChanges();
// }
// }
// else
// g_pGame->GetViewport()->GetA3DCamera()->UpdateEar();
// g_pGame.GetViewport().GetA3DCamera().UpdateEar();
// }
//
// // Tick Run-Time debug information
// g_pGame->GetRTDebug()->Tick(dwDeltaTime);
// g_pGame.GetRTDebug().Tick(dwDeltaTime);
//
// // Save UI configs when time reached
// if (m_iGameState == GS_GAME && l_SaveCfgCnt.IncCounter(dwRealTime))
@@ -1128,7 +1192,7 @@ public partial class CECGameRun : ITickable
//
// l_StatCnt.IncCounter(dwDeltaTime);
//
// pSession->ClearOldProtocols();
// pSession.ClearOldProtocols();
//
// DWORD dwCurrentTick = a_GetTime();
// dwTickTime = (dwCurrentTick > dwTickTime) ? (dwCurrentTick - dwTickTime) : 0;
@@ -1141,7 +1205,7 @@ public partial class CECGameRun : ITickable
// l_fc.iTickTime += (int)dwTickTime;
// }
//
// if (GetGameState() == GS_GAME && GetHostPlayer() && GetHostPlayer()->HostIsReady())
// if (GetGameState() == GS_GAME && GetHostPlayer() && GetHostPlayer().HostIsReady())
// {
// if (l_bFirstQuery || l_DelayQueryCounter.IncCounter(dwDeltaTime))
// {
@@ -1149,14 +1213,14 @@ public partial class CECGameRun : ITickable
//
// // ·¢ËÍÍøÂçÓµ¼·²éѯЭÒé
// l_iDelayTimeStamp = timeGetTime();
// g_pGame->GetGameSession()->c2s_CmdQueryNetworkDelay(l_iDelayTimeStamp);
// g_pGame.GetGameSession().c2s_CmdQueryNetworkDelay(l_iDelayTimeStamp);
// l_DelayQueryCounter.Reset();
// l_bFirstQuery = false;
// }
//
// if (l_QueryServerTime.IncCounter(dwDeltaTime))
// {
// g_pGame->GetGameSession()->c2s_CmdSendGetServerTime();
// g_pGame.GetGameSession().c2s_CmdSendGetServerTime();
// l_QueryServerTime.Reset();
// }
// }
@@ -1164,7 +1228,7 @@ public partial class CECGameRun : ITickable
// m_pendingLogout.Update(dwDeltaTime);
//
// // ÓÅ»¯ÄÚ´æµÄÕ¼ÓÃ
// m_pMemSimplify->Tick(dwDeltaTime);
// m_pMemSimplify.Tick(dwDeltaTime);
//
// // ¸üÐÂÏÂÔØ×´Ì¬
// CECMCDownload::GetInstance().Tick(dwDeltaTime);
@@ -1173,7 +1237,7 @@ public partial class CECGameRun : ITickable
// CECAutoPolicy::GetInstance().Tick(dwDeltaTime);
//
// if(m_pRandomMapProc)
// m_pRandomMapProc->Tick(dwDeltaTime);
// m_pRandomMapProc.Tick(dwDeltaTime);
//
// #ifdef _PROFILE_MEMORY
// g_TickMemoryHistory();