mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-14 19:51:29 +00:00
Merge branch 'master' of github.com:EQEmu/Server into wp
This commit is contained in:
commit
077ba02004
@ -290,7 +290,7 @@ RULE_BOOL(Pathing, AggroReturnToGrid, true) // Enable pathing for aggroed roamin
|
||||
RULE_BOOL(Pathing, Guard, true) // Enable pathing for mobs moving to their guard point.
|
||||
RULE_BOOL(Pathing, Find, true) // Enable pathing for FindPerson requests from the client.
|
||||
RULE_BOOL(Pathing, Fear, true) // Enable pathing for fear
|
||||
RULE_REAL(Pathing, ZDiffThreshold, 10) // If a mob las LOS to it's target, it will run to it if the Z difference is < this.
|
||||
RULE_REAL(Pathing, ZDiffThresholdNew, 80) // If a mob las LOS to it's target, it will run to it if the Z difference is < this.
|
||||
RULE_INT(Pathing, LOSCheckFrequency, 1000) // A mob will check for LOS to it's target this often (milliseconds).
|
||||
RULE_INT(Pathing, RouteUpdateFrequencyShort, 1000) // How often a new route will be calculated if the target has moved.
|
||||
RULE_INT(Pathing, RouteUpdateFrequencyLong, 5000) // How often a new route will be calculated if the target has moved.
|
||||
|
||||
@ -201,7 +201,7 @@ sub new_server {
|
||||
}
|
||||
closedir(DIR);
|
||||
|
||||
if($file_count > 1 && (!-e "install_variables.txt" && !-e "../install_variables.txt")){
|
||||
if($file_count > 4 && (!-e "install_variables.txt" && !-e "../install_variables.txt")){
|
||||
print "[New Server] ERROR: You must run eqemu_server.pl in an empty directory\n";
|
||||
<>;
|
||||
exit;
|
||||
@ -281,6 +281,8 @@ sub new_server {
|
||||
|
||||
show_install_summary_info();
|
||||
|
||||
rmtree('updates_staged');
|
||||
|
||||
return;
|
||||
}
|
||||
else {
|
||||
@ -1505,12 +1507,12 @@ sub map_files_fetch{
|
||||
}
|
||||
|
||||
sub quest_files_fetch{
|
||||
if (!-e "updates_staged/Quests-Plugins-master/quests/") {
|
||||
if (!-e "updates_staged/projecteqquests-master/") {
|
||||
print "[Update] Fetching Latest Quests --- \n";
|
||||
get_remote_file("https://github.com/EQEmu/Quests-Plugins/archive/master.zip", "updates_staged/Quests-Plugins-master.zip", 1);
|
||||
get_remote_file("https://codeload.github.com/ProjectEQ/projecteqquests/zip/master", "updates_staged/projecteqquests-master.zip", 1);
|
||||
print "[Install] Fetched latest quests...\n";
|
||||
mkdir('updates_staged');
|
||||
unzip('updates_staged/Quests-Plugins-master.zip', 'updates_staged/');
|
||||
unzip('updates_staged/projecteqquests-master.zip', 'updates_staged/');
|
||||
}
|
||||
|
||||
$fc = 0;
|
||||
@ -1518,7 +1520,7 @@ sub quest_files_fetch{
|
||||
use File::Compare;
|
||||
|
||||
my @files;
|
||||
my $start_dir = "updates_staged/Quests-Plugins-master/quests/";
|
||||
my $start_dir = "updates_staged/projecteqquests-master/";
|
||||
find(
|
||||
sub { push @files, $File::Find::name unless -d; },
|
||||
$start_dir
|
||||
@ -1527,7 +1529,7 @@ sub quest_files_fetch{
|
||||
if($file=~/\.pl|\.lua|\.ext/i){
|
||||
$staged_file = $file;
|
||||
$destination_file = $file;
|
||||
$destination_file =~s/updates_staged\/Quests-Plugins-master\///g;
|
||||
$destination_file =~s/updates_staged\/projecteqquests-master\//quests\//g;
|
||||
|
||||
if (!-e $destination_file) {
|
||||
copy_file($staged_file, $destination_file);
|
||||
@ -1557,27 +1559,28 @@ sub quest_files_fetch{
|
||||
}
|
||||
}
|
||||
|
||||
rmtree('updates_staged');
|
||||
|
||||
if($fc == 0){
|
||||
print "[Update] No Quest Updates found... \n\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub lua_modules_fetch {
|
||||
if (!-e "updates_staged/Quests-Plugins-master/quests/lua_modules/") {
|
||||
print "[Update] Fetching Latest LUA Modules --- \n";
|
||||
get_remote_file("https://github.com/EQEmu/Quests-Plugins/archive/master.zip", "updates_staged/Quests-Plugins-master.zip", 1);
|
||||
print "[Update] Fetched latest LUA Modules...\n";
|
||||
unzip('updates_staged/Quests-Plugins-master.zip', 'updates_staged/');
|
||||
if (!-e "updates_staged/projecteqquests-master/") {
|
||||
print "[Update] Fetching Latest lua modules --- \n";
|
||||
get_remote_file("https://codeload.github.com/ProjectEQ/projecteqquests/zip/master", "updates_staged/projecteqquests-master.zip", 1);
|
||||
print "[Install] Fetched latest lua modules...\n";
|
||||
mkdir('updates_staged');
|
||||
unzip('updates_staged/projecteqquests-master.zip', 'updates_staged/');
|
||||
}
|
||||
|
||||
$fc = 0;
|
||||
use File::Find;
|
||||
use File::Compare;
|
||||
|
||||
mkdir('lua_modules');
|
||||
|
||||
my @files;
|
||||
my $start_dir = "updates_staged/Quests-Plugins-master/quests/lua_modules/";
|
||||
my $start_dir = "updates_staged/projecteqquests-master/lua_modules/";
|
||||
find(
|
||||
sub { push @files, $File::Find::name unless -d; },
|
||||
$start_dir
|
||||
@ -1586,7 +1589,7 @@ sub lua_modules_fetch {
|
||||
if($file=~/\.pl|\.lua|\.ext/i){
|
||||
$staged_file = $file;
|
||||
$destination_file = $file;
|
||||
$destination_file =~s/updates_staged\/Quests-Plugins-master\/quests\///g;
|
||||
$destination_file =~s/updates_staged\/projecteqquests-master\/lua_modules\//lua_modules\//g;
|
||||
|
||||
if (!-e $destination_file) {
|
||||
copy_file($staged_file, $destination_file);
|
||||
@ -1621,19 +1624,22 @@ sub lua_modules_fetch {
|
||||
}
|
||||
|
||||
sub plugins_fetch{
|
||||
if (!-e "updates_staged/Quests-Plugins-master/plugins/") {
|
||||
print "[Update] Fetching Latest Plugins\n";
|
||||
get_remote_file("https://github.com/EQEmu/Quests-Plugins/archive/master.zip", "updates_staged/Quests-Plugins-master.zip", 1);
|
||||
print "[Update] Fetched latest plugins\n";
|
||||
unzip('updates_staged/Quests-Plugins-master.zip', 'updates_staged/');
|
||||
if (!-e "updates_staged/projecteqquests-master/") {
|
||||
print "[Update] Fetching Latest plugins --- \n";
|
||||
get_remote_file("https://codeload.github.com/ProjectEQ/projecteqquests/zip/master", "updates_staged/projecteqquests-master.zip", 1);
|
||||
print "[Install] Fetched latest plugins...\n";
|
||||
mkdir('updates_staged');
|
||||
unzip('updates_staged/projecteqquests-master.zip', 'updates_staged/');
|
||||
}
|
||||
|
||||
$fc = 0;
|
||||
use File::Find;
|
||||
use File::Compare;
|
||||
|
||||
mkdir('plugins');
|
||||
|
||||
my @files;
|
||||
my $start_dir = "updates_staged/Quests-Plugins-master/plugins/";
|
||||
my $start_dir = "updates_staged/projecteqquests-master/plugins/";
|
||||
find(
|
||||
sub { push @files, $File::Find::name unless -d; },
|
||||
$start_dir
|
||||
@ -1642,7 +1648,7 @@ sub plugins_fetch{
|
||||
if($file=~/\.pl|\.lua|\.ext/i){
|
||||
$staged_file = $file;
|
||||
$destination_file = $file;
|
||||
$destination_file =~s/updates_staged\/Quests-Plugins-master\///g;
|
||||
$destination_file =~s/updates_staged\/projecteqquests-master\///g;
|
||||
|
||||
if (!-e $destination_file) {
|
||||
copy_file($staged_file, $destination_file);
|
||||
@ -2173,4 +2179,4 @@ sub generate_random_password {
|
||||
map $alphanumeric[rand @alphanumeric], 0..$passwordsize;
|
||||
|
||||
return $randpassword;
|
||||
}
|
||||
}
|
||||
@ -4599,14 +4599,14 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
float new_heading = EQ19toFloat(ppu->heading);
|
||||
int32 new_animation = ppu->animation;
|
||||
|
||||
/* Update internal server position from what the client has sent */
|
||||
m_Position.x = ppu->x_pos;
|
||||
m_Position.y = ppu->y_pos;
|
||||
m_Position.z = ppu->z_pos;
|
||||
m_Position.w = EQ19toFloat(ppu->heading);
|
||||
|
||||
animation = ppu->animation;
|
||||
|
||||
/* Visual Debugging */
|
||||
if (RuleB(Character, OPClientUpdateVisualDebug)) {
|
||||
Log(Logs::General, Logs::Debug, "ClientUpdate: ppu x: %f y: %f z: %f h: %u", ppu->x_pos, ppu->y_pos, ppu->z_pos, ppu->heading);
|
||||
@ -4615,7 +4615,10 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app)
|
||||
}
|
||||
|
||||
/* Only feed real time updates when client is moving */
|
||||
if (is_client_moving) {
|
||||
if (is_client_moving || new_heading != m_Position.w || new_animation != animation) {
|
||||
|
||||
animation = ppu->animation;
|
||||
m_Position.w = EQ19toFloat(ppu->heading);
|
||||
|
||||
/* Broadcast update to other clients */
|
||||
auto outapp = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
|
||||
|
||||
@ -752,7 +752,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
|
||||
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||
|
||||
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
@ -844,7 +844,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
|
||||
Log(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance);
|
||||
|
||||
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
else
|
||||
@ -881,7 +881,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
|
||||
float Distance = VectorDistanceNoRoot(From, To);
|
||||
|
||||
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) &&
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
|
||||
Log(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance);
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||
PathingLOSState = HaveLOS;
|
||||
@ -1032,7 +1032,7 @@ glm::vec3 Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool &Wa
|
||||
float Distance = VectorDistanceNoRoot(From, To);
|
||||
|
||||
if ((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) &&
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) {
|
||||
(std::abs(From.z - To.z) <= RuleR(Pathing, ZDiffThresholdNew))) {
|
||||
Log(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance);
|
||||
|
||||
if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr))
|
||||
@ -1136,7 +1136,7 @@ bool PathManager::NoHazards(glm::vec3 From, glm::vec3 To)
|
||||
|
||||
float NewZ = zone->zonemap->FindBestZ(MidPoint, nullptr);
|
||||
|
||||
if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) {
|
||||
if (std::abs(NewZ - From.z) > RuleR(Pathing, ZDiffThresholdNew)) {
|
||||
Log(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f",
|
||||
From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z);
|
||||
|
||||
@ -1208,7 +1208,7 @@ bool PathManager::NoHazardsAccurate(glm::vec3 From, glm::vec3 To)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) {
|
||||
if (std::abs(NewZ - best_z2) > RuleR(Pathing, ZDiffThresholdNew)) {
|
||||
Log(Logs::Detail, Logs::None,
|
||||
" HAZARD DETECTED, water is fairly deep at %8.3f units deep",
|
||||
std::abs(NewZ - best_z2));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user