mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
A major load of fixes - things should be about back to normal now.
This commit is contained in:
1 parent
322301c301
commit
815944c49a
38 files changed
+114
-93
No files matched your search
@@ -14,36 +14,27 @@ public class ClientConnectionHandler
|
||||
{
|
||||
@SubscribeEvent
|
||||
public void onConnection(ClientConnectedToServerEvent event)
|
||||
{
|
||||
if(event.isLocal)
|
||||
{
|
||||
localConnection();
|
||||
}
|
||||
else {
|
||||
//TODO this is probably wrong
|
||||
remoteConnection(event.manager.getSocketAddress().toString());
|
||||
}
|
||||
}
|
||||
|
||||
/* Remote */
|
||||
public void remoteConnection(String server)
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
MekanismClient.voiceClient = new VoiceClient(server);
|
||||
} catch(Exception e) {}
|
||||
}
|
||||
}
|
||||
|
||||
/* Integrated */
|
||||
public void localConnection()
|
||||
{
|
||||
if(Mekanism.voiceServerEnabled)
|
||||
{
|
||||
try {
|
||||
MekanismClient.voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress());
|
||||
} catch(Exception e) {}
|
||||
if(event.isLocal)
|
||||
{
|
||||
try {
|
||||
MekanismClient.voiceClient = new VoiceClient(InetAddress.getLocalHost().getHostAddress());
|
||||
} catch(Exception e) {
|
||||
Mekanism.logger.error("Unable to establish VoiceClient on local connection.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
MekanismClient.voiceClient = new VoiceClient(event.manager.getSocketAddress().toString());
|
||||
} catch(Exception e) {
|
||||
Mekanism.logger.error("Unable to establish VoiceClient on remote connection.");
|
||||
e.printStackTrace();
|
||||
}
|
||||
//TODO this is probably wrong
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user