コード例 #1
0
        private static void SavePlayer(int index)
        {
            var pData   = Players[index];
            var db      = new CharacterDB();
            var dbError = db.Open();

            if (dbError.Number != 0)
            {
                Global.WriteLog(LogType.System, $"Cannot connect to database", LogColor.Red);
                Global.WriteLog(LogType.System, $"Error Number: {dbError.Number}", LogColor.Red);
                Global.WriteLog(LogType.System, $"Error Message: {dbError.Message}", LogColor.Red);
            }
            else
            {
                db.UpdateCharacter(pData);
                db.Close();
            }
        }
コード例 #2
0
 /// <summary>
 /// Fecha a conexão com o banco de dados.
 /// </summary>
 public void Close()
 {
     db.Close();
 }