Пример #1
0
        public static GameResults InsertGameResult(String UserName, String Password, GameListEnum gameType, int Score, decimal TestDuration, int Total)
        {
            GameResults results = new GameResults();
            try
            {
                LoginResult loginResult = LoginResult.ValidateLogin(UserName, Password, String.Empty);
                if (loginResult.Success)
                {
                    AgileMindEntities db = new AgileMindEntities();
                    t_GameResults gameResults = new t_GameResults();
                    gameResults.Created = DateTime.Now;
                    gameResults.GameId = (int)gameType;
                    gameResults.LoginId = loginResult.LoginInfo.LoginId;
                    gameResults.Score = Score;
                    gameResults.TestDuration = TestDuration;
                    gameResults.Total = Total;
                    db.t_GameResults.AddObject(gameResults);
                    db.SaveChanges();

                    results.Success = true;
                    results.Game = gameResults;

                }
                else
                {
                    results.Error = "Could not login.  Invalid Username/Password";
                }

            }
            catch (Exception ex)
            {
                results.Error = ex.Message;
            }
            return results;
        }
Пример #2
0
 public UserProfile(string n, GameListEnum gameId, bool usesPrivateSaves, string dir, ulong id)
 {
     Name             = n;
     PrivateSaves     = usesPrivateSaves;
     GameId           = gameId;
     ProfileDirectory = dir;
     ProfileId        = id;
 }
 public GameApplication(string n, string exe, GameListEnum game)
 {
     Name                 = n;
     ExecutablePath       = exe;
     AssociatedGameId     = game;
     _backups             = new List <BackupFile>();
     _directoriesToDelete = new List <string>();
     _linksToDelete       = new List <string>();
 }
Пример #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="iPath">Installation path</param>
        /// <param name="dPath">Game data path (to which you install mods)</param>
        /// <param name="exePath">Executable path</param>
        /// <param name="n">Full name of the game</param>
        /// <param name="nApi">Name of the game in Nexus Mods' API</param>
        /// <param name="nReg">Display name of the game in the registry (under Uninstall)</param>
        /// <param name="id">Nexus Mods' generated ID for the game</param>
        public Game(string iPath, string dPath, string ePath, string n,
                    string nApi, string nNxm, string nReg, GameListEnum id, IDictionary <string, string> exes, string pluginExt)
        {
            Name             = n;
            InstallationPath = iPath;
            DataPath         = dPath;
            ExecutablePath   = ePath;
            Name_API         = nApi;
            Name_Nexus       = nNxm;
            Id                  = id;
            Name_Registry       = nReg;
            KnownExecutables    = exes;
            PluginFileExtension = pluginExt;

            string idAsString = Id.ToString();

            ModsDirectory      = InstallationPath[0] + ":\\EMM\\Mods\\" + idAsString;
            DownloadsDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\EMM\\Downloads\\" + idAsString;
            ProfilesDirectory  = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\EMM\\Profiles\\" + idAsString;
            BackupsDirectory   = InstallationPath[0] + ":\\EMM\\Backups\\" + idAsString;
        }
Пример #5
0
        public Mod(string n, string fileN, bool active, bool installed, string source, string modDir, string dlDir, GameListEnum gameId, ModCategories category, string fileId, int priority,
                   string version = Defined.DEFAULTMODVERSION, string id = Defined.DEFAULTMODID, string author = Defined.DEFAULTMODAUTHOR, string srcUri = Defined.DEFAULTSOURCEURI,
                   bool isOn      = false)
        {
            Name              = n;
            IsOnline          = isOn;
            ModFileName       = fileN;
            Active            = active;
            Installed         = installed;
            SourceArchive     = source;
            ModDirectory      = modDir;
            DownloadDirectory = dlDir;
            GameId            = gameId;
            ModCategory       = category;
            FileId            = fileId;
            Version           = version;
            Id            = id;
            Author        = author;
            FullSourceUri = srcUri;
            Priority      = priority;

            FileTree = BinaryNode.GetDirectoryTree(ModDirectory);
        }
