refactor: suppression code inutile
This commit is contained in:
parent
2e27a49d73
commit
732a0cdaf3
1 changed files with 1 additions and 79 deletions
80
infolan.sp
80
infolan.sp
|
@ -24,7 +24,7 @@ public Plugin myinfo =
|
|||
description = "Bot communiquant avec le bot discord \
|
||||
https://github.com/Lunki51/cs-picker afin d’automatiser \
|
||||
l’InfoLan 2021",
|
||||
version = "1.5.7",
|
||||
version = "1.5.8",
|
||||
url = "https://git.gnous.eu/Rick/infolanBot"
|
||||
};
|
||||
|
||||
|
@ -33,13 +33,8 @@ public void OnPluginStart()
|
|||
HookEvent("player_activate", SetTeamPlayer);
|
||||
HookEvent("cs_win_panel_round", UpdateScoreBoard);
|
||||
HookEvent("cs_win_panel_match", FinCarte);
|
||||
//HookEvent("cs_match_end_restart", TestRestart, EventHookMode_Pre);
|
||||
|
||||
RegServerCmd("!team", SetTeam);
|
||||
/* pour le debug
|
||||
RegServerCmd("!tests", TestSocket);
|
||||
RegServerCmd("!testsA", TestSocketA);
|
||||
*/
|
||||
|
||||
PrintToServer("Hello world!");
|
||||
}
|
||||
|
@ -53,28 +48,6 @@ public void FinCarte(Event event, const char[] name, bool dontBroadcast)
|
|||
ServeurLibre();
|
||||
}
|
||||
|
||||
/**
|
||||
* Commande pour tester le redémarrage d’une partie (kick des personnes,
|
||||
* notification au bot…)
|
||||
*/
|
||||
public void TestRestart(Event event, const char[] name, bool dontBroadcast)
|
||||
{
|
||||
// TODO kick tout le monde
|
||||
PrintToServer("======= FIN ======");
|
||||
for (int i = 0; i < nbAllId; i++)
|
||||
{
|
||||
PrintToServer("On kick %d.", allId[i]);
|
||||
if (IsClientInGame(allId[i])) {
|
||||
PrintToServer("NUUUUUUUL");
|
||||
KickClient(allId[i], "Le match est fini.");
|
||||
}
|
||||
allId[i] = 0;
|
||||
}
|
||||
ServeurLibre();
|
||||
nbAllId = 0;
|
||||
/* kick tout le monde */
|
||||
}
|
||||
|
||||
/**
|
||||
* Met le numéro de port dans la variable après le chargement de la config
|
||||
*/
|
||||
|
@ -170,41 +143,12 @@ public Action SetTeam(int args)
|
|||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: À supprimer
|
||||
*/
|
||||
public void OnMapVoteStarted()
|
||||
{
|
||||
// TODO kick tout le monde
|
||||
PrintToServer("======= FIN ======");
|
||||
for (int i = 0; i < nbAllId; i++)
|
||||
{
|
||||
PrintToServer("On kick %d.", allId[i]);
|
||||
if (IsClientInGame(allId[i])) {
|
||||
PrintToServer("NUUUUUUUL");
|
||||
KickClient(allId[i], "Le match est fini.");
|
||||
}
|
||||
allId[i] = 0;
|
||||
}
|
||||
ServeurLibre();
|
||||
nbAllId = 0;
|
||||
/* kick tout le monde */
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoie une requete POST au bot pour lui indiquer que la partie est finie
|
||||
* et que le serveur est libre.
|
||||
*/
|
||||
public void ServeurLibre()
|
||||
{
|
||||
/*
|
||||
for (int i = 0; i < sizeof(teamCT); i++)
|
||||
{
|
||||
teamCT[i] = "";
|
||||
teamT[i] = "";
|
||||
}
|
||||
*/
|
||||
// requete post pour match fini et serveur libre
|
||||
Handle socket = SocketCreate(SOCKET_TCP, OnSocketError);
|
||||
SocketConnect(socket, SocketEnvoieVictoire, OnSocketReceive, OnSocketDisconnected, MY_SOCKET_IP, MY_SOCKET_PORT);
|
||||
}
|
||||
|
@ -214,32 +158,10 @@ public void ServeurLibre()
|
|||
*/
|
||||
public void UpdateScoreBoard(Event event, const char[] name, bool dontBroadcast)
|
||||
{
|
||||
// request post avec les scores des 2 équipes
|
||||
Handle socket = SocketCreate(SOCKET_TCP, OnSocketError);
|
||||
SocketConnect(socket, SocketUpdateScore, OnSocketReceive, OnSocketDisconnected, MY_SOCKET_IP, MY_SOCKET_PORT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Commande de tests pour envoyant une requete avec le socket.
|
||||
*/
|
||||
public Action TestSocket(int args)
|
||||
{
|
||||
PrintToServer("envoie socket");
|
||||
Handle socket = SocketCreate(SOCKET_TCP, OnSocketError);
|
||||
SocketConnect(socket, SocketUpdateScore, OnSocketReceive, OnSocketDisconnected, MY_SOCKET_IP, MY_SOCKET_PORT);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Commande de tests pour envoyant une requete avec le socket.
|
||||
*/
|
||||
public Action TestSocketA(int args)
|
||||
{
|
||||
Handle socket = SocketCreate(SOCKET_TCP, OnSocketError);
|
||||
SocketConnect(socket, SocketEnvoieVictoire, OnSocketReceive, OnSocketDisconnected, MY_SOCKET_IP, MY_SOCKET_PORT);
|
||||
return Plugin_Handled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Socket envoyant le score à la fin du round
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue