Fixed Server Crash.
This commit is contained in:
parent
dc095749b7
commit
aa91549488
1 changed files with 26 additions and 2 deletions
|
@ -26,8 +26,32 @@ public class NetworkHandler
|
|||
ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( myChannelName = channelName );
|
||||
ec.register( this );
|
||||
|
||||
clientHandler = new AppEngClientPacketHandler();
|
||||
serveHandler = new AppEngServerPacketHandler();
|
||||
clientHandler = createClientSide();
|
||||
serveHandler = createServerSide();
|
||||
}
|
||||
|
||||
private IPacketHandler createServerSide()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new AppEngServerPacketHandler();
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private IPacketHandler createClientSide()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new AppEngClientPacketHandler();
|
||||
}
|
||||
catch (Throwable t)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
Loading…
Reference in a new issue