Пример #6
0
        public static GameResults InsertGameResultLoginId(String UserName, GameListEnum gameType, int Score, decimal TestDuration, int Total)
        {
            GameResults results = new GameResults();
            try
            {

                AgileMindEntities db = new AgileMindEntities();
                vwLoginInfo login = (from data in db.vwLoginInfoes where data.LoginName == UserName select data).Single();

                if (login != null)
                {
                    t_GameResults gameResults = new t_GameResults();
                    gameResults.Created = DateTime.Now;
                    gameResults.GameId = (int)gameType;
                    gameResults.LoginId = login.LoginId;
                    gameResults.Score = Score;
                    gameResults.TestDuration = TestDuration;
                    gameResults.Total = Total;
                    db.t_GameResults.AddObject(gameResults);
                    db.SaveChanges();

                    results.Success = true;
                    results.Game = gameResults;

                }
                else
                {
                    results.Error = "Could not login.  Invalid Username/Password";
                }

            }
            catch (Exception ex)
            {
                results.Error = ex.Message;
            }
            return results;
        }
Пример #7
0
        public static IGameDefault GetGameDefault(GameListEnum id)
        {
            switch (id)
            {
            case GameListEnum.SkyrimSE:
                return(new Default_SkyrimSE());

            case GameListEnum.Skyrim:
                return(new Default_Skyrim());

            case GameListEnum.Oblivion:
                //return new Default_Oblivion();
                return(null);

            case GameListEnum.Witcher3:
                return(null);

            case GameListEnum.FalloutNV:
                return(new Default_FalloutNV());

            case GameListEnum.Fallout4:
                return(null);

            case GameListEnum.Fallout3:
                return(null);

            case GameListEnum.DragonAge2:
                return(null);

            case GameListEnum.DragonAgeOrigins:
                return(null);

            default:
                return(null);
            }
        }
Пример #8
0
 /// <remarks/>
 public void InsertGameResultWebAsync(string UserName, GameListEnum gameType, int Score, decimal TestDuration, int Total, object userState) {
     if ((this.InsertGameResultWebOperationCompleted == null)) {
         this.InsertGameResultWebOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInsertGameResultWebOperationCompleted);
     }
     this.InvokeAsync("InsertGameResultWeb", new object[] {
                 UserName,
                 gameType,
                 Score,
                 TestDuration,
                 Total}, this.InsertGameResultWebOperationCompleted, userState);
 }
Пример #9
0
 /// <remarks/>
 public void InsertGameResultWebAsync(string UserName, GameListEnum gameType, int Score, decimal TestDuration, int Total) {
     this.InsertGameResultWebAsync(UserName, gameType, Score, TestDuration, Total, null);
 }
Пример #10
0
 public GameResults InsertGameResultWeb(string UserName, GameListEnum gameType, int Score, decimal TestDuration, int Total) {
     object[] results = this.Invoke("InsertGameResultWeb", new object[] {
                 UserName,
                 gameType,
                 Score,
                 TestDuration,
                 Total});
     return ((GameResults)(results[0]));
 }
 public DatabaseContext_Profile(string profileDir, GameListEnum gameId) :
     base(profileDir + $@"\EMM.db4")
 {
     GameId = GameId;
     GetCollection <Mod>("mods").EnsureIndex(x => x.FileId);
 }
 public GameResults InsertGameResultWeb(String UserName, GameListEnum gameType, int Score, decimal TestDuration, int Total)
 {
     return GameResults.InsertGameResultLoginId(UserName, gameType, Score, TestDuration, Total);
 }
 public GameResults InsertGameResult(String UserName, String Password, GameListEnum gameType, int Score, decimal TestDuration, int Total)
 {
     return GameResults.InsertGameResult(UserName, Password, gameType, Score, TestDuration, Total);
 }
        public JsonResult InsertGameResult(String UserName, String Password, GameListEnum gameType, int Score, decimal TestDuration, int Total)
        {
            JsonResult jsonResult = new JsonResult();

            GameResults result = GameResults.InsertGameResult(UserName, Password, gameType, Score, TestDuration, Total);

            jsonResult = Json(result, JsonRequestBehavior.AllowGet);
            return jsonResult;
        }