MCCTeam / Minecraft-Console-Client

Lightweight console for Minecraft chat and automated scripts
https://mccteam.github.io
Other
1.67k stars 402 forks source link

Chat Log spamming errors when switching servers using /connect sometimes #1569

Closed tangerine349 closed 3 years ago

tangerine349 commented 3 years ago

Prerequisites


Expected Behavior

Stuff to be logged and not spamming errors every chat message


Actual Behavior

Spamming this whenever a chat message is sent [ERROR] OnTextReceived: Got error from MinecraftClient.ChatBots.ChatLog: System.IO.IOException: Sharing violation on path /root/Alts/Deadbush_friend/chatlog-Deadbush_friend-play.hoaxmc.com.txt at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <5dfd69ae4e3b402db546d8ded6fc755e>:0 at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode) [0x00000] in <5dfd69ae4e3b402db546d8ded6fc755e>:0 at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode) at MinecraftClient.ChatBots.ChatLog.save (System.String tosave) [0x0004e] in <6ae3e64ef57d4cffb62e7fbe44b6ffc5>:0 at MinecraftClient.ChatBots.ChatLog.GetText (System.String text) [0x00080] in <6ae3e64ef57d4cffb62e7fbe44b6ffc5>:0 at MinecraftClient.McClient+<>c__DisplayClass140_0.b__0 (MinecraftClient.ChatBot bot) [0x00000] in <6ae3e64ef57d4cffb62e7fbe44b6ffc5>:0 at MinecraftClient.McClient.DispatchBotEvent (System.Action1[T] action, System.Collections.Generic.IEnumerable1[T] botList) [0x00022] in <6ae3e64ef57d4cffb62e7fbe44b6ffc5>:0


Steps to Reproduce the Problem

  1. Login to a server
  2. Use [connect] command
  3. use the [connect] command again to the old server
  4. It has a random chance of happening, but really common

Screenshot (If applicable)

https://gyazo.com/69cff7bb7345f8891514fe406d8c8720


Anythings that could help diagnosing the bug

(config, log output)

# Minecraft Console Client v1.15.2
# Startup Config File

[Main]

# General settings
# Leave blank to prompt user on startup
# Use "-" as password for offline mode

serverip=play.hoaxmc.com
type=mojang                        # Account type. mojang or microsoft

# Advanced settings

language=en_GB
consoletitle=%username%@%serverip% - Minecraft Console Client
internalcmdchar=slash              # Use 'none', 'slash' or 'backslash'
messagecooldown=1                  # Minimum delay in seconds between messages to avoid being kicked for spam.
botowners=HoaxMC,GT2405,oAquaa  # Name list or myfile.txt, one name per line. !Server admins can impersonate owners!
mcversion=1.12.2                     # Use 'auto' or '1.X.X' values. Allows to skip server info retrieval.
mcforge=auto                       # Use 'auto', 'false' or 'true'. Force-enabling only works for MC 1.13+.
brandinfo=mcc                      # Use 'mcc', 'vanilla', or 'none'. This is how MCC identifies itself to the server.
chatbotlogfile=                    # Leave empty for no logfile
privatemsgscmdname=tell            # Used by RemoteControl bot
showsystemmessages=true            # System messages for server ops
showxpbarmessages=true             # Messages displayed above xp bar
showchatlinks=true                 # Show links embedded in chat messages
terrainandmovements=false          # Uses more ram, cpu, bandwidth
inventoryhandling=false            # Toggle inventory handling (beta)
entityhandling=false               # Toggle entity handling (beta)
sessioncache=disk                  # How to retain session tokens. Use 'none', 'memory' or 'disk'
resolvesrvrecords=fast             # Use 'false', 'fast' (5s timeout), or 'true'. Required for joining some servers.
accountlist=accounts.txt           # See README > 'Servers and Accounts file' for more info about this file
serverlist=servers.txt             # See README > 'Servers and Accounts file' for more info about this file
playerheadicon=true                # Only works on Windows XP-8 or Windows 10 with old console
exitonfailure=false                # Disable pauses on error, for using MCC in non-interactive scripts
debugmessages=false                # Please enable this before submitting bug reports. Thanks!
scriptcache=true                   # Cache compiled scripts for faster load on low-end devices
timestamps=false                   # Prepend timestamps to chat messages
autorespawn=false                  # Toggle auto respawn if client player was dead (make sure your spawn point is safe)

[AppVars]
# yourvar=yourvalue
# can be used in some other fields as %yourvar%
# %username% and %serverip% are reserved variables.

