mirror of
https://github.com/Tiiffi/mcrcon.git
synced 2025-10-28 11:51:08 -04:00
Set default address to localhost
This commit is contained in:
@ -1,4 +1,8 @@
|
|||||||
#### Version history:
|
#### Version history:
|
||||||
|
|
||||||
|
###### 0.6.2
|
||||||
|
- Set default address to localhost
|
||||||
|
|
||||||
###### 0.6.1
|
###### 0.6.1
|
||||||
- Color coding fixed
|
- Color coding fixed
|
||||||
* Thanks to Hagb @ Github
|
* Thanks to Hagb @ Github
|
||||||
|
|||||||
2
mcrcon.1
2
mcrcon.1
@ -17,7 +17,7 @@ It is well suited for remote administration and server maintenance scripts.
|
|||||||
.IP -h
|
.IP -h
|
||||||
Print usage
|
Print usage
|
||||||
.IP -H
|
.IP -H
|
||||||
Server address
|
Server address (default is localhost)
|
||||||
.IP -P
|
.IP -P
|
||||||
Port (default is 25575)
|
Port (default is 25575)
|
||||||
.IP -p
|
.IP -p
|
||||||
|
|||||||
13
mcrcon.c
13
mcrcon.c
@ -147,7 +147,10 @@ int main(int argc, char *argv[])
|
|||||||
if (!port)
|
if (!port)
|
||||||
port = "25575";
|
port = "25575";
|
||||||
|
|
||||||
if(argc < 2 && host == NULL && pass == NULL)
|
if (!host)
|
||||||
|
host = "localhost";
|
||||||
|
|
||||||
|
if(argc < 1 && pass == NULL)
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
// default getopt error handler enabled
|
// default getopt error handler enabled
|
||||||
@ -185,12 +188,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (host == NULL)
|
|
||||||
{
|
|
||||||
fputs("Host not defined (-H flag). Try 'mcrcon -h' or 'man mcrcon' for more information.\n\n", stdout);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pass == NULL)
|
if (pass == NULL)
|
||||||
{
|
{
|
||||||
fputs("Password not defined (-p flag). Try 'mcrcon -h' 'man mcrcon' for more information.\n\n", stdout);
|
fputs("Password not defined (-p flag). Try 'mcrcon -h' 'man mcrcon' for more information.\n\n", stdout);
|
||||||
@ -240,7 +237,7 @@ void usage(void)
|
|||||||
"Sends rcon commands to Minecraft server.\n\n"
|
"Sends rcon commands to Minecraft server.\n\n"
|
||||||
"Option:\n"
|
"Option:\n"
|
||||||
" -h\t\tPrint usage\n"
|
" -h\t\tPrint usage\n"
|
||||||
" -H\t\tServer address\n"
|
" -H\t\tServer address (default is localhost)\n"
|
||||||
" -P\t\tPort (default is 25575)\n"
|
" -P\t\tPort (default is 25575)\n"
|
||||||
" -p\t\tRcon password\n"
|
" -p\t\tRcon password\n"
|
||||||
" -t\t\tInteractive terminal mode\n"
|
" -t\t\tInteractive terminal mode\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user