From f9226a6c3971ef077911afe8da688f65baaee382 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 16 Sep 2023 16:02:48 +0800 Subject: [PATCH] 1 --- server/gameserver/custom_battle.h | 13 +++++++++++++ server/gameserver/custom_member.h | 11 +++++++++++ server/gameserver/custom_team.h | 13 +++++++++++++ server/gameserver/room.h | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 server/gameserver/custom_member.h create mode 100644 server/gameserver/custom_team.h diff --git a/server/gameserver/custom_battle.h b/server/gameserver/custom_battle.h index 0e6eed62..c46e6284 100644 --- a/server/gameserver/custom_battle.h +++ b/server/gameserver/custom_battle.h @@ -1,5 +1,7 @@ #pragma once +class Room; +class CustomTeam; class CustomBattle { public: @@ -7,8 +9,19 @@ class CustomBattle void Init(); void UnInit(); + Room* GetRoom() { return room_; } + const std::string& GetRoomId() { return room_id_; } + const std::string& GetRoomUuid() { return room_uuid_; } + int GetZoneId() { return zone_id_; } + int GetNodeId() { return zone_id_; } + int GetStartTime() { return start_time_; } + private: + Room *room_ = nullptr; std::string room_id_; + std::string room_uuid_; int zone_id_ = 0; int node_id_ = 0; + int start_time_ = 0; + std::map> team_hash_; }; diff --git a/server/gameserver/custom_member.h b/server/gameserver/custom_member.h new file mode 100644 index 00000000..b17d4f51 --- /dev/null +++ b/server/gameserver/custom_member.h @@ -0,0 +1,11 @@ +#pragma once + +class CustomMember +{ + public: + + const std::string& GetAccountId() { return account_id_; } + + private: + std::string account_id_; +}; diff --git a/server/gameserver/custom_team.h b/server/gameserver/custom_team.h new file mode 100644 index 00000000..f9bcb880 --- /dev/null +++ b/server/gameserver/custom_team.h @@ -0,0 +1,13 @@ +#pragma once + +class CustomMember; +class CustomTeam +{ + public: + + const std::string& GetTeamUuid() { return team_uuid_; } + + private: + std::string team_uuid_; + std::map> member_hash_; +}; diff --git a/server/gameserver/room.h b/server/gameserver/room.h index f8e1bc0c..9e0ccd32 100644 --- a/server/gameserver/room.h +++ b/server/gameserver/room.h @@ -41,6 +41,7 @@ struct RoomInitInfo; struct FrameEventData; class SandTable; class BatchSync; +class CustomBattle; struct Plane { @@ -116,6 +117,7 @@ public: std::string GetMapTplName() { return map_tpl_name_; } const mt::Map* GetMapMeta() { return map_meta_; } bool IsBattleStarting() { return battle_starting_; }; + std::shared_ptr GetCustomBattle() { return custom_battle_; } bool IsPveRoom(); bool IsDestoryRoom(); bool IsSurvivalRoom(); @@ -398,6 +400,7 @@ private: Incubator* incubator_ = nullptr; std::shared_ptr sand_table_; + std::shared_ptr custom_battle_; bool infinite_bullet_mode_ = false;