*
This commit is contained in:
@@ -131,6 +131,9 @@ struct DefItemInfo {
|
||||
|
||||
};
|
||||
|
||||
struct DefVoxel_t {};
|
||||
struct DefNode_t {};
|
||||
|
||||
/* Интерфейс обработчика сессии с сервером */
|
||||
class IServerSession {
|
||||
struct ArrayHasher {
|
||||
|
||||
@@ -622,24 +622,24 @@ coro<> ServerSession::rP_Definition(Net::AsyncSocket &sock) {
|
||||
}
|
||||
case ToClient::L2Definition::Node:
|
||||
{
|
||||
DefNodeId id;
|
||||
DefNode_t def;
|
||||
id = co_await sock.read<DefNodeId>();
|
||||
def.DrawType = (DefNode_t::EnumDrawType) co_await sock.read<uint8_t>();
|
||||
for(int iter = 0; iter < 6; iter++) {
|
||||
auto &pl = def.Texs[iter].Pipeline;
|
||||
pl.resize(co_await sock.read<uint16_t>());
|
||||
co_await sock.read((std::byte*) pl.data(), pl.size());
|
||||
}
|
||||
// DefNodeId id;
|
||||
// DefNode_t def;
|
||||
// id = co_await sock.read<DefNodeId>();
|
||||
// def.DrawType = (DefNode_t::EnumDrawType) co_await sock.read<uint8_t>();
|
||||
// for(int iter = 0; iter < 6; iter++) {
|
||||
// auto &pl = def.Texs[iter].Pipeline;
|
||||
// pl.resize(co_await sock.read<uint16_t>());
|
||||
// co_await sock.read((std::byte*) pl.data(), pl.size());
|
||||
// }
|
||||
|
||||
PP_Definition_Node *packet = new PP_Definition_Node(
|
||||
id,
|
||||
def
|
||||
);
|
||||
// PP_Definition_Node *packet = new PP_Definition_Node(
|
||||
// id,
|
||||
// def
|
||||
// );
|
||||
|
||||
while(!NetInputPackets.push(packet));
|
||||
// while(!NetInputPackets.push(packet));
|
||||
|
||||
co_return;
|
||||
// co_return;
|
||||
}
|
||||
case ToClient::L2Definition::FreeNode:
|
||||
{
|
||||
|
||||
@@ -2231,12 +2231,24 @@ void Vulkan::gui_ConnectedToServer() {
|
||||
std::string text = std::to_string(ImGui::GetIO().Framerate);
|
||||
ImGui::Text(text.c_str());
|
||||
if(ImGui::Button("Выйти")) {
|
||||
Game.RSession->pushStage(EnumRenderStage::Shutdown);
|
||||
Game.Session->shutdown(EnumDisconnect::ByInterface);
|
||||
try {
|
||||
if(Game.Session)
|
||||
Game.Session->shutdown(EnumDisconnect::ByInterface);
|
||||
} catch(const std::exception &exc) {
|
||||
LOG.error() << "Game.Session->shutdown: " << exc.what();
|
||||
}
|
||||
|
||||
Game.RSession = nullptr;
|
||||
Game.Session = nullptr;
|
||||
Game.ImGuiInterfaces.pop_back();
|
||||
int mode = glfwGetInputMode(Graphics.Window, GLFW_CURSOR);
|
||||
if(mode != GLFW_CURSOR_NORMAL)
|
||||
glfwSetInputMode(Graphics.Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
||||
if(!Game.RSession)
|
||||
return;
|
||||
}
|
||||
|
||||
if(Game.Session->isConnected())
|
||||
|
||||
Reference in New Issue
Block a user