diff --git a/230130-hookgamesendto/hookdll/Makefile b/230130-hookgamesendto/hookdll/Makefile index 41198a737f47b13776d89c90c6b890f6b1af85e0..a5965d8b8752b234911364d44e6c439bacb033c5 100644 --- a/230130-hookgamesendto/hookdll/Makefile +++ b/230130-hookgamesendto/hookdll/Makefile @@ -6,7 +6,7 @@ cxx32prefix = i686-w64-mingw32- cxx64prefix = x86_64-w64-mingw32- objdir = ./obj/ bindir = ../bin/ -src = hookdll.cpp fkhook.cpp inlinehook.cpp sockqueue.cpp +src = hookdll.cpp fkhook.cpp inlinehook.cpp obj32 = $(patsubst %.cpp, $(objdir)%_32.o, $(src)) obj64 = $(patsubst %.cpp, $(objdir)%_64.o, $(src)) target32 = $(bindir)hookdll32.dll diff --git a/230130-hookgamesendto/inc/sockqueue.h b/230130-hookgamesendto/inc/sockqueue.h deleted file mode 100644 index e90cace8ab18c23e262cb802575952f790958b43..0000000000000000000000000000000000000000 --- a/230130-hookgamesendto/inc/sockqueue.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include - -#define MAX_SOCK_QUEUE 64 - -// Socket循环队列,使socket排队关闭而不是立即关闭 -class SockQueue -{ -private: - SOCKET socks[MAX_SOCK_QUEUE]; - int current; -public: - SockQueue(); - ~SockQueue(); - void add(SOCKET s); -}; diff --git a/230130-hookgamesendto/src/fkhook.cpp b/230130-hookgamesendto/src/fkhook.cpp index d015108860cfaf2a455737972e59c4ea42a48a96..022373c3fb9c4f0a0be427b906b0fddcdaa6a77c 100644 --- a/230130-hookgamesendto/src/fkhook.cpp +++ b/230130-hookgamesendto/src/fkhook.cpp @@ -1,6 +1,5 @@ #include #include "fkhook.h" -#include "sockqueue.h" #include "platform.h" #include diff --git a/230130-hookgamesendto/src/sockqueue.cpp b/230130-hookgamesendto/src/sockqueue.cpp deleted file mode 100644 index 865b76c7d809b51d315639aaf62a39e5feacb22c..0000000000000000000000000000000000000000 --- a/230130-hookgamesendto/src/sockqueue.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "sockqueue.h" - -SockQueue::SockQueue() -{ - memset(&socks, 0, MAX_SOCK_QUEUE * sizeof(SOCKET)); - current = 0; -} - -SockQueue::~SockQueue() -{ - for (int i = 0; i < MAX_SOCK_QUEUE; i++) - if (socks[i] != 0) - closesocket(socks[i]); -} - -void SockQueue::add(SOCKET s) -{ - if (socks[current] != 0) - closesocket(socks[current]); - socks[current++] = s; - if (current == MAX_SOCK_QUEUE) - current = 0; -}