Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Groups #72

Open
wants to merge 17 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Bot_Dofus_1.29.1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
<Compile Include="Comun\Frames\Juego\AutentificacionJuego.cs" />
<Compile Include="Comun\Frames\Juego\ChatFrame.cs" />
<Compile Include="Comun\Frames\Juego\IMFrame.cs" />
<Compile Include="Comun\Frames\Juego\MapaFrame.cs" />
<Compile Include="Comun\Frames\Juego\MapFrame.cs" />
<Compile Include="Comun\Frames\Juego\NPCFrame.cs" />
<Compile Include="Comun\Frames\Juego\PeleaFrame.cs" />
<Compile Include="Comun\Frames\Juego\PersonajeFrame.cs" />
<Compile Include="Comun\Frames\Juego\FightFrame.cs" />
<Compile Include="Comun\Frames\Juego\CharacterFrame.cs" />
<Compile Include="Comun\Frames\Juego\ServidorSeleccionFrame.cs" />
<Compile Include="Comun\Frames\Transporte\PaqueteAtributo.cs" />
<Compile Include="Comun\Frames\Transporte\PaqueteDatos.cs" />
Expand Down Expand Up @@ -237,27 +237,27 @@
<Compile Include="Otros\Peleas\Enums\PosicionamientoInicioPelea.cs" />
<Compile Include="Otros\Peleas\Enums\ResultadoLanzandoHechizo.cs" />
<Compile Include="Otros\Peleas\Enums\Tactica.cs" />
<Compile Include="Otros\Peleas\ManejadorHechizos.cs" />
<Compile Include="Otros\Peleas\SpellsManager.cs" />
<Compile Include="Otros\Peleas\Peleadores\Luchadores.cs" />
<Compile Include="Otros\Peleas\Pelea.cs" />
<Compile Include="Otros\Peleas\Fight.cs" />
<Compile Include="Otros\Peleas\Peleadores\LuchadorPersonaje.cs" />
<Compile Include="Otros\Peleas\PeleaExtensiones.cs" />
<Compile Include="Otros\Peleas\FightExtensions.cs" />
<Compile Include="Otros\Game\Character\Spells\Spell.cs" />
<Compile Include="Otros\Game\Character\CharacterClass.cs" />
<Compile Include="Otros\Game\Character\CharacterBaseStats.cs" />
<Compile Include="Otros\Game\Character\CharacterCharacteristics.cs" />
<Compile Include="Otros\Scripts\Acciones\AccionesScript.cs" />
<Compile Include="Otros\Scripts\Acciones\Almacenamiento\AlmacenarTodosLosObjetosAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\ScriptAction.cs" />
<Compile Include="Otros\Scripts\Acciones\Almacenamiento\StoreAllObjectsAction.cs" />
<Compile Include="Otros\Scripts\Acciones\Almacenamiento\RecuperarObjetoBanco.cs" />
<Compile Include="Otros\Scripts\Acciones\Inventario\UtilizarObjetoAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Mapas\CambiarMapaAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Mapas\ChangeMapAction.cs" />
<Compile Include="Otros\Scripts\Acciones\CerrarVentanaAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Global\DelayAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Inventario\EquiparItemAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Mapas\MoverCeldaAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\CerrarDialogoAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\NpcAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\NpcBancoAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\NpcAction.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\NpcBankAction.cs" />
<Compile Include="Otros\Scripts\Acciones\Npcs\RespuestaAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\PeleasAccion.cs" />
<Compile Include="Otros\Scripts\Acciones\RecoleccionAccion.cs" />
Expand All @@ -273,10 +273,10 @@
<Compile Include="Otros\Scripts\Banderas\NPCBancoBandera.cs" />
<Compile Include="Otros\Scripts\Banderas\PeleaBandera.cs" />
<Compile Include="Otros\Scripts\Banderas\RecoleccionBandera.cs" />
<Compile Include="Otros\Scripts\EstadoScript.cs" />
<Compile Include="Otros\Scripts\Manejadores\LuaManejadorScript.cs" />
<Compile Include="Otros\Scripts\ScriptState.cs" />
<Compile Include="Otros\Scripts\Manejadores\LuaScriptManager.cs" />
<Compile Include="Otros\Scripts\Manejadores\ManejadorAcciones.cs" />
<Compile Include="Otros\Scripts\ManejadorScript.cs" />
<Compile Include="Otros\Scripts\ScriptManager.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Comun\Network\TcpClient.cs" />
Expand Down
8 changes: 4 additions & 4 deletions Comun/Frames/Autentificacion/AccountLogin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void GetWelcomeKeyAsync(TcpClient prmClient, string prmPacket)
{
Account account = prmClient.account;

account.accountState = AccountStates.CONNECTED;
account.AccountState = AccountStates.CONNECTED;
account.welcomeKey = prmPacket.Substring(2);

prmClient.SendPacket("1.30");
Expand All @@ -35,7 +35,7 @@ public void GetWelcomeKeyAsync(TcpClient prmClient, string prmPacket)
public void GetNickname(TcpClient prmClient, string prmPacket) => prmClient.account.nickname = prmPacket.Substring(2);

[PaqueteAtributo("Af")]
public void GetLoginQueue(TcpClient prmClient, string prmPacket) => prmClient.account.logger.log_informacion("File d'attente", "Position " + prmPacket[2] + "/" + prmPacket[4]);
public void GetLoginQueue(TcpClient prmClient, string prmPacket) => prmClient.account.Logger.LogInfo("File d'attente", "Position " + prmPacket[2] + "/" + prmPacket[4]);

[PaqueteAtributo("AH")]
public void GetServerState(TcpClient prmClient, string prmPacket)
Expand All @@ -58,7 +58,7 @@ public void GetServerState(TcpClient prmClient, string prmPacket)
if (id == account.accountConfig.Get_Server_ID())
{
server.RefreshData(id, serverName, serverState);
account.logger.log_informacion("LOGIN", $"Le serveur {serverName} est {account.game.server.GetState(serverState)}");
account.Logger.LogInfo("LOGIN", $"Le serveur {serverName} est {account.game.server.GetState(serverState)}");

if (serverState != ServerStates.ONLINE)
firstTime = false;
Expand Down Expand Up @@ -97,7 +97,7 @@ public void GetServerList(TcpClient prmClient, string prmPacket)
account.game.character.evento_Servidor_Seleccionado();
}
else
account.logger.log_Error("LOGIN", "Serveur non accessible lorsque celui-ci se reconnectera");
account.Logger.LogError("LOGIN", "Serveur non accessible lorsque celui-ci se reconnectera");
}
counter++;
}
Expand Down
12 changes: 6 additions & 6 deletions Comun/Frames/Autentificacion/AutentificacionLoginFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ class AutentificacionLogin : Frame
[PaqueteAtributo("AlEf")]
public void WrongCredentialsError(TcpClient prmClient, string prmPacket)
{
prmClient.account.logger.log_Error("LOGIN", "Connexion rejetée. Nom de compte ou mot de passe incorrect.");
prmClient.account.Logger.LogError("LOGIN", "Connexion rejetée. Nom de compte ou mot de passe incorrect.");
prmClient.account.Disconnect();
}

