Commit 16c11df8 authored by fallenstardust's avatar fallenstardust

强制添加新增的服务器信息

revert strings.xml
parent 090ff567
......@@ -175,8 +175,9 @@ public interface Constants {
String URL_YGO233_FILE_ALT = "https://cdn02.moecube.com:444/ygopro-super-pre/archive/ygopro-super-pre.ypk";
String URL_YGO233_BUG_REPORT = "https://ygo233.com/pre#faq";
int PORT_Mycard_Super_Pre_Server = 888;
String URL_Mycard_Super_Pre_Server = "mygo2.superpre.pro";
//String URL_YGO233_2 = "s2.ygo233.com";
String URL_Mycard_Super_Pre_Server = "mygo.superpre.pro";
String URL_Mycard_Super_Pre_Server_2 = "mygo2.superpre.pro";
String PlayerName = "Knight of Hanoi";
String SERVER_FILE = "server_list.xml";
String SHARE_FILE = ".share_deck.png";
......
......@@ -159,7 +159,7 @@ public class ServerUtil {
}
}
if (serverName != null && (isHost(serverHost) || isValidIP(serverHost)) && isNumeric(serverPort)) {
AddServer(context, serverName, serverDesc, serverHost, Integer.valueOf(serverPort), "Knight of Hanoi");
AddServer(context, serverName, serverDesc, serverHost, Integer.valueOf(serverPort), Constants.PlayerName);
} else {
Log.w(TAG,"can't parse ex-server properly");
}
......@@ -211,16 +211,30 @@ public class ServerUtil {
return;
}
for (int i=0; i<assetList.getServerInfoList().size();i++) {
String assetName = assetList.getServerInfoList().get(i).getName();
String assetDesc = assetList.getServerInfoList().get(i).getDesc();
String assetAddr = assetList.getServerInfoList().get(i).getServerAddr();
int assetPort = assetList.getServerInfoList().get(i).getPort();
/*考虑到fileList的serverinfo其他信息被用户修改过,专门只比较域名地址和端口来视为相同的server来补充备注*/
for (int j=0; j<fileList.getServerInfoList().size();j++){
if (assetList.getServerInfoList().get(i).getServerAddr().equals(fileList.getServerInfoList().get(j).getServerAddr())
&& assetList.getServerInfoList().get(i).getPort() == (fileList.getServerInfoList().get(j).getPort())
&& !assetList.getServerInfoList().get(i).getDesc().equals(fileList.getServerInfoList().get(j).getDesc())) {
fileList.getServerInfoList().get(j).setDesc(assetList.getServerInfoList().get(i).getDesc());
String fileAddr = fileList.getServerInfoList().get(j).getServerAddr();
int filePort = fileList.getServerInfoList().get(j).getPort();
String fileDesc = fileList.getServerInfoList().get(j).getDesc();
//IP相同port相同则为已存在相同serverInfo
if (assetAddr.equals(fileAddr) && (assetPort == filePort)) {
if (!assetDesc.equals(fileDesc)) {
fileList.getServerInfoList().get(j).setDesc(assetDesc);
}
}
}
if (!fileList.getServerInfoList().contains(assetList.getServerInfoList().get(i))) {
AddServer(context, assetName, assetDesc, assetAddr, assetPort, Constants.PlayerName);
}
}
saveItems(context,xmlFile,fileList.getServerInfoList());
}
......@@ -284,7 +298,7 @@ public class ServerUtil {
}
public static boolean isPreServer(int port, String addr) {
return (port == Constants.PORT_Mycard_Super_Pre_Server && addr.equals(Constants.URL_Mycard_Super_Pre_Server));
return (port == Constants.PORT_Mycard_Super_Pre_Server && (addr.equals(Constants.URL_Mycard_Super_Pre_Server) || addr.equals(Constants.URL_Mycard_Super_Pre_Server_2)));
}
}
......@@ -369,7 +369,7 @@
<string name="tip_deckInfo_isNot_completeDeck">El deck actual se analiza de manera anormal y haremos todo lo posible para convertirlo en cartas existentes.</string>
<string name="tip_ygopro_is_running">Actualmente hay un duelo en ejecución y no se puede iniciar un nuevo duelo. La PSW de la sala se ha guardado en el historial. Finaliza el juego actual y luego selecciona el historial para unirte a la sala.</string>
<string name="Download_Precard_Failed">Falló la descarga de las cartas pre-lanzamiento</string>
<string name="Pre_Server_Name">Servidor Super-pre Mycard(2)</string>
<string name="Pre_Server_Name">Servidor Super-pre Mycard</string>
<string name="tip_ypk_is_deleted">Actualice las cartas pre-lanzadas de inmediato</string>
<string name="tip_superpre_desc">Actualización más rápida. Descargar expansiones</string>
</resources>
......
......@@ -273,7 +273,7 @@
<string name="Found_Update">新バージョン発見しました、ダウンロードしますか?</string>
<string name="Checking_Update_Failed">新バージョンチェック失敗</string>
<string name="Download_Precard_Failed">非公式データダウンロー失敗</string>
<string name="Pre_Server_Name">MYCARD超非公式サーバー(2)</string>
<string name="Pre_Server_Name">MYCARD超非公式サーバー</string>
<string name="Ask_to_Change_Other_Way">メインソースダウンロード失敗,他のダウンロード先を選択してください...</string>
<string name="DuelAssistant">デュエルアシスタント起動中</string>
<string name="masterrule">マスタールールを勉強します</string>
......
......@@ -359,7 +359,7 @@
<string name="tip_deckInfo_isNot_completeDeck">Card info Exception! Tried to become exsisted Card Info</string>
<string name="tip_ygopro_is_running">ygopro is running now. unable to create a new duel before it is closed. \nthe room password has been recorded in record list.\npls close ygopro and rejoin room through the record of room password</string>
<string name="Download_Precard_Failed">Download pre-cards failed</string>
<string name="Pre_Server_Name">Mycard Super-pre Server(2)</string>
<string name="Pre_Server_Name">Mycard Super-pre Server</string>
<string name="tip_ypk_is_deleted">Please upgrade pre-released cards at once</string>
<string name="tip_superpre_desc">Please upgrade pre-released cards at once</string>
</resources>
......@@ -273,7 +273,7 @@
<string name="Found_Update">发现新版本,前往下载?</string>
<string name="Checking_Update_Failed">检查更新失败</string>
<string name="Download_Precard_Failed">先行卡下载失败</string>
<string name="Pre_Server_Name">萌卡超先行服2区</string>
<string name="Pre_Server_Name">萌卡超先行服</string>
<string name="Ask_to_Change_Other_Way">主线获取失败,尝试备选线路中...</string>
<string name="DuelAssistant">决斗助手启用中</string>
<string name="masterrule">学习大师规则</string>
......
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