public Client(byte[] privateKey) { this.privateKey = privateKey; this.recvKeyOffset = 0; this.sendKeyOffset = 0; DecodeType = DECODE_TYPE.XOR; EncodeType = ENCODE_TYPE.XOR; this.status = STATUS.Connected; this.numberOfLoginTry = 0; userID = -1; playerList = new Dictionary <int, Database.Player>(); }
public static void WriteString(string filePath, string content, ENCODE_TYPE encodeType = ENCODE_TYPE.UTF8) { MakeDirs(filePath, true); Encoding encode = null; if (encodeType == ENCODE_TYPE.DEFAULT) { encode = Encoding.Default; } else if (encodeType == ENCODE_TYPE.UTF8BOM) { encode = new UTF8Encoding(true); } else { encode = new UTF8Encoding(false); } File.WriteAllText(filePath, content, encode); }
public static string ReadString(string filePath, ENCODE_TYPE encodeType = ENCODE_TYPE.UTF8) { if (!File.Exists(filePath)) { return(null); } Encoding encode = null; if (encodeType == ENCODE_TYPE.DEFAULT) { encode = Encoding.Default; } else { encode = Encoding.UTF8; } return(File.ReadAllText(filePath, encode)); }