[PaqueteAtributo("AlEa")]
public void AlreadyConnectedError(TcpClient prmClient, string prmPacket)
{
prmClient.account.logger.log_Error("LOGIN", "Déjà connecté. Essayez encore une fois.");
prmClient.account.Logger.LogError("LOGIN", "Déjà connecté. Essayez encore une fois.");
prmClient.account.Disconnect();
}

[PaqueteAtributo("AlEv")]
public void WrongVersionError(TcpClient prmClient, string prmPacket)
{
prmClient.account.logger.log_Error("LOGIN", "La version %1 de Dofus que vous avez installée n'est pas compatible avec ce serveur. Pour jouer, installez la version %2. Le client DOFUS sera fermé.");
prmClient.account.Logger.LogError("LOGIN", "La version %1 de Dofus que vous avez installée n'est pas compatible avec ce serveur. Pour jouer, installez la version %2. Le client DOFUS sera fermé.");
prmClient.account.Disconnect();
}

[PaqueteAtributo("AlEb")]
public void AccountBannedError(TcpClient prmClient, string prmPacket)
{
prmClient.account.logger.log_Error("LOGIN", "Connexion rejetée. Votre compte a été banni.");
prmClient.account.Logger.LogError("LOGIN", "Connexion rejetée. Votre compte a été banni.");
prmClient.account.Disconnect();
}

