I want to send some information just after the handshake completed(handling ClientConnectedToServerEvent), and the mod on server side will check the information and do something.
The problem is, the server never receives the message sent during ClientConnectedToServerEvent.
The code is shown below:
@SubscribeEvent
public void onClientConnectedToServer(ClientConnectedToServerEvent event) {
if (event.connectionType.equals("MODDED")) {
FMLLog.info("send to server");
LIUtils.netHandler.sendToServer(message());
}
}
Actually, I get my FMLLog:
[00:12:19] [Netty Client IO #2/DEBUG] [FML/]: Server FML protocol version 2, 4 byte dimension received 0
[00:12:19] [Netty Client IO #2/TRACE] [FML/]: $ServerHello->FMLHandshakeClientState$2:HELLO
[00:12:19] [Netty Client IO #2/INFO] [FML/]: Server protocol version 2
[00:12:19] [Netty Client IO #2/DEBUG] [FML/]: Received override dimension 0
[00:12:19] [Netty IO #5/TRACE] [FML/]: $ClientHello->FMLHandshakeServerState$2:HELLO
[00:12:19] [Netty IO #5/INFO] [FML/]: Client protocol version 2
[00:12:19] [Netty IO #5/TRACE] [FML/]: $ModList:7 mods->FMLHandshakeServerState$2:HELLO
[00:12:19] [Netty IO #5/INFO] [FML/]: Client attempting to join with 7 mods :
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected],
[email protected]
[00:12:19] [Netty IO #5/INFO] [FML/]: Attempting connection with missing mods [] at CLIENT
[00:12:19] [Netty Client IO #2/TRACE] [FML/]: $ModList:7 mods->FMLHandshakeClientState$3:WAITINGSERVERDATA
[00:12:19] [Netty Client IO #2/INFO] [FML/]: Attempting connection with missing mods [] at SERVER
[00:12:19] [Netty IO #5/TRACE] [FML/]: $HandshakeAck:{2}->FMLHandshakeServerState$3:WAITINGCACK
[00:12:19] [Netty Client IO #2/TRACE] [FML/]: $HandshakeAck:{2}->FMLHandshakeClientState$5:PENDINGCOMPLETE
[00:12:19] [Netty IO #5/TRACE] [FML/]: $HandshakeAck:{4}->FMLHandshakeServerState$4:COMPLETE
[00:12:19] [Netty Client IO #2/TRACE] [FML/]: $HandshakeAck:{3}->FMLHandshakeClientState$6:COMPLETE
[00:12:19] [Netty IO #5/TRACE] [FML/]: $HandshakeAck:{5}->FMLHandshakeServerState$5:DONE
[00:12:20] [server thread/INFO] [FML/]: [server thread] Server side modded connection established
[00:12:20] [Client thread/DEBUG] [FML/]: The fluid minecraft:lava has been selected as the default fluid for lava
[00:12:20] [Client thread/DEBUG] [FML/]: The fluid minecraft:water has been selected as the default fluid for water
[00:12:20] [Client thread/DEBUG] [FML/]: The fluid LIUtils:imagproj has been selected as the default fluid for imagproj
[00:12:20] [Client thread/INFO] [FML/]: [Client thread] Client side modded connection established
[00:12:20] [Client thread/INFO] [FML/]: send to server
[00:12:20] [Client thread/DEBUG] [FML/]: Overriding dimension: using 0
However, it just doesn't receive the message i want....
It would be appreciated if someone can help me, thanks!