Skip to content

Commit 552d082

Browse files
committed
server: make force_enet_disconnect take a netID, not a peerID
1 parent fd04e57 commit 552d082

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

code/components/citizen-server-impl/src/GameServerNet.ENet.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#include <NetAddress.h>
99
#include <NetBuffer.h>
1010

11+
#include <ClientRegistry.h>
12+
#include <ServerInstanceBase.h>
13+
1114
#include <enet/enet.h>
1215

1316
namespace fx
@@ -150,6 +153,8 @@ namespace fx
150153
{
151154
static ConsoleCommand cmd("force_enet_disconnect", [this](int peerIdx)
152155
{
156+
peerIdx = m_server->GetInstance()->GetComponent<fx::ClientRegistry>()->GetClientByNetID(peerIdx)->GetPeer();
157+
153158
auto peer = m_peerHandles.left.find(peerIdx);
154159

155160
if (peer != m_peerHandles.left.end())

0 commit comments

Comments
 (0)