当前位置: 首页>>代码示例>>Java>>正文


Java Branding类代码示例

本文整理汇总了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;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:23,代码来源:SaveOptions.java

示例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);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:22,代码来源:ServerConnectionInitializer.java

示例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();

}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:23,代码来源:Cubes.java

示例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;
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:23,代码来源:SaveOptions.java

示例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();

}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:21,代码来源:Cubes.java

示例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;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:9,代码来源:ServerCompatibility.java

示例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);
  }
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:13,代码来源:DesktopCompatibility.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:8,代码来源:SplashMenu.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:41,代码来源:ClientConnectionInitializer.java

示例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()));
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:6,代码来源:ClientCompatibility.java

示例11: getBaseFolder

import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public FileHandle getBaseFolder() {
	return Gdx.files.external(Branding.NAME);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:AndroidCompatibility.java

示例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);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:48,代码来源:ClientConnectionInitializer.java

示例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());
	}
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:7,代码来源:ClientAdapter.java

示例14: call

import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public LuaValue call() {
	return LuaValue.valueOf(Branding.VERSION_MAJOR_MINOR_POINT);
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:5,代码来源:LuaMappingCubes.java

示例15: getBaseFolder

import ethanjones.cubes.core.system.Branding; //导入依赖的package包/类
@Override
public FileHandle getBaseFolder() {
  return Gdx.files.external(Branding.NAME);
}
 
开发者ID:RedTroop,项目名称:Cubes,代码行数:5,代码来源:AndroidCompatibility.java


注:本文中的ethanjones.cubes.core.system.Branding类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。