本文整理汇总了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);
}
示例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);
}