Commit 4b74e797 authored by fallenstardust's avatar fallenstardust

移除修改版本号功能

parent 19863e3d
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
#define __CONFIG_H #define __CONFIG_H
#pragma once #pragma once
#define DEF_PRO_VERSION 0x1343
#ifndef __GAME_CONFIG #ifndef __GAME_CONFIG
#define _IRR_STATIC_LIB_ #define _IRR_STATIC_LIB_
#define IRR_COMPILE_WITH_DX9_DEV_PACK #define IRR_COMPILE_WITH_DX9_DEV_PACK
...@@ -112,7 +109,7 @@ using namespace io; ...@@ -112,7 +109,7 @@ using namespace io;
using namespace gui; using namespace gui;
using namespace os; using namespace os;
extern unsigned short PRO_VERSION; extern const unsigned short PRO_VERSION;
extern int enable_log; extern int enable_log;
extern bool exit_on_return; extern bool exit_on_return;
extern bool bot_mode; extern bool bot_mode;
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <COGLESDriver.h> #include <COGLESDriver.h>
#endif #endif
unsigned short PRO_VERSION = DEF_PRO_VERSION; const unsigned short PRO_VERSION = 0x1343;
namespace ygo { namespace ygo {
...@@ -40,7 +40,6 @@ bool Game::Initialize() { ...@@ -40,7 +40,6 @@ bool Game::Initialize() {
srand(time(0)); srand(time(0));
irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters(); irr::SIrrlichtCreationParameters params = irr::SIrrlichtCreationParameters();
#ifdef _IRR_ANDROID_PLATFORM_ #ifdef _IRR_ANDROID_PLATFORM_
PRO_VERSION = android::getIntSetting(app, "game_version", PRO_VERSION);
android::InitOptions *options = android::getInitOptions(app); android::InitOptions *options = android::getInitOptions(app);
glversion = options->getOpenglVersion(); glversion = options->getOpenglVersion();
if (glversion == 0) { if (glversion == 0) {
...@@ -1582,7 +1581,6 @@ void Game::RefreshBot() { ...@@ -1582,7 +1581,6 @@ void Game::RefreshBot() {
void Game::LoadConfig() { void Game::LoadConfig() {
wchar_t wstr[256]; wchar_t wstr[256];
if(gameConf._init)return; if(gameConf._init)return;
PRO_VERSION = android::getIntSetting(appMain, "game_version", PRO_VERSION);
gameConf._init = TRUE; gameConf._init = TRUE;
gameConf.antialias = 1; gameConf.antialias = 1;
gameConf.serverport = 7911; gameConf.serverport = 7911;
......
...@@ -6,12 +6,6 @@ IRRLICHT_PROJECT_PATH := $(LOCAL_PATH) ...@@ -6,12 +6,6 @@ IRRLICHT_PROJECT_PATH := $(LOCAL_PATH)
#LOCAL_SRC_FILES := $(IRRLICHT_PROJECT_PATH)/../irrlicht/lib/Android/$(TARGET_ARCH_ABI)/libIrrlicht.a #LOCAL_SRC_FILES := $(IRRLICHT_PROJECT_PATH)/../irrlicht/lib/Android/$(TARGET_ARCH_ABI)/libIrrlicht.a
#include $(PREBUILT_STATIC_LIBRARY) #include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := game_version
LOCAL_SRC_FILES := $(LOCAL_PATH)/jni/version.cpp
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := YGOMobile LOCAL_MODULE := YGOMobile
......
#define __GAME_CONFIG
#include <jni.h>
#include "../Classes/gframe/config.h"
extern "C" {
JNIEXPORT jint JNICALL Java_cn_garymb_ygomobile_core_GameConfig_getGameVersion(
JNIEnv* env, jclass clazz) {
return (jint)DEF_PRO_VERSION;
}
}
...@@ -888,3 +888,5 @@ ...@@ -888,3 +888,5 @@
!setname 0x114 空牙团 空牙団 !setname 0x114 空牙团 空牙団
!setname 0x115 闪刀 閃刀 !setname 0x115 闪刀 閃刀
!setname 0x1115 闪刀姬 閃刀姫 !setname 0x1115 闪刀姬 閃刀姫
!setname 0x116 圣像骑士 パラディオン
!setname 0x117 魔神仪 魔神儀
\ No newline at end of file
...@@ -9,8 +9,8 @@ android { ...@@ -9,8 +9,8 @@ android {
applicationId "cn.garymb.ygomobile" applicationId "cn.garymb.ygomobile"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 31090421 versionCode 32010424
versionName "3.1.9" versionName "3.2.1"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
ndk { ndk {
abiFilters "armeabi-v7a", "x86" abiFilters "armeabi-v7a", "x86"
......
...@@ -433,24 +433,23 @@ public class AppsSettings { ...@@ -433,24 +433,23 @@ public class AppsSettings {
} }
return v; return v;
} }
/* public int resetGameVersion() {
public int resetGameVersion() { * int version = GameConfig.getVersion();
int version = GameConfig.getVersion(); * if (getIntSettings(Constants.PREF_GAME_VERSION, 0) == 0) {
if (getIntSettings(Constants.PREF_GAME_VERSION, 0) == 0) { * //用户没设置过版本号
//用户没设置过版本号 * return version;
return version; * }
} * saveIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
saveIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion()); * return version;
return version; * }
} *
* public int getGameVersion() {
public int getGameVersion() { * return getIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion());
return getIntSettings(Constants.PREF_GAME_VERSION, GameConfig.getVersion()); *}
} *
* public void setGameVersion(int v) {
public void setGameVersion(int v) { * saveIntSettings(Constants.PREF_GAME_VERSION, v);
saveIntSettings(Constants.PREF_GAME_VERSION, v); }*/
}
public String getVersionString(int value) { public String getVersionString(int value) {
int last = (value & 0xf); int last = (value & 0xf);
...@@ -459,7 +458,7 @@ public class AppsSettings { ...@@ -459,7 +458,7 @@ public class AppsSettings {
return String.format("%X.%03X.%X", b, m, last); return String.format("%X.%03X.%X", b, m, last);
} }
public int getVersionValue(String str) { /* public int getVersionValue(String str) {
str = str.trim().toLowerCase(Locale.US); str = str.trim().toLowerCase(Locale.US);
int v = -1; int v = -1;
if(str.contains(".")){ if(str.contains(".")){
...@@ -485,7 +484,7 @@ public class AppsSettings { ...@@ -485,7 +484,7 @@ public class AppsSettings {
} }
} }
return v; return v;
} }*/
public void saveSettings(String key, String value) { public void saveSettings(String key, String value) {
if ("lastdeck".equals(key)) { if ("lastdeck".equals(key)) {
......
...@@ -115,11 +115,11 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> { ...@@ -115,11 +115,11 @@ public class ResCheckTask extends AsyncTask<Void, Integer, Integer> {
AppsSettings.get().setUseExtraCards(false); AppsSettings.get().setUseExtraCards(false);
} }
} }
if (needsUpdate) { /* if (needsUpdate) {
if(AppsSettings.get().resetGameVersion() == 0){ * if(AppsSettings.get().resetGameVersion() == 0){
VUiKit.show(mContext, mContext.getString(R.string.reset_game_ver_fail)); * VUiKit.show(mContext, mContext.getString(R.string.reset_game_ver_fail));
} * }
} * }*/
//设置字体 //设置字体
new ConfigManager(mSettings.getSystemConfig()).setFontSize(mSettings.getFontSize()); new ConfigManager(mSettings.getSystemConfig()).setFontSize(mSettings.getFontSize());
// copyCoreConfig(new File(mSettings.getResourcePath(), GameSettings.CORE_CONFIG_PATH).getAbsolutePath()); // copyCoreConfig(new File(mSettings.getResourcePath(), GameSettings.CORE_CONFIG_PATH).getAbsolutePath());
......
...@@ -79,7 +79,7 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -79,7 +79,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
addPreferencesFromResource(R.xml.preference_game); addPreferencesFromResource(R.xml.preference_game);
bind(PREF_GAME_PATH, mSettings.getResourcePath()); bind(PREF_GAME_PATH, mSettings.getResourcePath());
bind(PREF_GAME_VERSION, mSettings.getVersionString(mSettings.getGameVersion())); // bind(PREF_GAME_VERSION, mSettings.getVersionString(mSettings.getGameVersion()));
bind(PREF_SOUND_EFFECT, mSettings.isSoundEffect()); bind(PREF_SOUND_EFFECT, mSettings.isSoundEffect());
bind(PREF_LOCK_SCREEN, mSettings.isLockSreenOrientation()); bind(PREF_LOCK_SCREEN, mSettings.isLockSreenOrientation());
bind(PREF_FONT_ANTIALIAS, mSettings.isFontAntiAlias()); bind(PREF_FONT_ANTIALIAS, mSettings.isFontAntiAlias());
...@@ -108,7 +108,7 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -108,7 +108,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
public boolean onPreferenceChange(Preference preference, Object value) { public boolean onPreferenceChange(Preference preference, Object value) {
super.onPreferenceChange(preference, value); super.onPreferenceChange(preference, value);
if (!isInit) { if (!isInit) {
if (PREF_GAME_VERSION.equals(preference.getKey())) { /*if (PREF_GAME_VERSION.equals(preference.getKey())) {
int v = AppsSettings.get().getVersionValue(value.toString()); int v = AppsSettings.get().getVersionValue(value.toString());
if (v > 0 && v <= AppsSettings.get().getVersionValue("0xF99F")) { if (v > 0 && v <= AppsSettings.get().getVersionValue("0xF99F")) {
mSettings.setGameVersion(v); mSettings.setGameVersion(v);
...@@ -122,7 +122,7 @@ public class SettingFragment extends PreferenceFragmentPlus { ...@@ -122,7 +122,7 @@ public class SettingFragment extends PreferenceFragmentPlus {
} }
return false; return false;
} }
} }*/
if (PREF_FONT_SIZE.equals(preference.getKey())) { if (PREF_FONT_SIZE.equals(preference.getKey())) {
int size = Constants.DEF_PREF_FONT_SIZE; int size = Constants.DEF_PREF_FONT_SIZE;
try { try {
......
...@@ -5,11 +5,7 @@ ...@@ -5,11 +5,7 @@
<Preference <Preference
android:key="pref_key_game_res_path" android:key="pref_key_game_res_path"
android:persistent="true" android:persistent="true"
android:title="@string/settings_game_res_path"/> android:title="@string/settings_game_res_path"
<EditTextPreference
android:key="game_version"
android:persistent="true"
android:title="@string/game_version"
/> />
<ListPreference <ListPreference
android:entries="@array/opengl_version" android:entries="@array/opengl_version"
......
...@@ -6,7 +6,7 @@ import java.util.Locale; ...@@ -6,7 +6,7 @@ import java.util.Locale;
public class A { public class A {
@Test /*@Test
public void testVersion() { public void testVersion() {
System.out.println(getVersionString(0x233E)); System.out.println(getVersionString(0x233E));
System.out.println(getVersionString(0xF99F)); System.out.println(getVersionString(0xF99F));
...@@ -15,7 +15,7 @@ public class A { ...@@ -15,7 +15,7 @@ public class A {
System.out.println(getVersionValue("1.034.00")); System.out.println(getVersionValue("1.034.00"));
System.out.println(getVersionValue("1.034.0")); System.out.println(getVersionValue("1.034.0"));
System.out.println(getVersionString(4928)); System.out.println(getVersionString(4928));
} }*/
public String getVersionString(int value) { public String getVersionString(int value) {
int last = (value & 0xf); int last = (value & 0xf);
...@@ -24,7 +24,7 @@ public class A { ...@@ -24,7 +24,7 @@ public class A {
return String.format("%X.%03X.%X", b, m, last); return String.format("%X.%03X.%X", b, m, last);
} }
public int getVersionValue(String str) { /*public int getVersionValue(String str) {
str = str.trim().toLowerCase(Locale.US); str = str.trim().toLowerCase(Locale.US);
int v = -1; int v = -1;
if(str.contains(".")){ if(str.contains(".")){
...@@ -50,5 +50,5 @@ public class A { ...@@ -50,5 +50,5 @@ public class A {
} }
} }
return v; return v;
} }*/
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment