Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static final void run_startup_configurations() {
- System.out.print("Loading Login Server...");
- userLimit = ServerConfig.userLimit;
- serverName = ServerConfig.serverName;
- eventMessage = ServerConfig.eventMessage;
- flag = ServerConfig.flag;
- adminOnly = ServerConfig.adminOnly;
- maxCharacters = ServerConfig.maxCharacters;
- ByteBuffer.setUseDirectBuffers(false);
- ByteBuffer.setAllocator(new SimpleByteBufferAllocator());
- acceptor = new SocketAcceptor();
- final SocketAcceptorConfig cfg = new SocketAcceptorConfig();
- cfg.getSessionConfig().setTcpNoDelay(true);
- cfg.setDisconnectOnUnbind(true);
- cfg.getFilterChain().addLast("codec", new ProtocolCodecFilter(new MapleCodecFactory()));
- try {
- InetSocketadd = new InetSocketAddress(PORT);
- System.out.println("login: " + InetSocketadd.getAddress());
- acceptor.bind(InetSocketadd, new MapleServerHandler(), cfg);
- System.out.println(" Complete!");
- System.out.println("Login Server is listening on port " + PORT + ".");
- } catch (IOException e) {
- System.out.println(" Failed!");
- System.err.println("Could not bind to port " + PORT + ": " + e);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement