本文整理汇总了Java中ethanjones.cubes.side.server.CubesServer类的典型用法代码示例。如果您正苦于以下问题:Java CubesServer类的具体用法?Java CubesServer怎么用?Java CubesServer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CubesServer类属于ethanjones.cubes.side.server包,在下文中一共展示了CubesServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
@Override
public void setServer(CubesServer cubesServer) throws UnsupportedOperationException {
// CubesSecurity.checkSetCubes();
if (cubesServer != null) {
if (cubesServer instanceof IntegratedServer) {
this.cubesServer = (IntegratedServer) cubesServer;
Log.debug("Server set");
this.cubesServer.start();
} else {
Log.warning("Server can only be set to an IntegratedServer");
}
} else {
this.cubesServer = null;
Log.debug("Server set to null");
}
}
示例2: stop
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stop() {
final CubesClient cubesClient = adapter.getClient();
final CubesServer cubesServer = adapter.getServer();
final Thread currentThread = Thread.currentThread();
if (!isDedicatedServer()) {
if (Adapter.getInterface().getThread() == currentThread) {
stopFromClientThread(cubesClient, cubesServer);
} else if (cubesServer != null && cubesServer.getThread() == currentThread) {
stopFromServerThread(cubesClient, cubesServer);
} else {
stopFromOtherThread(cubesClient, cubesServer);
}
throw new StopLoopException();
} else {
if (Adapter.getInterface().getThread() == currentThread) {
stopFromServerThread(cubesClient, cubesServer);
} else {
stopFromOtherThread(cubesClient, cubesServer);
}
}
}
示例3: stopFromServerThread
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stopFromServerThread(final CubesClient cubesClient, final CubesServer cubesServer) {
try {
if (cubesClient != null) {
cubesClient.dispose();
}
if (cubesServer != null) {
cubesServer.dispose();
}
// if (cubesClient != null) {
// try {
// cubesClient.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesClient.getThread().isAlive()) {
// failedToStopThread(cubesClient.getThread());
// }
// }
} catch (Exception e) {
Debug.crash(e);
}
}
示例4: setServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
@Override
public void setServer(CubesServer cubesServer) throws UnsupportedOperationException {
//CubesSecurity.checkSetCubes();
if (cubesServer != null) {
if (cubesServer instanceof IntegratedServer) {
this.cubesServer = (IntegratedServer) cubesServer;
Log.debug("Server set");
this.cubesServer.start();
} else {
Log.warning("Server can only be set to an IntegratedServer");
}
} else {
this.cubesServer = null;
Log.debug("Server set to null");
}
}
示例5: stop
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stop() {
final CubesClient cubesClient = adapter.getClient();
final CubesServer cubesServer = adapter.getServer();
final Thread currentThread = Thread.currentThread();
if (!isDedicatedServer()) {
if (Adapter.getInterface().getThread() == currentThread) {
stopFromClientThread(cubesClient, cubesServer);
} else if (cubesServer != null && cubesServer.getThread() == currentThread) {
stopFromServerThread(cubesClient, cubesServer);
} else {
stopFromOtherThread(cubesClient, cubesServer);
}
throw new StopLoopException();
} else {
if (Adapter.getInterface().getThread() == currentThread) {
stopFromServerThread(cubesClient, cubesServer);
} else {
stopFromOtherThread(cubesClient, cubesServer);
}
}
}
示例6: stopFromServerThread
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stopFromServerThread(final CubesClient cubesClient, final CubesServer cubesServer) {
try {
if (cubesClient != null) {
cubesClient.dispose();
}
if (cubesServer != null) {
cubesServer.dispose();
}
// if (cubesClient != null) {
// try {
// cubesClient.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesClient.getThread().isAlive()) {
// failedToStopThread(cubesClient.getThread());
// }
// }
} catch (Exception e) {
Debug.crash(e);
}
}
示例7: stopFromOtherThread
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stopFromOtherThread(final CubesClient cubesClient, final CubesServer cubesServer) {
try {
if (cubesClient != null) {
cubesClient.dispose();
}
if (cubesServer != null) {
cubesServer.dispose();
}
// if (cubesClient != null) {
// try {
// cubesClient.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesClient.getThread().isAlive()) {
// failedToStopThread(cubesClient.getThread());
// }
// }
// if (cubesServer != null) {
// try {
// cubesServer.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesServer.getThread().isAlive()) {
// failedToStopThread(cubesServer.getThread());
// }
// }
} catch (Exception e) {
Debug.crash(e);
}
}
示例8: stopFromOtherThread
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private static void stopFromOtherThread(final CubesClient cubesClient, final CubesServer cubesServer) {
try {
if (cubesClient != null) {
cubesClient.dispose();
}
if (cubesServer != null) {
cubesServer.dispose();
}
// if (cubesClient != null) {
// try {
// cubesClient.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesClient.getThread().isAlive()) {
// failedToStopThread(cubesClient.getThread());
// }
// }
// if (cubesServer != null) {
// try {
// cubesServer.getThread().join(JOIN_TIMEOUT);
// } catch (InterruptedException e) {
// }
// if (cubesServer.getThread().isAlive()) {
// failedToStopThread(cubesServer.getThread());
// }
// }
} catch (Exception e) {
Debug.crash(e);
}
}
示例9: getServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
public static CubesServer getServer() {
return adapterInterface.getServer();
}
示例10: setServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
@Override
public void setServer(CubesServer cubesServer) throws UnsupportedOperationException {
//throw new UnsupportedOperationException("Cannot set server");
}
示例11: getServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
@Override
public CubesServer getServer() {
return cubesServer;
}
示例12: renderIf4
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
private void renderIf4(){
if (!Branding.IS_DEBUG && cubesClient != null && cubesServer != null && cubesServer.isRunning()
&& CubesServer.lastUpdateTime() + 2500 < System.currentTimeMillis()) {
Adapter.gotoMenu(new UnresponsiveIntegratedServerMenu());
}
}
示例13: getServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
@Override
public CubesServer getServer() {
return cubesServer;
}
示例14: setServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
public static void setServer(CubesServer cubesServer) throws UnsupportedOperationException {
adapter.setServer(cubesServer);
}
示例15: getServer
import ethanjones.cubes.side.server.CubesServer; //导入依赖的package包/类
public static CubesServer getServer() {
return adapterInterface.getServer();
}