Skip to content

Add FallbackWriter for Docker environment - #23

Merged
breadbyte merged 1 commit into
breadbyte:mainfrom
CAMOBAP:main
Sep 24, 2023
Merged

breadbyte merged 1 commit into
breadbyte:mainfrom
CAMOBAP:main

Conversation

@CAMOBAP

@CAMOBAP CAMOBAP commented Sep 24, 2023

Copy link
Copy Markdown
Contributor

For non-windows platform Console.BufferWidth return 0 and any attempts to change it will lead to System.PlatformNotSupportedException. This commit add simple FallbackWriter wraper around Console.WriteLine

Related issue: #9

Testing

I have tested it in Portainer as a Stack (i.e. docker-compose.yaml)

# https://mccteam.github.io/guide/installation.html#using-docker
version: '3.8'

services:
  minecraft-client:
    image: localhost/minecraft-console-client:latest
    container_name: 'minecraft-client'
    environment:
    - MCC_SKIP_REDOWNLOAD=true
    volumes:
    - data:/opt/data
    - /etc/timezone:/etc/timezone:ro
    - /etc/localtime:/etc/localtime:ro
    stdin_open: true
    tty: true

volumes:
  data:
    external: true

Observation

To avoid 'corrupted' logs like described in #9 (comment) add Display_Input = false to MinecraftClient.init

For non-windows platform Console.BufferWidth return 0 and any attempts to
change it will lead to System.PlatformNotSupportedException. This commit
add simple FallbackWriter wraper around Console.WriteLine
@breadbyte

Copy link
Copy Markdown
Owner

LGTM. Thank you for your contribution! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exception when running ConsoleInteractive in a Docker environment

2 participants