[Proxy]
enabled=false                      # Use 'false', 'true', or 'login' for login only
type=HTTP                          # Supported types: HTTP, SOCKS4, SOCKS4a, SOCKS5
server=0.0.0.0:0000                # Proxy server must allow HTTPS for login, and non-443 ports for playing
username=                          # Only required for password-protected proxies
password=                          # Only required for password-protected proxies

[ChatFormat]
# Do not forget to uncomment (remove '#') these settings if modifying them
builtins=true                      # MCC built-in support for common message formats
# public=^<([a-zA-Z0-9_]+)> (.+)$
# private=^([a-zA-Z0-9_]+) whispers to you: (.+)$
# tprequest=^([a-zA-Z0-9_]+) has requested (?:to|that you) teleport to (?:you|them)\.$

[MCSettings]
enabled=true                       # If disabled, settings below are not sent to the server
locale=en_US                       # Use any language implemented in Minecraft
renderdistance=medium              # Use tiny, short, medium, far, or chunk amount [0 - 255]
difficulty=normal                  # MC 1.7- difficulty. peaceful, easy, normal, difficult
chatmode=enabled                   # Use 'enabled', 'commands', or 'disabled'. Allows to mute yourself...
chatcolors=true                    # Allows disabling chat colors server-side
main_hand=left                     # MC 1.9+ main hand. left or right
skin_cape=true
skin_hat=true
skin_jacket=false
skin_sleeve_left=false
skin_sleeve_right=false
skin_pants_left=false
skin_pants_right=false
# Bot Settings

[Alerts]
enabled=false
alertsfile=alerts.txt
excludesfile=alerts-exclude.txt
beeponalert=true

[AntiAFK]
enabled=false
delay=600 #10 = 1s
command=/ping

[AutoRelog]
enabled=true
delay=10                           # use 10 for 10 seconds, 10-60 for a random delay between 10 and 60 seconds
retries=-1                          # retries when failing to relog to the server. use -1 for unlimited retries
kickmessagesfile=kickmessages.txt  # file with list of matches in kick messages that will trigger autorelog
ignorekickmessage=true            # when set to true, autorelog will reconnect regardless of kick messages

[ChatLog]
enabled=true
timestamps=true
filter=sdgudjhlsjg
logfile=chatlog-%username%-%serverip%.txt

[Hangman]
enabled=false
english=true
wordsfile=hangman-en.txt
fichiermots=hangman-fr.txt

[ScriptScheduler]
enabled=true
tasksfile=scripts.ini

[RemoteControl]
enabled=true
autotpaccept=true
tpaccepteveryone=false

[AutoRespond]
enabled=true
matchesfile=remotecontrol.ini

[AutoAttack]
# Entity Handling NEED to be enabled first
enabled=false
mode=single                        # single or multi. single target one mob per attack. multi target all mobs in range per attack
priority=distance                  # health or distance. Only needed when using single mode

[AutoFishing]
# Entity Handling NEED to be enabled first
enabled=false
antidespawn=false

[AutoEat]
# Inventory Handling NEED to be enabled first
enabled=false
threshold=6

[AutoCraft]
# Inventory Handling NEED to be enabled first
# Enable terrainandmovements if you need to use crafting table
enabled=false
configfile=autocraft\config.ini

[Mailer]
# Let the bot act like a mail plugin
enabled=false
database=MailerDatabase.ini
ignorelist=MailerIgnoreList.ini
publicinteractions=false
maxmailsperplayer=10
maxdatabasesize=10000
retentiondays=30

[AutoDrop]
# Inventory Handling NEED to be enabled first
enabled=false
mode=include                      # include, exclude or everything. Include: drop item IN the list. Exclude: drop item NOT IN the list
items=                            # separate each item with comma ','
# For the naming of the items, please see 
# https://github.com/ORelio/Minecraft-Console-Client/blob/master/MinecraftClient/Inventory/ItemType.cs 

[ReplayMod]
# Enable recording the game and replay it later using Replay Mod
# You MUST exit the program using /quit command or the replay will NOT be saved!
enabled=false
backupinterval=300                # How long should replay file be auto-saved, in seconds. Use -1 for disabled

Specifications

tangerine349 commented 3 years ago

Also the config says 1.15.2 because ive updated the config to a newer version before

ReinforceZwei commented 3 years ago

Edited your comment to make config format better.

ReinforceZwei commented 3 years ago

This issue should be fixed in #1488. Please download the latest version from here

Related: #1484