本文整理汇总了Java中ethanjones.cubes.core.system.Branding类的典型用法代码示例。如果您正苦于以下问题:Java Branding类的具体用法?Java Branding怎么用?Java Branding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Branding类属于ethanjones.cubes.core.system包,在下文中一共展示了Branding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: write
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public DataGroup write() {
DataGroup dataGroup = new DataGroup();
dataGroup.put("saveVersion", 0);
dataGroup.put("worldSeed", worldSeed);
dataGroup.put("worldSeedStr", worldSeedString);
dataGroup.put("worldTime", worldTime);
dataGroup.put("worldType", worldType);
dataGroup.put("worldGamemode", worldGamemode.name());
dataGroup.put("idManager", idManager);
dataGroup.put("lastOpenedTime", System.currentTimeMillis());
DataGroup version = dataGroup.getGroup("lastVersion");
version.put("major", Branding.VERSION_MAJOR);
version.put("minor", Branding.VERSION_MINOR);
version.put("point", Branding.VERSION_POINT);
version.put("build", Branding.VERSION_BUILD);
version.put("hash", Branding.VERSION_HASH);
return dataGroup;
}
示例2: initialConnect
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
private static void initialConnect(Socket javaSocket, NetJavaSocketImpl gdxSocket) throws Exception {
javaSocket.setSoTimeout(TIMEOUT);
DataInputStream dataInputStream = new DataInputStream(javaSocket.getInputStream());
byte b = dataInputStream.readByte();
DataOutputStream dataOutputStream = new DataOutputStream(javaSocket.getOutputStream());
dataOutputStream.writeInt(Branding.VERSION_MAJOR);
dataOutputStream.writeInt(Branding.VERSION_MINOR);
dataOutputStream.writeInt(Branding.VERSION_POINT);
dataOutputStream.writeInt(Branding.VERSION_BUILD);
dataOutputStream.writeUTF(Branding.VERSION_HASH);
switch (b) {
case 0:
connect(javaSocket, gdxSocket, dataOutputStream, dataInputStream);
return;
case 1:
ping(javaSocket, gdxSocket, dataOutputStream, dataInputStream);
return;
default:
throw new IOException("Unrecognised connection code " + b);
}
}
示例3: preInit
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
public static void preInit(AdapterInterface aI) {
if (preInit)
return;
preInit = true;
if (Compatibility.get() == null) {
Log.error(new CubesException("No Compatibility module for this platform: " + Gdx.app.getType().name()
+ ", OS: " + System.getProperty("os.name") + ", Arch:" + System.getProperty("os.arch")));
}
Cubes.adapterInterface = aI;
Compatibility.get().getBaseFolder().mkdirs();
Log.info(Branding.DEBUG); // Can't log till base folder setup
Log.info("https://github.com/ictrobot/Cubes");
Debug.printProperties();
Compatibility.get().logEnvironment();
Executor.init();
Assets.preInit();
}
示例4: write
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public DataGroup write() {
DataGroup dataGroup = new DataGroup();
dataGroup.put("saveVersion", 0);
dataGroup.put("worldSeed", worldSeed);
dataGroup.put("worldSeedStr", worldSeedString);
dataGroup.put("worldTime", worldTime);
dataGroup.put("worldType", worldType);
dataGroup.put("worldGamemode", worldGamemode.name());
dataGroup.put("idManager", idManager);
dataGroup.put("lastOpenedTime", System.currentTimeMillis());
DataGroup version = dataGroup.getGroup("lastVersion");
version.put("major", Branding.VERSION_MAJOR);
version.put("minor", Branding.VERSION_MINOR);
version.put("point", Branding.VERSION_POINT);
version.put("build", Branding.VERSION_BUILD);
version.put("hash", Branding.VERSION_HASH);
return dataGroup;
}
示例5: preInit
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
public static void preInit(AdapterInterface adapterInterface) {
if (preInit) return;
preInit = true;
if (Compatibility.get() == null) {
Log.error(new CubesException("No Compatibility module for this platform: " + Gdx.app.getType().name() + ", OS: " + System.getProperty("os.name") + ", Arch:" + System.getProperty("os.arch")));
}
Cubes.adapterInterface = adapterInterface;
Compatibility.get().getBaseFolder().mkdirs();
Log.info(Branding.DEBUG); //Can't log till base folder setup
Log.info("https://github.com/ictrobot/Cubes");
Debug.printProperties();
Compatibility.get().logEnvironment();
Executor.init();
Assets.preInit();
}
示例6: getBaseFolder
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public FileHandle getBaseFolder() {
FileHandle fileHandle = getWorkingFolder();
if (Branding.IS_DEBUG) {
fileHandle = fileHandle.child("server");
}
return fileHandle;
}
示例7: getBaseFolder
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
public FileHandle getBaseFolder() {
if (Adapter.isDedicatedServer()) return getWorkingFolder();
FileHandle homeDir = Gdx.files.absolute(System.getProperty("user.home"));
switch (os) {
case Windows:
return Gdx.files.absolute(System.getenv("APPDATA")).child(Branding.NAME);
case Mac:
return homeDir.child("Library").child("Application Support").child(Branding.NAME);
default:
return homeDir.child("." + Branding.NAME);
}
}
示例8: SplashMenu
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
public SplashMenu() {
logo = new Image(new TextureRegionDrawable(Assets.getTextureRegion("core:logo.png")), Scaling.fillY, Align.center);
text = new Label("Loading " + Branding.DEBUG, new Label.LabelStyle(Fonts.smallHUD, Color.WHITE));
stage.addActor(logo);
stage.addActor(text);
}
示例9: connect
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
public static void connect(com.badlogic.gdx.net.Socket gdxSocket) throws Exception {
Socket javaSocket = extractJavaSocket(gdxSocket);
DataOutputStream dataOutputStream = new DataOutputStream(javaSocket.getOutputStream());
dataOutputStream.writeByte(0); //0 is connect
javaSocket.setSoTimeout(TIMEOUT);
int serverMajor;
int serverMinor;
int serverPoint;
int serverBuild;
String serverHash;
try {
DataInputStream dataInputStream = new DataInputStream(javaSocket.getInputStream());
serverMajor = dataInputStream.readInt();
serverMinor = dataInputStream.readInt();
serverPoint = dataInputStream.readInt();
serverBuild = dataInputStream.readInt();
serverHash = dataInputStream.readUTF();
} catch (IOException e) {
if (e instanceof SocketTimeoutException) {
throw new IOException("Server did not respond in time", e);
} else {
throw e;
}
}
if (serverMajor == Branding.VERSION_MAJOR && serverMinor == Branding.VERSION_MINOR && serverPoint == Branding.VERSION_POINT) {
if (serverBuild == Branding.VERSION_BUILD) {
if (!serverHash.equals(Branding.VERSION_HASH)) {
Log.warning("Server reports the same build, but has a different hash");
} else {
Log.debug("Server is running exactly the same build");
}
} else {
Log.warning("Server is running build " + serverBuild);
}
} else {
String str = serverMajor + "." + serverMinor + "." + serverPoint;
throw new IOException("Server is running version " + str + " not " + Branding.VERSION_MAJOR_MINOR_POINT);
}
javaSocket.setSoTimeout(0);
}
示例10: handleCrash
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public boolean handleCrash(Throwable throwable) {
if (Branding.IS_DEBUG) return false; // don't open if in debug
return ClientCrashHandler.handle(getLog(FileLogWriter.file.getAbsolutePath()));
}
示例11: getBaseFolder
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public FileHandle getBaseFolder() {
return Gdx.files.external(Branding.NAME);
}
示例12: connect
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
/**
* connect
*
* @param gdxSocket
* @throws Exception
*/
public static void connect(com.badlogic.gdx.net.Socket gdxSocket) throws Exception {
Socket javaSocket = extractJavaSocket(gdxSocket);
DataOutputStream dataOutputStream = new DataOutputStream(javaSocket.getOutputStream());
dataOutputStream.writeByte(0); // 0 is connect
javaSocket.setSoTimeout(TIMEOUT);
int serverMajor;
int serverMinor;
int serverPoint;
int serverBuild;
String serverHash;
try {
DataInputStream dataInputStream = new DataInputStream(javaSocket.getInputStream());
serverMajor = dataInputStream.readInt();
serverMinor = dataInputStream.readInt();
serverPoint = dataInputStream.readInt();
serverBuild = dataInputStream.readInt();
serverHash = dataInputStream.readUTF();
} catch (IOException e) {
if (e instanceof SocketTimeoutException) {
throw new IOException("Server did not respond in time", e);
} else {
throw e;
}
}
if (serverMajor == Branding.VERSION_MAJOR && serverMinor == Branding.VERSION_MINOR
&& serverPoint == Branding.VERSION_POINT) {
if (serverBuild == Branding.VERSION_BUILD) {
if (!serverHash.equals(Branding.VERSION_HASH)) {
Log.warning("Server reports the same build, but has a different hash");
} else {
Log.debug("Server is running exactly the same build");
}
} else {
Log.warning("Server is running build " + serverBuild);
}
} else {
String str = serverMajor + "." + serverMinor + "." + serverPoint;
throw new IOException("Server is running version " + str + " not " + Branding.VERSION_MAJOR_MINOR_POINT);
}
javaSocket.setSoTimeout(0);
}
示例13: renderIf4
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
private void renderIf4(){
if (!Branding.IS_DEBUG && cubesClient != null && cubesServer != null && cubesServer.isRunning()
&& CubesServer.lastUpdateTime() + 2500 < System.currentTimeMillis()) {
Adapter.gotoMenu(new UnresponsiveIntegratedServerMenu());
}
}
示例14: call
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public LuaValue call() {
return LuaValue.valueOf(Branding.VERSION_MAJOR_MINOR_POINT);
}
示例15: getBaseFolder
import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public FileHandle getBaseFolder() {
return Gdx.files.external(Branding.NAME);
}