diff --git a/resource/excel/Group.xlsx b/resource/excel/Group.xlsx index 9f97bf0b..59dab188 100644 Binary files a/resource/excel/Group.xlsx and b/resource/excel/Group.xlsx differ diff --git a/resource/excel/Object.xlsx b/resource/excel/Object.xlsx new file mode 100644 index 00000000..f83bb0da Binary files /dev/null and b/resource/excel/Object.xlsx differ diff --git a/resource/excel/Player.xlsx b/resource/excel/Player.xlsx index 3ffe3c4f..4f1ff835 100644 Binary files a/resource/excel/Player.xlsx and b/resource/excel/Player.xlsx differ diff --git a/resource/excel/Scene.xlsx b/resource/excel/Scene.xlsx index abbb6b4d..d8c0de6b 100644 Binary files a/resource/excel/Scene.xlsx and b/resource/excel/Scene.xlsx differ diff --git a/resource/excel/common/IObject.xlsx b/resource/excel/common/IObject.xlsx index f85b6ae7..d95586bd 100644 Binary files a/resource/excel/common/IObject.xlsx and b/resource/excel/common/IObject.xlsx differ diff --git a/resource/excel/example/Property.xlsx b/resource/excel/example/Property.xlsx index 14689407..fa41e721 100644 Binary files a/resource/excel/example/Property.xlsx and b/resource/excel/example/Property.xlsx differ diff --git a/resource/excel/example/Record.xlsx b/resource/excel/example/Record.xlsx index 96413e9b..637423b2 100644 Binary files a/resource/excel/example/Record.xlsx and b/resource/excel/example/Record.xlsx differ diff --git a/src/squick/plugin/world/cell_module.cc b/src/squick/plugin/world/cell_module.cc index 5a84df6a..c7ec4f5e 100644 --- a/src/squick/plugin/world/cell_module.cc +++ b/src/squick/plugin/world/cell_module.cc @@ -17,7 +17,7 @@ bool CellModule::Start() { } bool CellModule::AfterStart() { - m_world_->AddClassCallBack(excel::Player::ThisName(), this, &CellModule::OnObjectEvent); + m_world_->AddClassCallBack(excel::Object::ThisName(), this, &CellModule::OnObjectEvent); // NF SYNC /*X @@ -376,15 +376,14 @@ int CellModule::AddMoveOutEventCallBack(CELL_MOVE_EVENT_FUNCTOR_PTR functorPtr) int CellModule::OnObjectEvent(const Guid &self, const std::string &classNames, const CLASS_OBJECT_EVENT classEvent, const DataList &var) { if (CLASS_OBJECT_EVENT::COE_CREATE_FINISH == classEvent) { - m_world_->AddPropertyCallBack(self, excel::IObject::Position(), this, &CellModule::OnPositionEvent); + m_world_->AddPropertyCallBack(self, excel::Object::Position(), this, &CellModule::OnPositionEvent); } - return 0; } int CellModule::OnPositionEvent(const Guid &self, const std::string &propertyName, const SquickData &oldVar, const SquickData &newVar, const INT64 reason) { - const int sceneID = m_world_->GetPropertyInt32(self, excel::IObject::SceneID()); - const int groupID = m_world_->GetPropertyInt32(self, excel::IObject::GroupID()); + const int sceneID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const int groupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); const Vector3 &oldVec = oldVar.GetVector3(); const Vector3 &newVec = newVar.GetVector3(); diff --git a/src/squick/plugin/world/data_tail_module.cc b/src/squick/plugin/world/data_tail_module.cc index daedd95b..4ff42264 100644 --- a/src/squick/plugin/world/data_tail_module.cc +++ b/src/squick/plugin/world/data_tail_module.cc @@ -21,7 +21,7 @@ bool DataTailModule::Update() { return true; } bool DataTailModule::AfterStart() { #ifdef SQUICK_DEBUG_MODE - m_world_->AddClassCallBack(excel::Player::ThisName(), this, &DataTailModule::OnClassObjectEvent); + m_world_->AddClassCallBack(excel::Object::ThisName(), this, &DataTailModule::OnClassObjectEvent); #endif return true; } diff --git a/src/squick/plugin/world/scene_module.cc b/src/squick/plugin/world/scene_module.cc index f38449a7..3e3a214f 100644 --- a/src/squick/plugin/world/scene_module.cc +++ b/src/squick/plugin/world/scene_module.cc @@ -119,8 +119,8 @@ bool SceneModule::RequestEnterScene(const Guid &self, const int sceneID, const i return false; } - const int nNowSceneID = m_world_->GetPropertyInt32(self, excel::Player::SceneID()); - const int nNowGroupID = m_world_->GetPropertyInt32(self, excel::Player::GroupID()); + const int nNowSceneID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const int nNowGroupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); if (nNowSceneID == sceneID && nNowGroupID == groupID) { LOG_INFO("Guid<%v> in same scene and group but it not a clone scene<%v>, group_id<%v> ", self.ToString(), sceneID, groupID); @@ -196,7 +196,7 @@ bool SceneModule::LeaveSceneGroup(const Guid &self) { } ///////// - const Vector3 &lastPos = m_world_->GetPropertyVector3(self, excel::IObject::Position()); + const Vector3 &lastPos = m_world_->GetPropertyVector3(self, excel::Object::Position()); BeforeLeaveSceneGroup(self, nOldSceneID, nOldGroupID, 0, DataList::Empty()); const Guid lastCell = m_pCellModule->ComputeCellID(lastPos); @@ -394,7 +394,7 @@ bool SceneModule::CreateSceneNPC(const int sceneID, const int groupID, const Dat int nWeight = m_world_->Random(0, 100); if (nWeight <= pResource->nWeight) { DataList arg; - arg << excel::IObject::Position() << pResource->vSeedPos; + arg << excel::Object::Position() << pResource->vSeedPos; // arg << SquickProtocol::NPC::SeedID() << pResource->seedID; arg.Append(argList); @@ -916,7 +916,7 @@ bool SceneModule::SwitchScene(const Guid &self, const int nTargetSceneID, const } ///////// - const Vector3 &lastPos = m_world_->GetPropertyVector3(self, excel::IObject::Position()); + const Vector3 &lastPos = m_world_->GetPropertyVector3(self, excel::Object::Position()); BeforeLeaveSceneGroup(self, nOldSceneID, nOldGroupID, type, arg); const Guid lastCell = m_pCellModule->ComputeCellID(lastPos); @@ -944,7 +944,7 @@ bool SceneModule::SwitchScene(const Guid &self, const int nTargetSceneID, const const Guid newCell = m_pCellModule->ComputeCellID(v); OnMoveCellEvent(self, nTargetGroupID, nTargetGroupID, Guid(), newCell); - pObject->SetPropertyVector3(excel::IObject::MoveTo(), v); + pObject->SetPropertyVector3(excel::Object::MoveTo(), v); ///////// AfterEnterSceneGroup(self, nTargetSceneID, nTargetGroupID, type, arg); @@ -1004,15 +1004,15 @@ int SceneModule::OnSceneRecordCommonEvent(const Guid &self, const RECORD_EVENT_D int SceneModule::OnPropertyCommonEvent(const Guid &self, const std::string &propertyName, const SquickData &oldVar, const SquickData &newVar, const INT64 reason) { - const std::string &className = m_world_->GetPropertyString(self, excel::IObject::ClassName()); - if (className == excel::Player::ThisName()) { + const std::string &className = m_world_->GetPropertyString(self, excel::Object::ClassName()); + if (className == excel::Object::ThisName()) { // only player can change grupid and sceneid - if (excel::Player::GroupID() == propertyName) { + if (excel::Object::GroupID() == propertyName) { OnPlayerGroupEvent(self, propertyName, oldVar, newVar); return 0; } - if (excel::Player::SceneID() == propertyName) { + if (excel::Object::SceneID() == propertyName) { OnPlayerSceneEvent(self, propertyName, oldVar, newVar); return 0; } @@ -1031,7 +1031,7 @@ int SceneModule::OnPropertyCommonEvent(const Guid &self, const std::string &prop int SceneModule::OnRecordCommonEvent(const Guid &self, const RECORD_EVENT_DATA &eventData, const SquickData &oldVar, const SquickData &newVar) { const std::string &recordName = eventData.recordName; - int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::Player::GroupID()); + int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); if (nObjectGroupID < 0) { return 0; @@ -1047,14 +1047,14 @@ int SceneModule::OnRecordCommonEvent(const Guid &self, const RECORD_EVENT_DATA & int SceneModule::OnClassCommonEvent(const Guid &self, const std::string &className, const CLASS_OBJECT_EVENT classEvent, const DataList &var) { if (CLASS_OBJECT_EVENT::COE_DESTROY == classEvent) { - const int nObjectSceneID = m_world_->GetPropertyInt32(self, excel::IObject::SceneID()); - const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::IObject::GroupID()); + const int nObjectSceneID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); if (nObjectGroupID < 0 || nObjectSceneID <= 0) { return 0; } - const Vector3 &pos = m_world_->GetPropertyVector3(self, excel::Player::Position()); + const Vector3 &pos = m_world_->GetPropertyVector3(self, excel::Object::Position()); DataList valueAllPlayrNoSelfList; m_pCellModule->GetCellObjectList(nObjectSceneID, nObjectGroupID, pos, valueAllPlayrNoSelfList, true, self); @@ -1070,7 +1070,7 @@ int SceneModule::OnClassCommonEvent(const Guid &self, const std::string &classNa DataList selfVar; selfVar << self; - if (className == excel::Player::ThisName()) { + if (className == excel::Object::ThisName()) { // tell youself, u want to enter this scene or this group OnObjectListEnter(selfVar, selfVar); @@ -1080,13 +1080,13 @@ int SceneModule::OnClassCommonEvent(const Guid &self, const std::string &classNa OnObjectListEnterFinished(selfVar, selfVar); } else { - const int nObjectSceneID = m_world_->GetPropertyInt32(self, excel::IObject::SceneID()); - const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::IObject::GroupID()); + const int nObjectSceneID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); if (nObjectGroupID < 0 || nObjectSceneID <= 0) { return 0; } - const Vector3 &pos = m_world_->GetPropertyVector3(self, excel::Player::Position()); + const Vector3 &pos = m_world_->GetPropertyVector3(self, excel::Object::Position()); DataList valueAllPlayrObjectList; m_pCellModule->GetCellObjectList(nObjectSceneID, nObjectGroupID, pos, valueAllPlayrObjectList, true); @@ -1105,8 +1105,8 @@ int SceneModule::OnClassCommonEvent(const Guid &self, const std::string &classNa int SceneModule::OnPlayerGroupEvent(const Guid &self, const std::string &propertyName, const SquickData &oldVar, const SquickData &newVar) { // this event only happened in the same scene - const int sceneID = m_world_->GetPropertyInt32(self, excel::IObject::SceneID()); - const Vector3 position = m_world_->GetPropertyVector3(self, excel::IObject::Position()); + const int sceneID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const Vector3 position = m_world_->GetPropertyVector3(self, excel::Object::Position()); int nOldGroupID = oldVar.GetInt32(); int nNewGroupID = newVar.GetInt32(); @@ -1206,11 +1206,11 @@ int SceneModule::OnPlayerSceneEvent(const Guid &self, const std::string &propert } int SceneModule::GetBroadCastObject(const Guid &self, const std::string &propertyName, const bool bTable, DataList &valueObject) { - const int nObjectContainerID = m_world_->GetPropertyInt32(self, excel::IObject::SceneID()); - const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::IObject::GroupID()); - const Vector3 &position = m_world_->GetPropertyVector3(self, excel::IObject::Position()); + const int nObjectContainerID = m_world_->GetPropertyInt32(self, excel::Object::SceneID()); + const int nObjectGroupID = m_world_->GetPropertyInt32(self, excel::Object::GroupID()); + const Vector3 &position = m_world_->GetPropertyVector3(self, excel::Object::Position()); - const std::string &className = m_world_->GetPropertyString(self, excel::IObject::ClassName()); + const std::string &className = m_world_->GetPropertyString(self, excel::Object::ClassName()); std::shared_ptr pClassRecordManager = m_class_->GetClassRecordManager(className); std::shared_ptr pClassPropertyManager = m_class_->GetClassPropertyManager(className); diff --git a/src/squick/plugin/world/world_module.cc b/src/squick/plugin/world/world_module.cc index e605254f..a972deed 100644 --- a/src/squick/plugin/world/world_module.cc +++ b/src/squick/plugin/world/world_module.cc @@ -148,13 +148,13 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s { Vector3 vRelivePos = m_scene_->GetRelivePosition(sceneID, 0); - pObject->SetPropertyString(excel::IObject::ConfigID(), configIndex); - pObject->SetPropertyString(excel::IObject::ClassName(), className); - pObject->SetPropertyInt(excel::IObject::SceneID(), sceneID); - pObject->SetPropertyInt(excel::IObject::GroupID(), groupID); - pObject->SetPropertyVector3(excel::IObject::Position(), vRelivePos); + pObject->SetPropertyString(excel::Object::ConfigID(), configIndex); + pObject->SetPropertyString(excel::Object::ClassName(), className); + pObject->SetPropertyInt(excel::Object::SceneID(), sceneID); + pObject->SetPropertyInt(excel::Object::GroupID(), groupID); + pObject->SetPropertyVector3(excel::Object::Position(), vRelivePos); - pContainerInfo->AddObjectToGroup(groupID, ident, className == excel::Player::ThisName() ? true : false); + pContainerInfo->AddObjectToGroup(groupID, ident, className == excel::Object::ThisName() ? true : false); DoEvent(ident, className, pObject->GetState(), arg); } @@ -186,9 +186,9 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s std::shared_ptr pPropertyManager = pObject->GetPropertyManager(); for (int i = 0; i < arg.GetCount() - 1; i += 2) { const std::string &propertyName = arg.String(i); - if (excel::IObject::ConfigID() != propertyName && excel::IObject::ClassName() != propertyName && - excel::IObject::SceneID() != propertyName && excel::IObject::ID() != propertyName && - excel::IObject::GroupID() != propertyName) { + if (excel::Object::ConfigID() != propertyName && excel::Object::ClassName() != propertyName && + excel::Object::SceneID() != propertyName && excel::Object::ID() != propertyName && + excel::Object::GroupID() != propertyName) { std::shared_ptr pArgProperty = pPropertyManager->GetElement(propertyName); if (pArgProperty) { switch (pArgProperty->GetType()) { @@ -222,7 +222,7 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s stream << " config_name: " << configIndex; stream << " scene_id: " << sceneID; stream << " group_id: " << groupID; - stream << " position: " << pObject->GetPropertyVector3(excel::IObject::Position()).ToString(); + stream << " position: " << pObject->GetPropertyVector3(excel::Object::Position()).ToString(); LOG_INFO("%v", stream.str()); @@ -302,14 +302,14 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s { Vector3 vRelivePos = m_scene_->GetRelivePosition(sceneID, 0); - pObject->SetPropertyObject(excel::IObject::ID(), ident); - pObject->SetPropertyString(excel::IObject::ConfigID(), configIndex); - pObject->SetPropertyString(excel::IObject::ClassName(), className); - pObject->SetPropertyInt(excel::IObject::SceneID(), sceneID); - pObject->SetPropertyInt(excel::IObject::GroupID(), groupID); - pObject->SetPropertyVector3(excel::IObject::Position(), vRelivePos); + pObject->SetPropertyObject(excel::Object::ID(), ident); + pObject->SetPropertyString(excel::Object::ConfigID(), configIndex); + pObject->SetPropertyString(excel::Object::ClassName(), className); + pObject->SetPropertyInt(excel::Object::SceneID(), sceneID); + pObject->SetPropertyInt(excel::Object::GroupID(), groupID); + pObject->SetPropertyVector3(excel::Object::Position(), vRelivePos); - pContainerInfo->AddObjectToGroup(groupID, ident, className == excel::Player::ThisName() ? true : false); + pContainerInfo->AddObjectToGroup(groupID, ident, className == excel::Object::ThisName() ? true : false); DoEvent(ident, className, pObject->GetState(), arg); } @@ -338,8 +338,8 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s std::shared_ptr pPropertyManager = pObject->GetPropertyManager(); for (int i = 0; i < arg.GetCount() - 1; i += 2) { const std::string &propertyName = arg.String(i); - if (excel::IObject::ConfigID() != propertyName && excel::IObject::ClassName() != propertyName && excel::IObject::SceneID() != propertyName && - excel::IObject::ID() != propertyName && excel::IObject::GroupID() != propertyName) { + if (excel::Object::ConfigID() != propertyName && excel::Object::ClassName() != propertyName && excel::Object::SceneID() != propertyName && + excel::Object::ID() != propertyName && excel::Object::GroupID() != propertyName) { std::shared_ptr pArgProperty = pPropertyManager->GetElement(propertyName); if (pArgProperty) { switch (pArgProperty->GetType()) { @@ -373,7 +373,7 @@ std::shared_ptr WorldModule::CreateObject(const Guid &self, const int s stream << " config_name: " << configIndex; stream << " scene_id: " << sceneID; stream << " group_id: " << groupID; - stream << " position: " << pObject->GetPropertyVector3(excel::IObject::Position()).ToString(); + stream << " position: " << pObject->GetPropertyVector3(excel::Object::Position()).ToString(); // m_log_->LogInfo(stream); @@ -421,20 +421,20 @@ bool WorldModule::DestroyObject(const Guid &self) { return DestroySelf(self); } - const int sceneID = GetPropertyInt32(self, excel::IObject::SceneID()); - const int groupID = GetPropertyInt32(self, excel::IObject::GroupID()); + const int sceneID = GetPropertyInt32(self, excel::Object::SceneID()); + const int groupID = GetPropertyInt32(self, excel::Object::GroupID()); std::shared_ptr pContainerInfo = m_scene_->GetElement(sceneID); if (pContainerInfo) { - const std::string &className = GetPropertyString(self, excel::IObject::ClassName()); - if (className == excel::Player::ThisName()) { + const std::string &className = GetPropertyString(self, excel::Object::ClassName()); + if (className == excel::Object::ThisName()) { m_scene_->LeaveSceneGroup(self); } DoEvent(self, className, COE_BEFOREDESTROY, DataList::Empty()); DoEvent(self, className, COE_DESTROY, DataList::Empty()); - if (className != excel::Player::ThisName()) { + if (className != excel::Object::ThisName()) { pContainerInfo->RemoveObjectFromGroup(groupID, self, false); } @@ -1134,7 +1134,7 @@ bool WorldModule::GetGroupObjectList(const int sceneID, const int groupID, const continue; } - if (this->GetPropertyString(xID, excel::IObject::ClassName()) == className && xID != noSelf) { + if (this->GetPropertyString(xID, excel::Object::ClassName()) == className && xID != noSelf) { list.AddObject(xID); } } @@ -1167,8 +1167,8 @@ bool WorldModule::LogInfo(const Guid ident) { std::shared_ptr pObject = GetObject(ident); if (pObject) { - int sceneID = GetPropertyInt32(ident, excel::IObject::SceneID()); - int groupID = GetPropertyInt32(ident, excel::IObject::GroupID()); + int sceneID = GetPropertyInt32(ident, excel::Object::SceneID()); + int groupID = GetPropertyInt32(ident, excel::Object::GroupID()); LOG_INFO("Guid<%v> SceneID<%v>", ident.ToString(), sceneID); } else { LOG_ERROR("Guid<%v> There is no object", ident.ToString()); @@ -1191,7 +1191,7 @@ int WorldModule::OnPropertyCommonEvent(const Guid &self, const std::string &prop pFun->operator()(self, propertyName, oldVar, newVar, reason); } - const std::string &className = xObject->GetPropertyString(excel::IObject::ClassName()); + const std::string &className = xObject->GetPropertyString(excel::Object::ClassName()); std::map>::iterator itClass = mtClassPropertyCallBackList.find(className); if (itClass != mtClassPropertyCallBackList.end()) { std::list::iterator itList = itClass->second.begin(); @@ -1304,7 +1304,7 @@ int WorldModule::OnRecordCommonEvent(const Guid &self, const RECORD_EVENT_DATA & } } - const std::string &className = xObject->GetPropertyString(excel::IObject::ClassName()); + const std::string &className = xObject->GetPropertyString(excel::Object::ClassName()); std::map>::iterator itClass = mtClassRecordCallBackList.find(className); if (itClass != mtClassRecordCallBackList.end()) { std::list::iterator itList = itClass->second.begin();