msmhq / msm

An init script for managing Minecraft servers
http://msmhq.com
GNU General Public License v3.0
1.22k stars 225 forks source link

msm <server-name> connected don't work! #159

Open Karlsson-i-taket opened 11 years ago

Karlsson-i-taket commented 11 years ago

minecraft@sebastian:~$ msm rpg-craft connected No players are connected. minecraft@sebastian:~$

I don't understand this i am logged in to minecraft at this server but when i write this command it does not show anyone. I have been reading in the forums and some others got the same problem i saw the #131 issue and i fixed it but it still don't work. Please help i really need it.

TrogloGeek commented 11 years ago

Hi, First, please make sure that msm-version is correctly configured for your serveur (take a look at documentation if you don't know what I'm talking about). If it's ok and still don't work, issue the connected command again, read server log and paste us the server's answer to the command. Obviously, you won't forget to give us the MSM and minecraft server versions you're using.

Karlsson-i-taket commented 11 years ago

minecraft@sebastian:~$ msm rpg-craft connected No players are connected. minecraft@sebastian:~$

MSM version was 0.8.16 beta and i'm using craftbukkit/1.5.2

Karlsson-i-taket commented 11 years ago

And i also saw now that if i write:

minecraft@sebastian:~$ msm rpg-craft connected No players are connected. minecraft@sebastian:~$

I displayed this on msm rpg-craft console:

There are 1 out of maximum 20 players online. Connected players: xXIQue_KillerzXx

Every time i write msm rpg-craft connected it display on the console

IronTetsubo commented 11 years ago

attach your server log, please (stick it in pastebin, or use gist) - it's likely that msm isn't parsing it properly, but I don't use craftbukkit, so it's harder for me to see. What you're pasting is what it's matching on, so something's strange - maybe a look at the whole server log will help.

IronTetsubo commented 11 years ago

I use ftb direwolf20, and vanilla mc. I'm working on a patch to add ftb support for the various servers.

marcuswhybrow commented 11 years ago

For now you could use msm <server-name> cmdlog list. This will issue the /list command and then log the output to stdout.

The cause of this issue is different Minecraft server versions returning the list of players from the /list command in different formats. Therefore MSM has to handle every eventuality (which is hard).


Taking one step back, I'm thinking MSM should stop trying to stand between you and your Minecraft server's commands in general by giving you raw access only; looking something like cmd/cmdlog does. Who want's to learn MSM's idiosyncrasies on top of all the Minecraft commands anyway?

IronTetsubo commented 11 years ago

It's nice to have a standard way to do this that wraps up the various idiosyncrasies of the server jars being used to present one standard way to interact with the minecraft server. So, I recommend continuing down the road you're heading, and maybe the fix here is to update the docs/interface to make it clearer that "cmd/cmdlog" is the way to interact with the server if the various wrapper calls aren't working.

ghost commented 10 years ago

Sorry to revive this but I'm trying to find a work around. msm <server-name> cmdlog list doesn't seem to play nice with 1.7.2. It's not a big deal since I can run the /list command manually but it was super convenient to just use the msm <server-name> connected command to get a quick list. It's my understanding that it'd be difficult to to accept all the different output formats from Minecraft but I was wondering if there was a quick/dirty way of just getting it to regurgitate all connected users.

Any help would be appreciated. If using the msm <server-name> connected wrapper is being deprecated due to the many varying server outputs, so be it.

Thanks.

BADproducts commented 10 years ago

Proposed Solution

Minecraft changed its log file location and format in 1.7.2 as follows:

my solution breaks backwards comparability however it could be modified easily to be backwards compatible. MSM

local regex="${LOG_REGEX} ($3)"

with:

local regex="${LOG_REGEX}: ($3)"

note the semi colon.

while read -t $4 line; do

with the following:

[[ $line =~ ^\[(.*)\][[:space:]](.*) ]]
line="`date +%Y-%m-%d` ${BASH_REMATCH[1]} ${BASH_REMATCH[2]}"

This brings the log file in line with the expected format (needed because UNIX time is used). versioning / minecraft / 1.7.0.sh

console_command CONNECTED "list" \

to the following:

"There are ([1-9][0-9]*)/([0-9]+) players online:$" \

notes i had to delete server.log and then add symbolic link to the latest.log (debian) as folows:

ln -s ./logs/latest.log ./server.log

I'm not sure of the best method to handle this with the MSM script set.

msashlee commented 9 years ago

I am having this issue on Minecraft 1.8.8 MSM version 0.9.2. Is the only fix to follow the above?

renderorange commented 9 years ago

Hello msashlee, are you referring to the log issue noted above, or the OP about the connected command? If about the log location, there are some current commits being pushed which solve this issue.

lhwn5407 commented 4 years ago

Paper or Spigot solution

If you are using Paper 1.16.x or higher, you can fix this by adding the following Versioning directories and files.

mkdir /opt/msm/versioning/paper
cd /opt/msm/versioning/paper
touch 1.16.0.sh

Now use vim to edit the 1.16.0.sh file as follows:

# vim 1.16.0.sh
# MSM version file for Paper 1.16.0 and above

extends "minecraft/1.7.0"

console_command CONNECTED "list" \
  ".+:(.+)?$" \
  "$"

Modify the msm-version of the server.properties file under the server working directory to specify the version to use. A typical location is /opt/msm/servers/\<server-name>/server.properties.

# vim /opt/msm/servers/<server-name>/server.properties
msm-version=paper/1.16.0

This is the end! Now msm <server-name> connected works magically.

# msm <server-name> connected
There are 1 of a max of 20 players online: abcd1234