[PaqueteAtributo("AlEd")]
public void AlreadyConnectingError(TcpClient prmClient, string prmPacket)
{
prmClient.account.logger.log_Error("LOGIN", "Ce compte est déjà connecté à un serveur de jeu. Veuillez réessayer.");
prmClient.account.Logger.LogError("LOGIN", "Ce compte est déjà connecté à un serveur de jeu. Veuillez réessayer.");
prmClient.account.Disconnect();
}

Expand All @@ -63,7 +63,7 @@ public void AccountTempBannedError(TcpClient prmClient, string prmPacket)
if (minutes > 0)
banInformationsMessage.Append(minutes + " minutes");

prmClient.account.logger.log_Error("LOGIN", banInformationsMessage.ToString());
prmClient.account.Logger.LogError("LOGIN", banInformationsMessage.ToString());
prmClient.account.Disconnect();
}
}
Expand Down
6 changes: 3 additions & 3 deletions Comun/Frames/Juego/AutentificacionJuego.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ class AutentificacionJuego : Frame
[PaqueteAtributo("M030")]
public void get_Error_Streaming(TcpClient cliente, string paquete)
{
cliente.account.logger.log_Error("Login", "Connexion rejetée. Vous n'avez pas pu vous authentifier pour ce serveur car votre connexion a expiré. Assurez-vous de couper les téléchargements, la musique ou les vidéos en continu pour améliorer la qualité et la vitesse de votre connexion.");
cliente.account.Logger.LogError("Login", "Connexion rejetée. Vous n'avez pas pu vous authentifier pour ce serveur car votre connexion a expiré. Assurez-vous de couper les téléchargements, la musique ou les vidéos en continu pour améliorer la qualité et la vitesse de votre connexion.");
cliente.account.Disconnect();
}

[PaqueteAtributo("M031")]
public void get_Error_Red(TcpClient cliente, string paquete)
{
cliente.account.logger.log_Error("Login", "Connexion rejetée. Le serveur de jeu n'a pas reçu les informations d'authentification nécessaires après votre identification. Veuillez réessayer et, si le problème persiste, contactez votre administrateur réseau ou votre serveur d'accès Internet. C'est un problème de redirection dû à une mauvaise configuration DNS.");
cliente.account.Logger.LogError("Login", "Connexion rejetée. Le serveur de jeu n'a pas reçu les informations d'authentification nécessaires après votre identification. Veuillez réessayer et, si le problème persiste, contactez votre administrateur réseau ou votre serveur d'accès Internet. C'est un problème de redirection dû à une mauvaise configuration DNS.");
cliente.account.Disconnect();
}

