Skip to content

Commit

Permalink
imporve
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Dec 19, 2024
1 parent 1bb37cd commit c6e5221
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ VITE_PUBLIC_WORLD_ADDRESS="0x5013b17c43a2b664ec2a38aa45f6d891db1188622ec7cf32041
VITE_PUBLIC_ACCOUNT_CLASS_HASH="0x07dc7899aa655b0aae51eadff6d801a58e97dd99cf4666ee59e704249e51adf2"
VITE_PUBLIC_FEE_TOKEN_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7

VITE_PUBLIC_TORII=https://api.cartridge.gg/x/eternum-mainnet/torii
VITE_PUBLIC_TORII=https://api.cartridge.gg/x/eternum-prod/torii
VITE_PUBLIC_NODE_URL=https://api.cartridge.gg/x/starknet/mainnet
VITE_PUBLIC_DEV=false
VITE_PUBLIC_GAME_VERSION="v1.0.0"
VITE_PUBLIC_SHOW_FPS=false
VITE_PUBLIC_GRAPHICS_DEV=false
VITE_PUBLIC_TORII_RELAY=/dns4/api.cartridge.gg/tcp/443/x-parity-wss/%2Fx%2Feternum-mainnet%2Ftorii%2Fwss
VITE_PUBLIC_TORII_RELAY=/dns4/api.cartridge.gg/tcp/443/x-parity-wss/%2Fx%2Feternum-prod%2Ftorii%2Fwss

VITE_SEASON_PASS_ADDRESS=0x057675b9c0bd62b096a2e15502a37b290fa766ead21c33eda42993e48a714b80
VITE_REALMS_ADDRESS=0x07ae27a31bb6526e3de9cf02f081f6ce0615ac12a6d7b85ee58b8ad7947a2809
Expand All @@ -19,7 +19,7 @@ VITE_LORDS_ADDRESS=0x0124aeb495b947201f5fac96fd1138e326ad86195b98df6dec9009158a5
VITE_SOCIAL_LINK=http://bit.ly/3Zz1mpp

VITE_PUBLIC_CHAIN=mainnet
VITE_PUBLIC_SLOT=eternum-mainnet
VITE_PUBLIC_SLOT=eternum-prod

VITE_PUBLIC_CONSTRUCTION_FLAG=true
VITE_PUBLIC_HIDE_THREEJS_MENU=false
Expand Down
2 changes: 2 additions & 0 deletions client/src/dojo/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export const addToSubscription = async <S extends Schema>(
position?: { x: number; y: number }[],
) => {
const start = performance.now();

console.log("AddToSubscriptionStart", entityID);
await getEntities(
client,
{
Expand Down
1 change: 1 addition & 0 deletions client/src/ui/components/resources/InventoryResources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const InventoryResources = ({

setIsSyncing(true);
try {
console.log("AddToSubscriptionStart - 4");
await addToSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any, [
entityId.toString(),
]);
Expand Down
1 change: 1 addition & 0 deletions client/src/ui/components/trading/ResourceArrivals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const AllResourceArrivals = memo(
addToSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any, unsubscribedIds).catch(
(error) => console.error("Fetch failed", error),
);
console.log("AddToSubscriptionStart - 5");
}, [arrivals, subscribedIds]);

return (
Expand Down
5 changes: 4 additions & 1 deletion client/src/ui/layouts/World.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const World = ({ backgroundImage }: { backgroundImage: string }) => {
}));

const fetch = async () => {
console.log("AddToSubscriptionStart - 1");
try {
await Promise.all([
addToSubscription(
Expand All @@ -162,6 +163,7 @@ export const World = ({ backgroundImage }: { backgroundImage: string }) => {
useEffect(() => {
try {
setWorldLoading(true);
console.log("AddToSubscriptionStart - 2");
addToSubscription(
dojo.network.toriiClient,
dojo.network.contractComponents as any,
Expand All @@ -176,11 +178,12 @@ export const World = ({ backgroundImage }: { backgroundImage: string }) => {
} finally {
setWorldLoading(false);
}
}, [filteredStructures]);
}, [structures.length]);

useEffect(() => {
try {
setMarketLoading(true);
console.log("AddToSubscriptionStart - 3");
addToSubscription(dojo.network.toriiClient, dojo.network.contractComponents as any, [
ADMIN_BANK_ENTITY_ID.toString(),
]);
Expand Down
3 changes: 1 addition & 2 deletions client/src/ui/modules/navigation/TopLeftNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const TopLeftNavigation = memo(() => {
isFavorite: favorites.includes(structure.entity_id),
}))
.sort((a, b) => Number(b.isFavorite) - Number(a.isFavorite));
}, [favorites, structures]);
}, [favorites, structures.length]);

const toggleFavorite = useCallback((entityId: number) => {
setFavorites((prev) => {
Expand Down Expand Up @@ -179,7 +179,6 @@ export const TopLeftNavigation = memo(() => {
return { timeLeftBeforeNextTick: timeLeft, progress: progressValue };
}, [nextBlockTimestamp]);

console.log(entityInfo.structureCategory);
return (
<div className="pointer-events-auto w-screen flex justify-between md:pl-2">
<motion.div
Expand Down

0 comments on commit c6e5221

Please sign in to comment.