Skip to content

Commit

Permalink
#2379 Map comments can now properly be assigned to pulls directly again.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wotuu committed May 17, 2024
1 parent 2c02847 commit d178cca
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
7 changes: 4 additions & 3 deletions app/Console/Commands/Traits/ConvertsMDTStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ private function transform(bool $encode, string $string): ?string
if ($fileName !== null) {
$cmd = sprintf($encode ? self::$CLI_PARSER_ENCODE_CMD : self::$CLI_PARSER_DECODE_CMD, $fileName);
// Performing sudo on local environment causes issues - but we're already root then
if (config('app.type') !== 'local') {
$cmd = sprintf('%s %s', self::$SUDO, $cmd);
}
// ^ okay what issues then genius? It works fine locally
// if (config('app.type') !== 'local') {
$cmd = sprintf('%s %s', self::$SUDO, $cmd);
// }

$process = new Process(explode(' ', $cmd));
$process->run();
Expand Down
24 changes: 13 additions & 11 deletions app/Service/MDT/MDTImportStringService.php
Original file line number Diff line number Diff line change
Expand Up @@ -796,19 +796,20 @@ private function parseObjectComment(
$mappingVersion,
$latLng
);
}

if ($latLng->getFloor()->facade) {
$this->log->parseObjectCommentAfterConversionFloorStillOnFacade($latLng->toArrayWithFloor());
// @TODO this needs to be put everywhere in this class in a generic function of sorts, no time now
if ($latLng->getFloor()->facade) {
$this->log->parseObjectCommentAfterConversionFloorStillOnFacade($latLng->toArrayWithFloor());

$importStringObjects->getWarnings()->push(
new ImportWarning(
__('logic.mdt.io.import_string.category.object'),
__('logic.mdt.io.import_string.object_out_of_bounds', ['comment' => (string)$details['4']])
)
);
$importStringObjects->getWarnings()->push(
new ImportWarning(
__('logic.mdt.io.import_string.category.object'),
__('logic.mdt.io.import_string.object_out_of_bounds', ['comment' => (string)$details['4']])
)
);

return;
return;
}
}

$ingameXY = $this->coordinatesService->calculateIngameLocationForMapLocation($latLng);
Expand All @@ -817,8 +818,9 @@ private function parseObjectComment(
foreach ($importStringObjects->getKillZoneAttributes() as $killZoneIndex => $killZoneAttribute) {
foreach ($killZoneAttribute['killZoneEnemies'] as $killZoneEnemy) {
$enemyIngameXY = $this->coordinatesService->calculateIngameLocationForMapLocation(
new LatLng($killZoneEnemy['enemy']->lat, $killZoneEnemy['enemy']->lng, $floor)
new LatLng($killZoneEnemy['enemy']->lat, $killZoneEnemy['enemy']->lng, $latLng->getFloor())
);

if ($this->coordinatesService->distanceBetweenPoints(
$enemyIngameXY->getX(), $ingameXY->getX(),
$enemyIngameXY->getY(), $ingameXY->getY()
Expand Down
7 changes: 3 additions & 4 deletions docker-compose/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ RUN apt-get update && apt-get install -y libssl-dev && \
RUN /root/.cargo/bin/cargo install --git https://github.com/Zireael-N/cli-weakauras-parser.git && \
ln -s ~/.cargo/bin/cli_weakauras_parser /usr/bin/cli_weakauras_parser

# Give the www-data user rights to execute cli weakauras parser as sudo
RUN echo "www-data ALL=NOPASSWD: /usr/bin/cli_weakauras_parser" >> /etc/sudoers

# Install actual LUA language
RUN apt-get update && apt-get install -y lua5.3 liblua5.3 && \
ln -s /usr/include/lua5.3/ /usr/include/lua && \
Expand Down Expand Up @@ -112,7 +109,9 @@ RUN unzip /tmp/LuaBitOp-1.0.3.zip -d /tmp && \
cp bit.so /usr/lib/lua/5.3/

# Setup files/folders
COPY etc/crontab /etc/crontab
COPY etc/ /etc/

RUN chmod -R 440 /etc/sudoers.d/

COPY var/ /var/

Expand Down
2 changes: 2 additions & 0 deletions docker-compose/app/etc/sudoers.d/cli_weakauras_parser
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
www-data ALL=(ALL) NOPASSWD: /usr/bin/cli_weakauras_parser
www-data ALL=(ALL) NOPASSWD: /root/.cargo/bin/cli_weakauras_parser

0 comments on commit d178cca

Please sign in to comment.