Closed plsfixrito closed 1 year ago
Please check the result returned from SendPacketAsync, it's possible it's an error and that could tell you more information. Have you called AddDefaultPackets
on IPacketTypesRepository
?
Also I am not sure whether something should happen, I have never tried sending Ptctl packet directly, doesn't that work similar to walk? ie. you will not see the change on your client. I have seen your issue on the Local repository so it looks like you know about PetWalkCommand, use that. PetWalkCommand calls functions from memory directly and is similar to clicking on the map.
This packet is sent when moving pets from client to server. It should move the pet or partner when called.
I already added these services
BindingManager = Service.GetRequiredService<NosBindingManager>();
var logger = Service.GetRequiredService<ILogger<Sandbox>>();
var initializeResult = BindingManager.Initialize();
if (!initializeResult.IsSuccess)
{
logger.LogError($"Could not initialize NosBindingManager.");
logger.LogResultError(initializeResult);
}
var packetTypesRepository = Service.GetRequiredService<IPacketTypesRepository>();
var packetAddResult = packetTypesRepository.AddDefaultPackets();
if (!packetAddResult.IsSuccess)
{
logger.LogError("Could not initialize default packet serializers correctly");
logger.LogResultError(packetAddResult);
}
DataService = Service.GetRequiredService<NostaleDataFilesManager>();
var dataResult = DataService.Initialize();
if (!dataResult.IsSuccess)
{
logger.LogError("Could not initialize the nostale data files");
logger.LogResultError(dataResult);
}
Please check the result returned from SendPacketAsync, it's possible it's an error and that could tell you more information. Have you called
AddDefaultPackets
onIPacketTypesRepository
?
SendPacketAsync returns success when sending the packet. Also after checking the packet again it seems to have missing arguments. I will add a pull request correcting the packet.
Do you mean that it does nothing from point of view of the client sending it? I have tried it with packet logger and it indeed does nothing, but that is because the client just does not handle that. From view of others the mates move. To see the mates move, PetWalkCommand
has to be used.
If you really needed this, one thing that comes to mind is, you could teleport the mates for the client to the destination by receiving TpPacket
, but that is not gonna show you animation of them moving and the timing will be wrong for your client.
Also be aware that implementing walking through this packet yourself may be tricky. At least if you want the packet to work the same as it does from the client. If you walk somewhere with the pets with client, ptctl is sent every ~2 blocks (that number depends on the speed), not directly to the target position. The client can handle all this itself using PetWalkCommand
.
Code example