[PaqueteAtributo("M032")]
public void get_Error_Flood_Conexion(TcpClient cliente, string paquete)
{
cliente.account.logger.log_Error("Login", "Pour éviter de déranger les autres joueurs, attendez %1 secondes avant de vous reconnecter.");
cliente.account.Logger.LogError("Login", "Pour éviter de déranger les autres joueurs, attendez %1 secondes avant de vous reconnecter.");
cliente.account.Disconnect();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ Creado por Alvaro Prendes

namespace Bot_Dofus_1._29._1.Comun.Frames.Juego
{
class PersonajeFrame : Frame
class CharacterFrame : Frame
{
[PaqueteAtributo("As")]
public void get_Stats_Actualizados(TcpClient cliente, string paquete) => cliente.account.game.character.actualizar_Caracteristicas(paquete);

[PaqueteAtributo("PIK")]
public void get_Peticion_Grupo(TcpClient cliente, string paquete)
{
cliente.account.logger.log_informacion("Groupe", $"Nouvelle invitation de groupe du personnage: {paquete.Substring(3).Split('|')[0]}");
cliente.account.Logger.LogInfo("Groupe", $"Nouvelle invitation de groupe du personnage: {paquete.Substring(3).Split('|')[0]}");
cliente.SendPacket("PR");
cliente.account.logger.log_informacion("Groupe", "Rejêt de l'invitation");
cliente.account.Logger.LogInfo("Groupe", "Rejêt de l'invitation");
}

[PaqueteAtributo("SL")]
Expand Down Expand Up @@ -58,7 +58,7 @@ public void get_Cerrar_Dialogo(TcpClient cliente, string paquete)
{
Account cuenta = cliente.account;

switch (cuenta.accountState)
switch (cuenta.AccountState)
{
case AccountStates.STORAGE:
cuenta.game.character.inventario.evento_Almacenamiento_Abierto();
Expand All @@ -70,7 +70,7 @@ public void get_Cerrar_Dialogo(TcpClient cliente, string paquete)
npc.respuestas.Clear();
npc.respuestas = null;

cuenta.accountState = AccountStates.CONNECTED_INACTIVE;
cuenta.AccountState = AccountStates.CONNECTED_INACTIVE;
cuenta.game.character.evento_Dialogo_Acabado();
break;
}
Expand All @@ -81,9 +81,9 @@ public void get_Ventana_Cerrada(TcpClient cliente, string paquete)
{
Account cuenta = cliente.account;

if (cuenta.accountState == AccountStates.STORAGE)
if (cuenta.AccountState == AccountStates.STORAGE)
{
cuenta.accountState = AccountStates.CONNECTED_INACTIVE;
cuenta.AccountState = AccountStates.CONNECTED_INACTIVE;
cuenta.game.character.inventario.evento_Almacenamiento_Cerrado();
}
}
Expand Down Expand Up @@ -140,12 +140,15 @@ public void get_Experiencia_Oficio(TcpClient cliente, string paquete)

foreach (string oficio in separador_oficio_experiencia)
{
id = short.Parse(oficio.Split(';')[0]);
nivel = byte.Parse(oficio.Split(';')[1]);
experiencia_base = uint.Parse(oficio.Split(';')[2]);
experiencia_actual = uint.Parse(oficio.Split(';')[3]);

if (nivel < 100)
var payload = oficio.Split(';');
if (payload.Length < 4)
continue;
id = short.Parse(payload[0]);
nivel = byte.Parse(payload[1]);
experiencia_base = uint.Parse(payload[2]);
experiencia_actual = uint.Parse(payload[3]);

if (nivel < 100 && payload.Length >= 4)
experiencia_siguiente_nivel = uint.Parse(oficio.Split(';')[4]);
else
experiencia_siguiente_nivel = 0;
Expand All @@ -168,7 +171,7 @@ public void get_Experiencia_Oficio(TcpClient cliente, string paquete)
public void get_Modificar_Cantidad_Objeto(TcpClient cliente, string paquete) => cliente.account.game.character.inventario.modificar_Objetos(paquete.Substring(2));

[PaqueteAtributo("ECK")]
public void get_Intercambio_Ventana_Abierta(TcpClient cliente, string paquete) => cliente.account.accountState = AccountStates.STORAGE;
public void get_Intercambio_Ventana_Abierta(TcpClient cliente, string paquete) => cliente.account.AccountState = AccountStates.STORAGE;

[PaqueteAtributo("PCK")]
public void get_Grupo_Aceptado(TcpClient cliente, string paquete) => cliente.account.game.character.en_grupo = true;
Expand All @@ -179,7 +182,7 @@ public void get_Experiencia_Oficio(TcpClient cliente, string paquete)
[PaqueteAtributo("ERK")]
public void get_Peticion_Intercambio(TcpClient cliente, string paquete)
{
cliente.account.logger.log_informacion("INFORMATION", "L'invitation à l'échange est rejetée");
cliente.account.Logger.LogInfo("INFORMATION", "L'invitation à l'échange est rejetée");
cliente.SendPacket("EV", true);
}

Expand All @@ -194,7 +197,7 @@ public void get_Tiempo_Regenerado(TcpClient cliente, string paquete)
personaje.timer_regeneracion.Change(Timeout.Infinite, Timeout.Infinite);
personaje.timer_regeneracion.Change(tiempo, tiempo);

cuenta.logger.log_informacion("DOFUS", $"Votre personnage récupère 1 pdv chaque {tiempo / 1000} secondes");
cuenta.Logger.LogInfo("DOFUS", $"Votre personnage récupère 1 pdv chaque {tiempo / 1000} secondes");
}

[PaqueteAtributo("ILF")]
Expand All @@ -206,7 +209,7 @@ public void get_Cantidad_Vida_Regenerada(TcpClient cliente, string paquete)
CharacterClass personaje = cuenta.game.character;

personaje.caracteristicas.vitalidad_actual += vida;
cuenta.logger.log_informacion("DOFUS", $"Vous avez récupéré {vida} points de vie");
cuenta.Logger.LogInfo("DOFUS", $"Vous avez récupéré {vida} points de vie");
}

[PaqueteAtributo("eUK")]
Expand All @@ -219,16 +222,16 @@ public void get_Emote_Recibido(TcpClient cliente, string paquete)
if (cuenta.game.character.id != id)
return;

if (emote_id == 1 && cuenta.accountState != AccountStates.REGENERATION)
cuenta.accountState = AccountStates.REGENERATION;
else if (emote_id == 0 && cuenta.accountState == AccountStates.REGENERATION)
cuenta.accountState = AccountStates.CONNECTED_INACTIVE;
if (emote_id == 1 && cuenta.AccountState != AccountStates.REGENERATION)
cuenta.AccountState = AccountStates.REGENERATION;
else if (emote_id == 0 && cuenta.AccountState == AccountStates.REGENERATION)
cuenta.AccountState = AccountStates.CONNECTED_INACTIVE;
}

[PaqueteAtributo("Bp")]
public void get_Ping_Promedio(TcpClient cliente, string paquete) => cliente.SendPacket($"Bp{cliente.GetPingAverage()}|{cliente.GetTotalPings()}|50");

[PaqueteAtributo("pong")]
public void get_Ping_Pong(TcpClient cliente, string paquete) => cliente.account.logger.log_informacion("DOFUS", $"Ping: {cliente.GetPing()} ms");
public void get_Ping_Pong(TcpClient cliente, string paquete) => cliente.account.Logger.LogInfo("DOFUS", $"Ping: {cliente.GetPing()} ms");
}
}
6 changes: 3 additions & 3 deletions Comun/Frames/Juego/ChatFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public void get_Mensajes_Chat(TcpClient cliente, string paquete)
break;

case "F":
cliente.account.logger.log_privado("Message Reçu", separador[2] + ": " + separador[3]);
cliente.account.Logger.log_privado("Message Reçu", separador[2] + ": " + separador[3]);
break;

case "T":
cliente.account.logger.log_privado("Message Envoyé", separador[2] + ": " + separador[3]);
cliente.account.Logger.log_privado("Message Envoyé", separador[2] + ": " + separador[3]);
break;

default:
Expand All @@ -61,7 +61,7 @@ public void get_Mensajes_Chat(TcpClient cliente, string paquete)
}

if (!canal.Equals(string.Empty))
cliente.account.logger.log_normal(canal, separador[2] + ": " + separador[3]);
cliente.account.Logger.log_normal(canal, separador[2] + ": " + separador[3]);
}
}
}
Loading