mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-04-11 00:30:19 +02:00
Filter anormal positions and add position with scan
This commit is contained in:
@@ -15,6 +15,7 @@ import { GameZone, StartZone } from '@/components/game/MapLayers';
|
||||
// Contexts
|
||||
import { useTeam } from '@/contexts/teamContext';
|
||||
// Hooks
|
||||
import { useLocation } from '@/hooks/useLocation';
|
||||
import { useUserState } from '@/hooks/useUserState';
|
||||
// Services
|
||||
import { emitSendPosition } from '@/services/socket/emitters';
|
||||
@@ -25,6 +26,7 @@ const Play = () => {
|
||||
const { t } = useTranslation();
|
||||
const { teamInfos, nextZoneDate } = useTeam();
|
||||
const { locationSendDeadline, hasHandicap, enemyLocation, lastSentLocation } = teamInfos;
|
||||
const { location } = useLocation();
|
||||
const userState = useUserState();
|
||||
const [bottomContainerHeight, setBottomContainerHeight] = useState(0);
|
||||
|
||||
@@ -40,7 +42,7 @@ const Play = () => {
|
||||
</View>
|
||||
</Show>
|
||||
<View style={styles.mapContainer} onLayout={(event) => setBottomContainerHeight(event.nativeEvent.layout.height)}>
|
||||
<Map>
|
||||
<Map location={location}>
|
||||
<Show when={userState == USER_STATE.PLACEMENT}>
|
||||
<StartZone/>
|
||||
</Show>
|
||||
@@ -54,7 +56,7 @@ const Play = () => {
|
||||
</Map>
|
||||
<LinearGradient colors={['rgba(0,0,0,0.3)', 'rgba(0,0,0,0)']} style={styles.gradient}/>
|
||||
<Show when={userState == USER_STATE.PLAYING && !hasHandicap}>
|
||||
<IconButton style={styles.updatePosition} source={require("@/assets/images/update_position.png")} onPress={emitSendPosition} />
|
||||
<IconButton style={styles.updatePosition} source={require("@/assets/images/update_position.png")} onPress={() => location && emitSendPosition(location)} />
|
||||
</Show>
|
||||
<Toasts/>
|
||||
</View>
|
||||
|
||||
27659
mobile/traque-app/package-lock.json
generated
27659
mobile/traque-app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,6 @@
|
||||
"@react-native-async-storage/async-storage": "1.23.1",
|
||||
"@react-navigation/native": "^7.0.14",
|
||||
"@react-navigation/stack": "^7.1.1",
|
||||
"axxios": "^0.1.0",
|
||||
"babel-plugin-module-resolver": "^5.0.2",
|
||||
"expo": "~52.0.46",
|
||||
"expo-build-properties": "~0.13.3",
|
||||
|
||||
@@ -6,13 +6,10 @@ import MapView from 'react-native-maps';
|
||||
import { PositionMarker } from '@/components/common/Layers';
|
||||
import { IconButton } from '@/components/common/IconButton';
|
||||
import { Show } from '@/components/common/Show';
|
||||
// Hook
|
||||
import { useLocation } from '@/hooks/useLocation';
|
||||
// Util
|
||||
import { INITIAL_REGIONS } from '@/constants';
|
||||
|
||||
export const Map = ({ children }) => {
|
||||
const { location } = useLocation();
|
||||
export const Map = ({ location, children }) => {
|
||||
const [centerMap, setCenterMap] = useState(true);
|
||||
const mapRef = useRef(null);
|
||||
|
||||
|
||||
@@ -35,8 +35,8 @@ export const emitLogout = () => {
|
||||
return customEmit("logout");
|
||||
};
|
||||
|
||||
export const emitSendPosition = () => {
|
||||
return customEmit("send_position");
|
||||
export const emitSendPosition = (location) => {
|
||||
return customEmit("send_position", location);
|
||||
};
|
||||
|
||||
export const emitUpdatePosition = (location) => {
|
||||
|
||||
Reference in New Issue
Block a user