Exemplo n.º 1
0
 public static RemoteSqlServerService GetService()
 {
     lock (lockhelper)
     {
         if (sqlServerService == null)
         {
             sqlServerService = new RemoteSqlServerService();
         }
         return(sqlServerService);
     }
 }
Exemplo n.º 2
0
        public GameScore TrySync()
        {
            if (this.LoginedAccount == null)
            {
                return(null);
            }
            bool   onlineNewest;
            var    sqliteserver = SqliteService.GetService();
            var    sqlserver    = RemoteSqlServerService.GetService();
            var    score        = sqliteserver.QueryScore($"where userid={sqlserver.LoginedAccount.UserID}");
            string cmdString    = sqlserver.SyncScore(score, out onlineNewest);

            if (onlineNewest)
            {
                sqliteserver.ExecuteNonQuery(cmdString);
            }
            return(sqliteserver.QueryScore($"where userid={sqlserver.LoginedAccount.UserID}"));
        }