private void Button1_Click(object sender, EventArgs e) { try { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); Encoding enc = Encoding.GetEncoding("shift_jis"); string str = textBox1.Text; if (str.Length >= 1 && !IsUnicode(str)) { int cnt = 0; int count = 0; string[] strs = new string[255]; int i = GetStrToNum(str); while (count < 255 && cnt < 10000) { cnt++; byte[] data = BitConverter.GetBytes(i); string s = enc.GetString(data); int seed = TreasureCalc.GetServerSeed(s[0]); if (strs[seed] == null) { strs[seed] = "" + s[0]; count++; } i += cnt % 256 == 0 ? 1 : 0x100; //if ((seed == 177 && s[0] != '・')) //{ // MessageBox.Show("seed:" + seed + " : " + s); //} } if (count != 255) { Close(); MessageBox.Show("失敗!" + count); return; } string fileName = Form1.dirName + Form1.charListName; File.WriteAllLines(fileName, strs); Close(); MessageBox.Show("完了!"); } } catch (Exception ex) { Close(); Form1.ErrorEvent("エラーが発生しました", ex); } }
private void WorldSeed_TextChanged(object sender, EventArgs e) { string text = worldSeedText.Text; if (text.Length >= 1 && !changeFlag) { changeFlag = true; worldSeedNum.Value = TreasureCalc.GetServerSeed(text[0]); changeFlag = false; } }