void LoadConfigFile() { if (!File.Exists(Application.persistentDataPath + "/Config.xml")) { TextAsset txt = Resources.Load <TextAsset>("Configs/Config"); byte[] DataInfo = txt.bytes; using (FileStream fs = new FileStream(Application.persistentDataPath + "/Config.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { fs.Write(DataInfo, 0, DataInfo.Length); } } XmlDocument xml = new XmlDocument(); xml.Load(Application.persistentDataPath + "/Config.xml"); XmlNode ip = xml.SelectSingleNode("data/SeverIP"); Debug.Log("当前列表服务器IP:" + ip.InnerText); OutLog.Log("当前列表服务器IP:" + ip.InnerText); GameInfo.listIp = ip.InnerText; XmlNode port = xml.SelectSingleNode("data/SeverPort"); Debug.Log("当前列表服务器prot:" + port.InnerText); OutLog.Log("当前列表服务器prot:" + port.InnerText); GameInfo.listPort = port.InnerText; }
public void ChangeOutlogStatus() { if (_outLog.enabled) { _outLog.enabled = false; } else { _outLog.enabled = true; OutLog.Log("enable outlog"); } }
private IEnumerator Upload(string str1, string str2, byte[] bytes) { WWWForm wwwf = new WWWForm(); wwwf.AddField(str2, str1); wwwf.AddBinaryData(str2, bytes, str1); WWW www = new WWW("http://download.gzqyrj.com/api/obj.ashx", wwwf); yield return(www); if (!string.IsNullOrEmpty(www.error)) { FICWaringPanel._instance.Show("上传错误"); Debug.Log(www.error); OutLog.Log(www.error); } else { FICWaringPanel._instance.Show("上传成功"); } }
void LoadConfigFile() { if (!File.Exists(Application.persistentDataPath + "/Config.xml")) { TextAsset txt = Resources.Load <TextAsset>("Configs/Config"); byte[] DataInfo = txt.bytes; using (FileStream fs = new FileStream(Application.persistentDataPath + "/Config.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite)) { fs.Write(DataInfo, 0, DataInfo.Length); } } XmlDocument xml = new XmlDocument(); xml.Load(Application.persistentDataPath + "/Config.xml"); XmlNode ip = xml.SelectSingleNode("/data/SeverIP"); Debug.Log("当前列表服务器IP:" + ip.InnerText); OutLog.Log("当前列表服务器IP:" + ip.InnerText); //GameInfo.listIp = ip.InnerText; //10.10.20.82 //GameInfo.listIp = "47.104.183.97"; GameInfo.listIp = "192.168.1.100"; //XmlNode port = xml.SelectSingleNode("data/SeverPort"); XmlNode port = xml.SelectSingleNode("data/SeverPort"); Debug.Log("当前列表服务器prot:" + port.InnerText); OutLog.Log("当前列表服务器prot:" + port.InnerText); //GameInfo.listPort = port.InnerText; GameInfo.listPort = "2018"; XmlNode certificat = xml.SelectSingleNode("data/Certificate"); GameInfo.certificate = certificat.InnerText; OutLog.log("读取证书:" + GameInfo.certificate); }