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


Java Branding.VERSION_POINT属性代码示例

本文整理汇总了Java中ethanjones.cubes.core.system.Branding.VERSION_POINT属性的典型用法代码示例。如果您正苦于以下问题:Java Branding.VERSION_POINT属性的具体用法?Java Branding.VERSION_POINT怎么用?Java Branding.VERSION_POINT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在ethanjones.cubes.core.system.Branding的用法示例。


在下文中一共展示了Branding.VERSION_POINT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: connect

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,代码行数:40,代码来源:ClientConnectionInitializer.java

示例2: connect

/**
 * 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,代码行数:47,代码来源:ClientConnectionInitializer.java


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