Skip to content

Commit

Permalink
修复炸服问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasylidong committed Mar 20, 2024
1 parent e20e4e7 commit 1c214f2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
Binary file modified addons/sourcemod/plugins/optional/AnneHappy/infected_control.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/AnneHappy/si_pool.smx
Binary file not shown.
5 changes: 4 additions & 1 deletion addons/sourcemod/scripting/AnneHappy/infected_control.sp
Expand Up @@ -480,7 +480,10 @@ public Action Timer_KickBot(Handle timer, int client)
if (IsClientInGame(client) && !IsClientInKickQueue(client) && IsFakeClient(client))
{
Debug_Print("踢出特感%N",client);
KickClient(client, "You are worthless and was kicked by console");
if(g_bSIPoolAvailable)
g_hSIPool.ReturnSIBot(client);
else
KickClient(client, "You are worthless and was kicked by console");
}
return Plugin_Continue;
}
Expand Down
12 changes: 10 additions & 2 deletions addons/sourcemod/scripting/AnneHappy/si_pool.sp
Expand Up @@ -2,7 +2,7 @@
* @Author: 我是派蒙啊
* @Last Modified by: 我是派蒙啊
* @Create Date: 2024-02-17 11:15:10
* @Last Modified time: 2024-02-20 14:42:17
* @Last Modified time: 2024-02-24 23:03:11
* @Github: https://github.com/Paimon-Kawaii
*/

Expand All @@ -11,7 +11,9 @@

#define DEBUG 0

#define VERSION "2024.02.20#12"
#define RECOVER 0

#define VERSION "2024.02.24#20"

#define LIBRARY_NAME "si_pool"
#define GAMEDATA_FILE "si_pool"
Expand Down Expand Up @@ -131,10 +133,12 @@ public void OnClientDisconnect(int client)
g_iPoolSize++;
}

#if RECOVER
void RecoverSIPool()
{
OnPoolSizeChanged(0, g_iPoolSize);
}
#endif

void CreateNatives()
{
Expand Down Expand Up @@ -336,7 +340,9 @@ void OnPoolSizeChanged(int iOldPoolSize, int iNewPoolSize)
void HookEvents()
{
HookEvent("player_death", Event_PlayerDeath);
#if RECOVER
HookEvent("round_start", Event_RoundStart);
#endif
}

void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
Expand All @@ -353,10 +359,12 @@ void Event_PlayerDeath(Event event, const char[] name, bool dontBroadcast)
g_iPoolArray[g_iPoolSize++] = client;
}

#if RECOVER
void Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
RecoverSIPool();
}
#endif

void PrepareSDKCalls()
{
Expand Down
28 changes: 11 additions & 17 deletions addons/sourcemod/scripting/include/si_pool.inc
Expand Up @@ -2,7 +2,7 @@
* @Author: 我是派蒙啊
* @Last Modified by: 我是派蒙啊
* @Create Date: 2024-02-17 18:11:22
* @Last Modified time: 2024-02-20 21:34:02
* @Last Modified time: 2024-02-20 21:33:55
* @Github: https://github.com/Paimon-Kawaii
*/

Expand All @@ -21,7 +21,7 @@ public SharedPlugin __pl_sipool = {
#endif
};

#define SIZABLE 0
#define SIZABLE 0

public void __pl_sipool_SetNTVOptional()
{
Expand Down Expand Up @@ -54,22 +54,16 @@ public void __pl_sipool_SetNTVOptional()

methodmap SIPool
{
public static native SIPool Instance();

public static native SIPool Instance();

property int Size
{

public native get();
property int Size {
public native get();
}

#if SIZABLE

public native void Narrow(int size);

public native void Expand(int size);

public native void Resize(int size);
public native void Narrow(int size);
public native void Expand(int size);
public native void Resize(int size);
#endif

/**
Expand All @@ -80,14 +74,14 @@ public native void Resize(int size);
* @param angle Angle that zombie look at
* @return Client index
*/
public native int RequestSIBot(int zclass, const float origin[3] = NULL_VECTOR, const float angle[3] = NULL_VECTOR);

public native int RequestSIBot(int zclass, const float origin[3] = NULL_VECTOR, const float angle[3] = NULL_VECTOR);
/**
* Return a Special infected Bot to SIPool
* Bot will automatically return after dead
*
* @param client Zombie Bot to return
* @return True is success, false otherwise
*/
public native bool ReturnSIBot(int client);
public native bool ReturnSIBot(int client);
}

0 comments on commit 1c214f2

Please sign in to comment.