-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes
179 lines (162 loc) · 7.75 KB
/
notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
minecraft-controller
--------------------------------------------------------------------------------
Server Output:
[17:28:08] [Server thread/INFO]: Starting minecraft server version 1.7.4
[17:28:08] [Server thread/INFO]: Loading properties
[17:28:08] [Server thread/INFO]: Default game type: SURVIVAL
[17:28:08] [Server thread/INFO]: Generating keypair
[17:28:08] [Server thread/INFO]: Starting Minecraft server on *:44444
[17:28:08] [Server thread/INFO]: Preparing level "world"
[17:28:08] [Server thread/INFO]: Preparing start region for level 0
[17:28:09] [Server thread/INFO]: Preparing spawn area: 40%
[17:28:10] [Server thread/INFO]: Done (1.915s)! For help, type "help" or "?"
[17:28:53] [User Authenticator #1/INFO]: UUID of player DatFrogKing is ebd5a42b74a8434bbad8b56c88375dbf
[17:28:53] [Server thread/INFO]: DatFrogKing[/150.252.108.12:58133] logged in with entity id 76 at (-1999.6095715041984, 65.0, 1611.0657001381044)
[17:28:53] [Server thread/INFO]: DatFrogKing joined the game
--------------------------------------------------------------------------------
Server Prop Keys w/ defaults:
- = cannot change OR set
+ = can initially set
m = can change (modify) and initially set
- generator-settings=
- op-permission-level=3
- level-name=world
- enable-query=false
- allow-flight=false
- announce-player-achievements=true
- server-port=44444
+ level-type=DEFAULT
- enable-rcon=false
- level-seed=
m force-gamemode=false
- server-ip=
- max-build-height=256
m spawn-npcs=true
m white-list=false
m spawn-animals=true
m hardcore=false
- snooper-enabled=false
- online-mode=true
- resource-pack=
m pvp=true
m difficulty=1
- enable-command-block=false
m gamemode=0
- player-idle-timeout=20
+ max-players=20
m spawn-monsters=true
m generate-structures=true
- view-distance=10
+ motd=A Minecraft Server
--------------------------------------------------------------------------------
Server Internal Props:
exec=STRING (absolute path)
cmd-line=arg1 arg2 arg3 ...
server-time=NUMERIC in seconds
countdown-time=NUMERIC in seconds
override-port=NUMERIC zero is not valid
--------------------------------------------------------------------------------
--help text:
--------------------------------------------------------------------------------
Simple protocol for client/server communication:
The client initates a request, which normally corresponds to user input
of some kind. The server processes the request and performs some kind of action.
Messages: requests and responses are very similar. They can contain all printable
characters except '|' and ','. Whitespace is considered to be part of any field's
value.
[general format]
COMMAND|Field, field, field, ... \n
Each message is terminated by a single newline character. It is recommended
that each client or server read messages into a local buffer until the newline is encountered
before processing the message
--------------------------------------------------------------------------------
Protocol for minecraft-controller: this protocol supercedes the simple one described
above and is available starting in version 0.6 BETA test.
Message Format:
(request; fields are optional)
MINECONTROL-PROTOCOL <CRLF>
COMMAND <CRLF>
Field: value <CRLF>
Field: value <CRLF> ...
<CRLF>
(response; fields are optional)
MINECONTROL-PROTOCOL <CRLF>
RESPONSE-COMMAND <CRLF>
Field: value <CRLF>
Field: value <CRLF> ...
<CRLF>
The client initiates a connection to the server sending a request with the HELLO command. The server
sends a response with the response-command GREETINGS. If this communication fails or times-out, the
connection will be shutdown by the server. After greetings have been exchanged, any command may be
sent. The client simply needs to shutdown the socket connection to cleanly disconnect.
Commands:
HELLO
Name:
Version:
LOGIN
Username: <username>
Password: <encrypted-password> (note: this string is created by taking 128 bytes and converting each one to a hexadecimal string; each
hexadecimal value should be separated by whitespace like so: 78 A7 98)
LOGOUT
START
IsNew: true|false
ServerName: [dir-name]
[optional fields follow]
ServerTime: [hours]
Exec: [command-line]
[minecraft server properties from server.properties]
PropertyName: PropertyValue
STATUS
EXTEND
ServerID: [integer number]
Amount: [integer number (hours to extend)]
EXEC
ServerID: [integer number]
Command: [string: command line to execute]
STOP (stop a process run by minecontrol; if AuthPID is not specified then the minecraft server denoted
ServerID: [integer number] by 'ServerID' is stopped along with all authority process that might be running alongside it; if
[AuthPID: [integer number]] 'AuthPID' is specified, then only the authority program with that PID is stopped)
CONSOLE (begin console communications; client should begin a new thread that reads messages and writes to output screen;
the server responds to this command with a CONSOLE-MESSAGE reponse with Status=established; no other console
commands are directly acknowledged once in console mode)
ServerID: [integer number]
CONSOLE-COMMAND (send a Minecraft server command string to minecontrold; minecontrold will forward this message to Java)
ServerCommand: [string]
ServerCommand: [string]
...
CONSOLE-QUIT (end console communications; server will send a CONSOLE-MESSAGE with Status=shutdown)
SHUTDOWN
Responses:
GREETINGS
Name: <name string>
Version: <version string>
EncryptKey: PUBLIC-MODULES-HEX-STRING|PUBLIC_EXPONENT-HEX-STRING (note: big-endian format is used as per BN_bn2bin)
MESSAGE
Payload: [message]
LIST-MESSAGE
Item: [message-item]
(etc)
LIST-ERROR
Item: [message-item]
(etc)
ERROR
Payload: [message]
CONSOLE-MESSAGE
Status: [established|failed|message|error|shutdown]
established: the client's CONSOLE command is being acknowledged; the minecontrol authority has accepted the client into console mode (no payload)
failed: the client's CONSOLE command was rejected (no payload)
message: the payload field contains a a Minecraft server command string
error: error occurred (client most likely sent bad command during console mode); payload contains error message
shutdown: the server is shutting down the console mode (no payload); this is a response to a CONSOLE-QUIT or an internal shutdown;
(NOTE! In the case of an internal shutdown, a console-quit still needs to be sent)
Payload: [string]
RSA Cryptography
Minecontrol employs the OpenSSL Crypto library to provide encryption for sensitive
data fields in protocol messages. The server will deliver a public key of a specific
format with its normal GREETINGS response. Certain fields in the commands listed
above require their values to be encrypted using the crypto RSA public-private key
method.
Other applications implementing this protocol need to somehow employ the OpenSSL
library. If C++ bindings can be used, the classes implemented by minecontrol-protocol.h
and minecontrol-protocol.cpp can be used to implement an interface for another programming
language.