Skip to content

Commit

Permalink
Merge pull request #1653 from gettakaro/main-promotion
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele authored Oct 14, 2024
2 parents 6472799 + 5f24df4 commit d7c349f
Show file tree
Hide file tree
Showing 95 changed files with 1,866 additions and 4,281 deletions.
1 change: 1 addition & 0 deletions containers/generic-app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ENV TAKARO_VERSION=${TAKARO_VERSION}
ENV TAKARO_COMMIT=${TAKARO_COMMIT}
ENV TAKARO_BUILD_DATE=${TAKARO_BUILD_DATE}
ENV TAKARO_FULL_VERSION=${TAKARO_VERSION}-${TAKARO_COMMIT}-${TAKARO_BUILD_DATE}
ENV VITE_TAKARO_VERSION=${TAKARO_FULL_VERSION}

WORKDIR /app

Expand Down
2 changes: 2 additions & 0 deletions containers/generic-web/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ echo " VITE_API: \"$VITE_API\"," >>"$FILE_LOCATION"
echo " VITE_ORY_URL: \"$VITE_ORY_URL\"," >>"$FILE_LOCATION"
echo " VITE_POSTHOG_PUBLIC_API_KEY: \"$VITE_POSTHOG_PUBLIC_API_KEY\"," >>"$FILE_LOCATION"
echo " VITE_POSTHOG_API_URL: \"$VITE_POSTHOG_API_URL\"," >>"$FILE_LOCATION"
echo " VITE_TAKARO_VERSION: \"$VITE_TAKARO_VERSION\"," >>"$FILE_LOCATION"

echo "}" >>"$FILE_LOCATION"

nginx -g "daemon off;"
1 change: 1 addition & 0 deletions containers/takaro/dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ ENV TAKARO_VERSION=${TAKARO_VERSION}
ENV TAKARO_COMMIT=${TAKARO_COMMIT}
ENV TAKARO_BUILD_DATE=${TAKARO_BUILD_DATE}
ENV TAKARO_FULL_VERSION=${TAKARO_VERSION}-${TAKARO_COMMIT}-${TAKARO_BUILD_DATE}
ENV VITE_TAKARO_VERSION=${TAKARO_FULL_VERSION}

CMD ["npm", "run", "start:dev"]
8 changes: 4 additions & 4 deletions deploy/compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ services:
env_file:
- .env
environment:
POSTGRES_HOST: postgresql
POSTGRES_HOST: postgresql
takaro_connector:
image: ghcr.io/gettakaro/takaro-app-connector:latest
container_name: takaro_connector
environment:
REDIS_HOST: "redis"
TAKARO_SERVICE: "app-connector"
TAKARO_SERVICE: "app-connector"
TAKARO_HOST: http://takaro_api:3000
env_file:
- .env
- .env
restart: unless-stopped

takaro_web:
image: ghcr.io/gettakaro/takaro-web-main:latest
ports:
- 13001:80
- 13001:80
environment:
VITE_API: http://127.0.0.1:13000
VITE_ORY_URL: http://127.0.0.1:4433
Expand Down
3,470 changes: 39 additions & 3,431 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions packages/app-mock-gameserver/src/lib/gameserver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
IPosition,
HookEvents,
ChatChannel,
EventEntityKilled,
} from '@takaro/modules';
import { faker } from '@faker-js/faker';
import { config } from '../../config.js';
Expand Down Expand Up @@ -224,6 +225,21 @@ export class MockGameserver implements IMockGameServer {
output.success = true;
}

if (rawCommand.startsWith('triggerKill')) {
const [_, playerId] = rawCommand.split(' ');
const player = await this.getPlayer(new IPlayerReferenceDTO({ gameId: playerId }));
this.emitEvent(
GameEvents.ENTITY_KILLED,
new EventEntityKilled({
entity: 'zombie',
player,
weapon: 'knife',
}),
);
output.rawResult = `Triggered kill for player ${playerId}`;
output.success = true;
}

await this.sendLog(`${output.success ? '🟢' : '🔴'} Command executed: ${rawCommand}`);

return output;
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-apiclient/src/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Takaro app-api
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: development - 84bd9a7459a12a07d154f128124bdff7295ccdd6
* The version of the OpenAPI document: development - 5eeabec01e38f48bd1386a8c961671e8365f39dd
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-apiclient/src/generated/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Takaro app-api
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: development - 84bd9a7459a12a07d154f128124bdff7295ccdd6
* The version of the OpenAPI document: development - 5eeabec01e38f48bd1386a8c961671e8365f39dd
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-apiclient/src/generated/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Takaro app-api
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: development - 84bd9a7459a12a07d154f128124bdff7295ccdd6
* The version of the OpenAPI document: development - 5eeabec01e38f48bd1386a8c961671e8365f39dd
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-apiclient/src/generated/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Takaro app-api
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: development - 84bd9a7459a12a07d154f128124bdff7295ccdd6
* The version of the OpenAPI document: development - 5eeabec01e38f48bd1386a8c961671e8365f39dd
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
2 changes: 1 addition & 1 deletion packages/lib-apiclient/src/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Takaro app-api
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: development - 84bd9a7459a12a07d154f128124bdff7295ccdd6
* The version of the OpenAPI document: development - 5eeabec01e38f48bd1386a8c961671e8365f39dd
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default {
args: {
exclusive: true,
orientation: 'horizontal',
defaultValue: 'left',
fullWidth: false,
},
} as Meta<ToggleButtonGroupProps>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const ToggleButton = forwardRef<HTMLButtonElement, ToggleButtonProps>(fun
{ selected = false, disabled = false, onClick = undefined, value, parentClickEvent = () => {}, children, tooltip },
ref,
) {
const handleOnClick = () => {
const handleOnClick = (m: MouseEvent) => {
m.preventDefault();
m.stopPropagation();
if (disabled) return;
parentClickEvent(value);
if (onClick) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export const ToggleButtonGroup: FC<ToggleButtonGroupProps> & SubComponents = ({
const m = new Map<string, boolean>();
Children.forEach(children, (child) => {
if (isValidElement(child)) {
m.set(child.props.value, false);
console.log(child.props.value, defaultValue);
if (child.props.value === defaultValue) {
m.set(child.props.value, true);
} else {
m.set(child.props.value, false);
}
}
});
return m;
Expand All @@ -65,7 +70,16 @@ export const ToggleButtonGroup: FC<ToggleButtonGroupProps> & SubComponents = ({
}
return setSelected(value);
}
// handle case that each button has a seperate state

// In case there always has to be one value selected, the clicked value is true and there is currently only one value selected then we don't do anything
if (
!canSelectNone &&
(selected as Map<string, boolean>).get(value) === true &&
Array.from((selected as Map<string, boolean>).values()).filter(Boolean).length === 1
) {
return;
}

setSelected(new Map((selected as Map<string, boolean>).set(value, !(selected as Map<string, boolean>).get(value))));
};

Expand Down
Loading

0 comments on commit d7c349f

Please sign in to comment.