commit
d35a7a8e23
2
externals/enet
vendored
2
externals/enet
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 39a72ab1990014eb399cee9d538fd529df99c6a0
|
Subproject commit 498b9e3571c2e096d7143c3c76852c5ec28d7885
|
@ -251,7 +251,7 @@ public:
|
|||||||
void Room::RoomImpl::ServerLoop() {
|
void Room::RoomImpl::ServerLoop() {
|
||||||
while (state != State::Closed) {
|
while (state != State::Closed) {
|
||||||
ENetEvent event;
|
ENetEvent event;
|
||||||
if (enet_host_service(server, &event, 50) > 0) {
|
if (enet_host_service(server, &event, 16) > 0) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case ENET_EVENT_TYPE_RECEIVE:
|
case ENET_EVENT_TYPE_RECEIVE:
|
||||||
switch (event.packet->data[0]) {
|
switch (event.packet->data[0]) {
|
||||||
|
@ -159,7 +159,7 @@ void RoomMember::RoomMemberImpl::MemberLoop() {
|
|||||||
while (IsConnected()) {
|
while (IsConnected()) {
|
||||||
std::lock_guard lock(network_mutex);
|
std::lock_guard lock(network_mutex);
|
||||||
ENetEvent event;
|
ENetEvent event;
|
||||||
if (enet_host_service(client, &event, 100) > 0) {
|
if (enet_host_service(client, &event, 16) > 0) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case ENET_EVENT_TYPE_RECEIVE:
|
case ENET_EVENT_TYPE_RECEIVE:
|
||||||
switch (event.packet->data[0]) {
|
switch (event.packet->data[0]) {
|
||||||
@ -251,16 +251,18 @@ void RoomMember::RoomMemberImpl::MemberLoop() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::list<Packet> packets;
|
||||||
{
|
{
|
||||||
std::lock_guard lock(send_list_mutex);
|
std::lock_guard lock(send_list_mutex);
|
||||||
for (const auto& packet : send_list) {
|
packets.swap(send_list);
|
||||||
|
}
|
||||||
|
for (const auto& packet : packets) {
|
||||||
ENetPacket* enetPacket = enet_packet_create(packet.GetData(), packet.GetDataSize(),
|
ENetPacket* enetPacket = enet_packet_create(packet.GetData(), packet.GetDataSize(),
|
||||||
ENET_PACKET_FLAG_RELIABLE);
|
ENET_PACKET_FLAG_RELIABLE);
|
||||||
enet_peer_send(server, 0, enetPacket);
|
enet_peer_send(server, 0, enetPacket);
|
||||||
}
|
}
|
||||||
enet_host_flush(client);
|
enet_host_flush(client);
|
||||||
send_list.clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Disconnect();
|
Disconnect();
|
||||||
};
|
};
|
||||||
|
@ -113,7 +113,7 @@ out gl_PerVertex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PicaFSConfig PicaFSConfig::BuildFromRegs(const Pica::Regs& regs) {
|
PicaFSConfig PicaFSConfig::BuildFromRegs(const Pica::Regs& regs) {
|
||||||
PicaFSConfig res;
|
PicaFSConfig res{};
|
||||||
|
|
||||||
auto& state = res.state;
|
auto& state = res.state;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user