Задать вопрос
  • Как сделать шутер на Unity с SignalR?

    Timur2342
    @Timur2342 Автор вопроса
    Хорошо, на счет velocity спасибо, что то даже не подумал про него. Все же не понятно как коллизию на сервере считывать (на клиенте не вариант).

    Придумал лишь сделать что то вроде проверка коллизии, то есть просто берешь хитбокс игрока и сохраняешь на сервере, потом проверяешь не соприкосается ли с другими ближшайшими позицией, то есть тут не проверка коллизии, а скорее позиции физичестких тел
    Написано
  • Как сделать шутер на Unity с SignalR?

    Timur2342
    @Timur2342 Автор вопроса
    Допустим я выберу 1-й метод, он куда лучше за счет того что более безопасен от читеров, хотя и сложнее. Как мнереализовать на сервере физику как в Unity? Вобще сама ситуация что я использую ту же физику только на сервере глупая.
    Написано
  • Почему я получаю ObjectDisposedException из за DbContext-а? Когда он очищается?

    Timur2342
    @Timur2342 Автор вопроса
    Господи! Спасибо что уделили время и хорошо описали решение. Спасибо вам огромное!!! Очень помогли)
    Написано
  • Почему я получаю ObjectDisposedException из за DbContext-а? Когда он очищается?

    Timur2342
    @Timur2342 Автор вопроса
    Logs
    [21:49:20 ERR] Unable to notify JobListener(s) of Job that was executed: (error will be ignored). trigger= DEFAULT.trigger-1991679462522066852 job= DEFAULT.job-1991679462522066852
    Quartz.SchedulerException: JobListener 'job-listener-1991679462522066852' threw exception: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
    Object name: 'MainContext'.
    ---> System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
    Object name: 'MainContext'.
    at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
    at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
    at Microsoft.EntityFrameworkCore.DbContext.get_Model()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.CheckState()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, Expression expression, CancellationToken cancellationToken)
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, LambdaExpression expression, CancellationToken cancellationToken)
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.FirstOrDefaultAsync[TSource](IQueryable`1 source, Expression`1 predicate, CancellationToken cancellationToken)
    at NotificationService.Infrastructure.Services.TaskService.StatusUpdate(Int64 id, TaskStatus newStatus, Boolean wasCompleted, Nullable`1 filter) in /home/timur/Desktop/NotificationService/NotificationService.Infrastructure/Services/TaskService.cs:line 127
    at NotificationService.Infrastructure.Services.TaskService.HasBeenSuccesfullyWorked(Int64 id) in /home/timur/Desktop/NotificationService/NotificationService.Infrastructure/Services/TaskService.cs:line 94
    at NotificationService.Application.BackgroundJobs.Listeners.EmailSenderListener.JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException, CancellationToken cancellationToken) in /home/timur/Desktop/NotificationService/NotificationService.Application/BackgroundJobs/Listeners/EmailSenderListener.cs:line 64
    at Quartz.Core.QuartzScheduler.g__NotifySingle|151_1(Task t, IJobListener jl)
    --- End of inner exception stack trace ---
    at Quartz.Core.QuartzScheduler.g__NotifySingle|151_1(Task t, IJobListener jl)
    at Quartz.Core.QuartzScheduler.<>c__DisplayClass151_0.<g__NotifyAwaited|0>d.MoveNext()
    --- End of stack trace from previous location ---
    at Quartz.Core.JobRunShell.NotifyJobListenersComplete(IJobExecutionContext ctx, JobExecutionException jobExEx, CancellationToken cancellationToken) [See nested exception: System.ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances.
    Object name: 'MainContext'.
    at Microsoft.EntityFrameworkCore.DbContext.CheckDisposed()
    at Microsoft.EntityFrameworkCore.DbContext.get_ContextServices()
    at Microsoft.EntityFrameworkCore.DbContext.get_Model()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityType()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.CheckState()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.get_EntityQueryable()
    at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1.System.Linq.IQueryable.get_Provider()
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, Expression expression, CancellationToken cancellationToken)
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ExecuteAsync[TSource,TResult](MethodInfo operatorMethodInfo, IQueryable`1 source, LambdaExpression expression, CancellationToken cancellationToken)
    at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.FirstOrDefaultAsync[TSource](IQueryable`1 source, Expression`1 predicate, CancellationToken cancellationToken)
    at NotificationService.Infrastructure.Services.TaskService.StatusUpdate(Int64 id, TaskStatus newStatus, Boolean wasCompleted, Nullable`1 filter) in /home/timur/Desktop/NotificationService/NotificationService.Infrastructure/Services/TaskService.cs:line 127
    at NotificationService.Infrastructure.Services.TaskService.HasBeenSuccesfullyWorked(Int64 id) in /home/timur/Desktop/NotificationService/NotificationService.Infrastructure/Services/TaskService.cs:line 94
    at NotificationService.Application.BackgroundJobs.Listeners.EmailSenderListener.JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException, CancellationToken cancellationToken) in /home/timur/Desktop/NotificationService/NotificationService.Application/BackgroundJobs/Listeners/EmailSenderListener.cs:line 64
    at Quartz.Core.QuartzScheduler.g__NotifySingle|151_1(Task t, IJobListener jl)]
    Написано
  • Какие книги посоветуете для изучение того как работает поисковая система?

    Timur2342
    @Timur2342 Автор вопроса
    Так я и попросил РЕКОМЕНДАЦИИ, нет?
    На счёт браузера да кстати, тот же duckduck как пример, вопрос изменил
    Написано
  • Как создать свой pet project?

    Timur2342
    @Timur2342
    На счёт архитектуры, можешь используй DDD, то есть дели архитектуру приложения на Domain, Application, Infrastructure и Presentation. Пример проекта с хорошей архитектурой
    Написано
  • Почему сервер не может подключиться к Postgres внутри контейнера?

    Timur2342
    @Timur2342 Автор вопроса
    Поменял на Server=postgresdb;
    Теперь получаю System.Net.Sockets.SocketException (00000005, 0xFFFDFFFF): Name or service not known

    Но все же понял, спасибо
    Написано
  • Почему сервер не может подключиться к Postgres внутри контейнера?

    Timur2342
    @Timur2342 Автор вопроса
    Я же указал сеть благодаря которой они могут общаться:
    networks:
    dev:

    Сейчас попробывал с
    networks:
    dev:
    driver: bridge

    Ничего не изменилось
    Написано
  • Почему сервер не может подключиться к Postgres внутри контейнера?

    Timur2342
    @Timur2342 Автор вопроса
    Да внутри, полный docker-compose.yml:
    version: '3.9'
    
    networks:
      dev:
    
    services:
      #Nginx
      proxy:
        image: nginx:stable-alpine
        ports:
          - "80:80"
        volumes:
          - './nginx.conf:/etc/nginx/nginx.conf'
        depends_on:
          - server_app
          - client_app
        networks:
          - dev
      
      # ASP.NET Core application
      server_app:
        build:
          context: ./server_app
          dockerfile: Dockerfile
        ports:
          - "5183:5183"
        depends_on:
          - redis
          - mongodb
          - postgres
        environment:
          - ASPNETCORE_ENVIRONMENT=Development
          - ASPNETCORE_HTTP_PORTS=5183
        networks:
          - dev
    
        #for windows: $APPDATA/Microsoft/UserSecrets/$USER_SECRETS_ID:/root/.microsoft/usersecrets/$USER_SECRETS_ 
        volumes:
          - /home/timur/.microsoft/usersecrets/bd1f8802-13a0-4b5f-891d-3be2cef1574c:/root/.microsoft/usersecrets/bd1f8802-13a0-4b5f-891d-3be2cef1574c
      
      
      # React application
      client_app:
        build:
          context: ./client_app
          dockerfile: Dockerfile
        ports:
          - "3000:3000"
        networks:
          - dev
    
      # Redis
      redis:
        image: redis:7.2.5
        ports:
          - "6370:6370"
        networks:
          - dev 
    
      # MongoDB
      mongodb:
        image: mongo:8.0.4
        ports:
          - "27010:27010"
        networks:
          - dev
    
      # PostgreSQL
      postgres:
        image: postgres:latest
        restart: always
        environment:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: nigPostgres_Pas5432
          POSTGRES_DB: marketplacedb
        ports:
          - '5432:5432'
        networks:
          - dev
    Написано
  • (Linux Manjaro)Как удалить иконку из меню пуск?

    Timur2342
    @Timur2342
    То же самое было, только на арче, как то само потом исчезло. И на счёт файлов, ты удалил в Desktop папке файл-ярлык(вроде .desktop расширение, и ещё могут быть в ~/.local/Application)?
    Написано
  • Как написать Dockerfile для asp.net приложения с такой архитектурой?

    Timur2342
    @Timur2342 Автор вопроса
    => ERROR [server_app build 9/9] RUN dotnet publish server_app.Presentation/server_app.Presentation.csproj -c Development -o /publish 4.3s
    ------
    > [server_app build 9/9] RUN dotnet publish server_app.Presentation/server_app.Presentation.csproj -c Development -o /publish:
    0.588 Determining projects to restore...
    2.482 Restored /app/server_app.Infrastructure/server_app.Infrastructure.csproj (in 1.32 sec).
    2.482 Restored /app/server_app.Domain/server_app.Domain.csproj (in 1.32 sec).
    2.482 Restored /app/server_app.Application/server_app.Application.csproj (in 1.32 sec).
    2.482 Restored /app/server_app.Presentation/server_app.Presentation.csproj (in 1.32 sec).
    3.118 /usr/share/dotnet/sdk/8.0.404/Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Http.Abstractions". Check to make sure the assemblyexists on disk. If this reference is required by your code, you may get compilation errors. [/app/server_app.Domain/server_app.Domain.csproj]
    3.118 /usr/share/dotnet/sdk/8.0.404/Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Http.Features". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/app/server_app.Domain/server_app.Domain.csproj]
    3.118 /usr/share/dotnet/sdk/8.0.404/Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Mvc.Abstractions". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/app/server_app.Domain/server_app.Domain.csproj]
    3.118 /usr/share/dotnet/sdk/8.0.404/Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Mvc.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/app/server_app.Domain/server_app.Domain.csproj]
    3.118 /usr/share/dotnet/sdk/8.0.404/Microsoft.Common.CurrentVersion.targets(2412,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.IdentityModel.Tokens". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Dtos/ProductCategoryCreateDto.cs(2,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Options/JwtOptions.cs(4,17): error CS0234: The type or namespace name 'IdentityModel' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Queries/ProductCategoryCreateQuery.cs(3,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/SavedFile.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Options/JwtOptions.cs(19,12): error CS0246: The type or namespace name 'SymmetricSecurityKey' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Dtos/ProductCategoryCreateDto.cs(24,28): error CS0246: The type or namespace name 'IFormFile' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Options/JwtOptions.cs(28,12): error CS0246: The type or namespace name 'RsaSecurityKey' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(28,12): error CS0246: The type or namespace name 'IActionResult' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(15,36): error CS0246: The type or namespace name 'IActionResult' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(21,36): error CS0246: The type or namespace name 'IActionResult' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/SavedFile.cs(5,24): error CS0246: The type or namespace name 'IFormFile' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(49,31): error CS0246: The type or namespace name 'StatusCodeResult' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(50,41): error CS0246: The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/SavedFile.cs(7,12): error CS0246: The type or namespace name 'IFormFile' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Queries/ProductCategoryCreateQuery.cs(12,18): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Queries/ProductCategoryCreateQuery.cs(22,28): error CS0246: The type or namespace name 'IFormFile' could not be found (are you missing a using directive or an assembly reference?) [/app/server_app.Domain/server_app.Domain.csproj]
    4.272 /app/server_app.Domain/Model/Result.cs(48,34): error CS1750: A value of type '' cannot be used as a default parameter because there are no standard conversions to type 'ActionResultWithObjectT' [/app/server_app.Domain/server_app[+] Running 0/1
    ⠼ Service server_app Building 4.4s
    failed to solve: process "/bin/sh -c dotnet publish server_app.Presentation/server_app.Presentation.csproj -c Development -o /publish" did not complete successfully: exit code: 1
    Написано
  • Как написать Dockerfile для asp.net приложения с такой архитектурой?

    Timur2342
    @Timur2342 Автор вопроса
    $docker-compose up

    WARN[0000] /home/timur/Desktop/Marketplace/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion
    [+] Running 0/10s (0/1) docker:default
    [+] Building 3.8s (15/17) docker:default
    [+] Building 4.4s (16/17) docker:default
    => [server_app internal] load build definition from Dockerfile 0.0s
    => => transferring dockerfile: 1.05kB 0.0s
    => WARN: UndefinedVar: Usage of undefined variable '$ENVIRONMENT' (line 32) 0.0s
    => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 32) 0.0s
    => [server_app internal] load metadata for mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
    => [server_app internal] load metadata for mcr.microsoft.com/dotnet/sdk:8.0 0.0s
    => [server_app internal] load .dockerignore 0.0s
    => => transferring context: 2B 0.0s
    => [server_app runtime 1/3] FROM mcr.microsoft.com/dotnet/aspnet:8.0 0.0s
    => [server_app build 1/9] FROM mcr.microsoft.com/dotnet/sdk:8.0 0.0s
    => [server_app internal] load build context 0.0s
    => => transferring context: 219.56kB 0.0s
    => CACHED [server_app runtime 2/3] WORKDIR /app 0.0s
    => CACHED [server_app build 2/9] WORKDIR /app 0.0s
    => CACHED [server_app build 3/9] COPY [server_app.Presentation/server_app.Presentation.csproj, server_app.Presentation/] 0.0s
    => CACHED [server_app build 4/9] COPY [server_app.Infrastructure/server_app.Infrastructure.csproj, server_app.Infrastructure/] 0.0s
    => CACHED [server_app build 5/9] COPY [server_app.Domain/server_app.Domain.csproj, server_app.Domain/] 0.0s
    => CACHED [server_app build 6/9] COPY [server_app.Application/server_app.Application.csproj, server_app.Application/] 0.0s
    => CACHED [server_app build 7/9] RUN dotnet restore server_app.Presentation/server_app.Presentation.csproj 0.0s
    => CACHED [server_app build 8/9] COPY . . 0.0s
    Написано
  • Как организовать фасетный поиск в postgres?

    Timur2342
    @Timur2342
    Коментарий не по тебе. Можно твой гитхаб? Хочу посмотреть на твой пет проект, сам делаю похожее, вот может что да возьму с твоего. Буду очень благодарен
    Написано
  • Где можно посмотреть примеры алгоритмов рекомендаций?

    Timur2342
    @Timur2342 Автор вопроса
    Да, разницу понимаю, мне именно бы чистые рекомендации без проплаченного хлама
    Написано
  • Что не так с новым Unity 6?

    Timur2342
    @Timur2342
    Железо может слабое у тебя? у меня примерно такие же проблемы были когда на старом ноуте новую версию юнити установил
    Написано
  • Почему axios не выдает headers?

    Timur2342
    @Timur2342 Автор вопроса
    поменля на WithExposedHeaders(), работает. Спасибо!!!
    Написано
  • Почему axios не выдает headers?

    Timur2342
    @Timur2342 Автор вопроса
    Код поменял на
    builder.Services.AddCors((opts) =>
    {
        opts.AddDefaultPolicy((corsPolicyBuilder) =>
        {
            corsPolicyBuilder.WithOrigins("http://localhost:3000")
                .AllowAnyMethod()
                .AllowAnyOrigin()
                .AllowAnyHeader()
                .WithHeaders("account-is-confirmed");
        });
    });

    нечего не изменилось
    Написано
  • Как проверить подписку на телеграм канал в Unity?

    Timur2342
    @Timur2342
    Как проверить? Только через api самого телеграма, тут тег unity даже не сильно нужен.
    Написано