This commit is contained in:
aozhiwei 2023-05-19 22:27:30 +08:00
parent 53a68849a0
commit 0c6b8a22ee
6 changed files with 33 additions and 0 deletions

View File

@ -38,6 +38,7 @@ namespace mt
s_.match_lock_time = GetIntParam("match_lock_time", 0);
s_.pickup_weapon_replace_type = GetIntParam("pickup_weapon_replace_type", 0);
s_.sand_table_move_speed = GetIntParam("sand_table_move_speed", 500);
s_.wait_cloud_time = GetIntParam("wait_cloud_time", 10);
#if 1
s_.match_lock_time++;
#endif

View File

@ -100,6 +100,7 @@ namespace mt
int compose_mode = 1;
float sand_table_move_speed = 500;
float wait_cloud_time = 3;
};
static void StaticPostInit();

View File

@ -1313,6 +1313,7 @@ void Room::UpdateGasInactivePvp()
});
NotifyUiUpdate();
NotifyGameStart();
sand_table_->OnGameStart();
} else {
ShuaPlane();
RoomMgr::Instance()->ActiveRoom(GetRoomUuid());
@ -3856,3 +3857,13 @@ bool Room::HasRoomSwitch(int tag)
{
return a8::HasBitFlag(room_switch_, tag);
}
void Room::OpenRoomSwitch(int tag)
{
a8::SetBitFlag(room_switch_, tag);
}
void Room::CloseRoomSwitch(int tag)
{
a8::UnSetBitFlag(room_switch_, tag);
}

View File

@ -248,6 +248,8 @@ public:
void CombineTeam();
void FillTeam();
bool HasRoomSwitch(int tag);
void OpenRoomSwitch(int tag);
void CloseRoomSwitch(int tag);
private:
void ShuaAndroid();

View File

@ -3,8 +3,12 @@
#include "sandtable.h"
#include "room.h"
#include "mt/Param.h"
SandTable::SandTable(Room* room): room_(room)
{
room->OpenRoomSwitch(kRoomSwitchDisableUseSkill);
room->OpenRoomSwitch(kRoomSwitchDisableUseItem);
int lock_time = std::max(0, (int)room->GetGasInactiveTime() - 10);
room->xtimer.SetTimeoutEx
(SERVER_FRAME_RATE * lock_time,
@ -18,3 +22,16 @@ SandTable::SandTable(Room* room): room_(room)
},
&room->xtimer_attacher_);
}
void SandTable::OnGameStart()
{
room_->xtimer.SetTimeoutEx
(SERVER_FRAME_RATE * mt::Param::s().wait_cloud_time,
[room = room_] (int event, const a8::Args* args)
{
if (a8::TIMER_EXEC_EVENT == event) {
}
},
&room_->xtimer_attacher_);
}

View File

@ -14,6 +14,7 @@ class SandTable
SandTable(Room* room);
void FillMFSandTable(cs::SMUpdate* msg, Human* hum, FrameData* framedata);
void OnGameStart();
private:
Room* room_ = nullptr;