public string UpdateCorrectGuess(string id, string guess) { var game = new GameDB(); var result = game.UpdateCorrectGuess(id, guess); return(result); }
/// <summary> /// Prepares to categorize games. Prepares a list of genre categories to remove. Does nothing if removeothergenres is /// false. /// </summary> public override void PreProcess(GameList games, GameDB db) { base.PreProcess(games, db); _gamelist = games; _devList = Program.GameDB.CalculateSortedDevList(OwnedOnly ? _gamelist : null, MinCount); _pubList = Program.GameDB.CalculateSortedPubList(OwnedOnly ? _gamelist : null, MinCount); }
public void CreateGameTest() { //Arrange GameController gameController = new GameController(); IGameDBIF gameDB = new GameDB(); IGameTableDBIF gameTableDB = new GameTableDB(); List <GameTableModel> gameTables = (List <GameTableModel>)gameTableDB.GetAll(); GameTableModel gameTable = null; bool found = false; Game game = new Game(); //Act if (gameTables.Count > 0) { for (int i = 0; i < gameTables.Count && !found; i++) { if (gameController.GetByTableId(gameTables[i].Id) == null) { gameTable = gameTables[i]; found = true; } } game.gameTable = GameTableConverter.ConvertFromGameTableModelToGameTable(gameTable); gameController.CreateGame(game); } GameModel gameModel = gameController.GetByTableId(gameTable.Id); //Assert Assert.IsNotNull(gameModel); //Cleanup gameDB.Delete(gameModel); }
public string GetGame(int id) { var games = new GameDB(); var result = games.GetGame(id); return(result == null ? "{The requested item doesn't exist in database}" : result.ToString()); }
// Send login request void SendLoginRequest(string email, string password) { LogManager.General.Log("Login request..."); // Login RPC SendEncryptedLoginRequest(email, GameDB.EncryptPasswordString(password)); }
// Start void Start() { uLink.Network.publicKey = new uLink.PublicKey( @"r6tfUZ4YwT16YA4GGXN7xdd1A5rTIwSi5Yn6euIGK/Z0WrTkkgBVHnMtxFLtqmh8kh aUbPeoIIU5C/zwZitj5Ef7pd91LTrabTIDd4T9V/eMo2wHXfOxLJm6oC372pvMFQKL Cr4/8FWgrh1kGpVXYg3a5HzckLpC286Y7b07g7aAJJv/WcUJfuxtmR+0tN6eUs1evD qFK2VRdmlB9sWSpUDZ/5LGdWBof2MDLFBfKZ7pg/av6fXKrfufgXRHu/7sn/Awrysr 3Lt+Ajj3f/9pOE39mwIqioSUjBjXoh9N+zacGxv+iKlPOQsGMs8kqTpVHRrjUs8BHh uzf/lC9NYarw==", @"EQ=="); // Encryption uLink.Network.InitializeSecurity(true); // Init codecs for quick client test mode if (Login.instance == null) { GameDB.InitCodecs(); } // Set to desktop resolution //Screen.SetResolution(Screen.currentResolution.width, Screen.currentResolution.height, false); // Graphics settings UpdateGraphicsSettings(); }
/* * private ServerTime _serverTime; * public ServerTime ServerTime { get { return _serverTime; } } * * private ModelSyncService _modelSyncService; * public ModelSyncService ModelSyncService { get { return _modelSyncService; } } */ protected override IEnumerator ModuleInitializer() { Debug.Log("GameDbInitializer - ModuleInitializer start --------------------------------------------1"); _gameDB = new GameDB(); if (Application.loadedLevelName.Contains("Upload") && Application.isEditor) { _gameDB.InitLocalDB(); } else { _gameDB.InitDB(); } /* * _serverTime = new ServerTime(); * * _modelSyncService = new ModelSyncService(); * _modelSyncService.Init(_gameDB,this,_serverTime); * //yield return StartCoroutine(_modelSyncService.PregameConnect()); * //StartCoroutine(_modelSyncService.AsyncLoop()); * * _modelSyncService.Start(); * * yield return StartCoroutine(_modelSyncService.WaitForState(ModelSyncService.SyncLoopState.Connected)); */ CoreLogger.LogDebug("GameDbInitializer", "done with Init"); Debug.Log("GameDbInitializer - ModuleInitializer end --------------------------------------------2"); yield break; }
// Send register request void SendRegisterRequest(string email, string password) { accountPasswordEncrypted = GameDB.EncryptPasswordString(password); Lobby.RPC("LobbyRegisterAccount", Lobby.lobby, email, accountPasswordEncrypted); statusMessage = "Registering new account " + email + "..."; }
// GetAccountRecordCoroutine IEnumerator IAccountOperations.GetAccountRecordCoroutine(string accountName, Request <AccountRecord> request) { string gameAccountId = null; // Retrieve account ID yield return(GameDB.instance.StartCoroutine(GameDB.Get <string>( "AccountNameToID", accountName, data => { gameAccountId = data; } ))); if (gameAccountId == null) { StorageLayerUtility.RequestUtility.SetResult(request, null); yield break; } // Retrieve game account yield return(GameDB.instance.StartCoroutine(GameDB.Get <GameAccount>( "Accounts", gameAccountId, data => { if (data == null) { StorageLayerUtility.RequestUtility.SetResult(request, null); } else { StorageLayerUtility.RequestUtility.SetResult(request, data.ToAccountRecord()); } } ))); }
// CopyULobbyAccounts public static IEnumerator CopyULobbyAccounts() { var emailToIdBucket = new Bucket("uLobby AccountNameToID"); var request = emailToIdBucket.GetKeys(); yield return(request.WaitUntilDone()); if (request.hasFailed) { yield break; } foreach (var email in request.GetKeyEnumerable()) { emailToIdBucket.Get(email, Constants.Replication.Default, (req) => { var accountId = req.GetValue <string>(); LogManager.General.Log("Copying account '" + req.key + "' with ID '" + accountId + "'"); GameDB.instance.StartCoroutine( CreateAccount( accountId, req.key, GameDB.GetRandomString(10) ) ); }, null); } }
// Remove portal public static Coroutine RemovePortal(string accountId, GameDB.ActionOnResult<bool> func = null) { return GameDB.instance.StartCoroutine(GameDB.Remove( "AccountToPortal", accountId, func )); }
// -------------------------------------------------------------------------------- // AccountToItemInventory // -------------------------------------------------------------------------------- // Get item inventory public static Coroutine GetItemInventory(string accountId, GameDB.ActionOnResult <ItemInventory> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <ItemInventory>( "AccountToItemInventory", accountId, func ))); }
// -------------------------------------------------------------------------------- // AccountToArtifactTree // -------------------------------------------------------------------------------- // Get artifact tree public static Coroutine GetArtifactTree(string accountId, GameDB.ActionOnResult <ArtifactTree> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <ArtifactTree>( "AccountToArtifactTree", accountId, func ))); }
// Get guild public static Coroutine GetGuild(string guildId, GameDB.ActionOnResult <Guild> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <Guild>( "Guilds", guildId, func ))); }
// Get position public static Coroutine GetPosition(string accountId, GameDB.ActionOnResult<PlayerPosition> func) { return GameDB.instance.StartCoroutine(GameDB.Get<PlayerPosition>( "AccountToPosition", accountId, func )); }
// Is the account in the activation wait list? public static Coroutine GetAccountAwaitingActivation(string email, GameDB.ActionOnResult <string> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <string>( "AccountsAwaitingActivation", email, func ))); }
public void CountCountsCorrectType() { GameDB db = new GameDB(typeof(string), typeof(int)); db.AddRange(List("olof", "bjarnason")); db.AddRange(List(1, 2, 3)); Assert.AreEqual(2, db.Count(typeof(string))); Assert.AreEqual(3, db.Count(typeof(int))); }
// -------------------------------------------------------------------------------- // Guilds // -------------------------------------------------------------------------------- // Put guild public static Coroutine PutGuild(Guild guild, GameDB.PutActionOnResult <Guild> func) { return(GameDB.instance.StartCoroutine(GameDB.Put <Guild>( "Guilds", guild, func ))); }
// Get portal public static Coroutine GetPortal(string accountId, GameDB.ActionOnResult<PortalInfo> func) { return GameDB.instance.StartCoroutine(GameDB.Get<PortalInfo>( "AccountToPortal", accountId, func )); }
// Get portal public static Coroutine GetPortal(string accountId, GameDB.ActionOnResult <PortalInfo> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <PortalInfo>( "AccountToPortal", accountId, func ))); }
public void HowInheritageCountingWorks() { GameDB db = new GameDB(typeof(A), typeof(B)); db.AddRange(List(new A(), new A())); db.AddRange(List(new B())); Assert.AreEqual(3, db.Count(typeof(A))); Assert.AreEqual(1, db.Count(typeof(B))); }
// -------------------------------------------------------------------------------- // AccountToArtifactTree // -------------------------------------------------------------------------------- // Get artifact tree public static Coroutine GetArtifactTree(string accountId, GameDB.ActionOnResult<ArtifactTree> func) { return GameDB.instance.StartCoroutine(GameDB.Get<ArtifactTree>( "AccountToArtifactTree", accountId, func )); }
// -------------------------------------------------------------------------------- // AccountToCharacterCustomization // -------------------------------------------------------------------------------- // Get character customization public static Coroutine GetCharacterCustomization(string accountId, GameDB.ActionOnResult<CharacterCustomization> func) { return GameDB.instance.StartCoroutine(GameDB.Get<CharacterCustomization>( "AccountToCharacterCustomization", accountId, func )); }
// Remove position public static Coroutine RemovePosition(string accountId, GameDB.ActionOnResult <bool> func = null) { return(GameDB.instance.StartCoroutine(GameDB.Remove( "AccountToPosition", accountId, func ))); }
// Get guild invitations public static Coroutine GetGuildInvitations(string accountId, GameDB.ActionOnResult <List <string> > func) { return(GameDB.instance.StartCoroutine(GameDB.Get <List <string> >( "AccountToGuildInvitations", accountId, func ))); }
// -------------------------------------------------------------------------------- // AccountToSkillBuild // -------------------------------------------------------------------------------- // Get skill build public static void GetSkillBuild(string accountId, GameDB.ActionOnResult <SkillBuild> func) { GameDB.instance.StartCoroutine(GameDB.Get <SkillBuild>( "AccountToSkillBuild", accountId, func )); }
public Processor(Dispatcher dispatcher, GameDB gameDb, SettingsModel settings, IEventHandler eventHandler) { _degreeOfParallelism = 4; _dispatcher = dispatcher; _gameDb = gameDb; _settings = settings; _eventHandler = eventHandler; }
// Get friends public static Coroutine GetFriends(string accountId, GameDB.ActionOnResult <FriendsList> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <FriendsList>( "AccountToFriends", accountId, func ))); }
// Get country public static Coroutine GetCountry(string accountId, GameDB.ActionOnResult <string> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <string>( "AccountToCountry", accountId, func ))); }
public ActionResult DeleteConfirmed(int id) { GameDB gameDB = db.GameDBs.Find(id); db.GameDBs.Remove(gameDB); db.SaveChanges(); return(RedirectToAction("Index")); }
void OnDestroy() { if (_gameDB != null) { _gameDB.Terminate(); _gameDB = null; } }
// Get character stats public static Coroutine GetCharacterStats(string accountId, GameDB.ActionOnResult <CharacterStats> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <CharacterStats>( "AccountToCharacterStats", accountId, func ))); }
// Get experience public static Coroutine GetExperience(string accountId, GameDB.ActionOnResult <ExperienceEntry> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <ExperienceEntry>( "AccountToExperience", accountId, func ))); }
// Get payments list public static Coroutine GetPaymentsList(string accountId, GameDB.ActionOnResult <PaymentsList> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <PaymentsList>( "AccountToPayments", accountId, func ))); }
// Get location public static Coroutine GetLocation(string accountId, GameDB.ActionOnResult <PlayerLocation> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <PlayerLocation>( "AccountToLocation", accountId, func ))); }
// Get accounts public static Coroutine GetAccounts(string ip, GameDB.ActionOnResult <string[]> func) { return(GameDB.instance.StartCoroutine(GameDB.Get <string[]>( "IPToAccounts", ip, func ))); }
public PresentPickerWindow(GameDB gameDB) { _gameDB = gameDB; InitializeComponent(); lv_PaintList.ItemsSource = PaintList; lv_CarList.ItemsSource = CarList; Populate(); }
// -------------------------------------------------------------------------------- // AccountToPortal // -------------------------------------------------------------------------------- // Set portal public static Coroutine SetPortal(string accountId, PortalInfo portalInfo, GameDB.ActionOnResult<PortalInfo> func = null) { return GameDB.instance.StartCoroutine(GameDB.Set<PortalInfo>( "AccountToPortal", accountId, portalInfo, func )); }
// Set character customization public static void SetCharacterCustomization(string accountId, CharacterCustomization custom, GameDB.ActionOnResult<CharacterCustomization> func = null) { GameDB.instance.StartCoroutine(GameDB.Set<CharacterCustomization>( "AccountToCharacterCustomization", accountId, custom, func )); }
// Set position public static Coroutine SetPosition(string accountId, Vector3 vec, GameDB.ActionOnResult<PlayerPosition> func = null) { return GameDB.instance.StartCoroutine(GameDB.Set<PlayerPosition>( "AccountToPosition", accountId, new PlayerPosition(vec), func )); }
// Use this for initialization void Awake () { _instance = this; // ITEM CREATION Item i0 = gameObject.AddComponent<Item>(); i0.name = "Goladen Sword"; i0.type = Item.Type.equip; i0.sprite = sprites[0]; allItems.Add (i0); // ITEM CREATION Item i1 = gameObject.AddComponent<Item>(); i1.name = "Health Potion"; i1.type = Item.Type.consumable; i1.sprite = sprites[1]; allItems.Add (i1); // ITEM CREATION Item i2 = gameObject.AddComponent<Item>(); i2.name = "Rejuvenation Potion"; i2.type = Item.Type.consumable; i2.sprite = sprites[2]; allItems.Add (i2); // ITEM CREATION Item i3 = gameObject.AddComponent<Item>(); i3.name = "Bow"; i3.type = Item.Type.equip; i3.sprite = sprites[3]; allItems.Add (i3); // ITEM CREATION Item i4 = gameObject.AddComponent<Item>(); i4.name = "Iron"; i4.type = Item.Type.equip; i4.sprite = sprites[4]; allItems.Add (i4); SortAllItems (); }
public void AtLeastOneTypeNeeded() { GameDB db = new GameDB(); }
public void ObjectIsOK() { GameDB db = new GameDB(typeof(object)); }
public void Select_UnknownType() { GameDB db = new GameDB(typeof(string)); db.Select(typeof(int)); }
public void InterfaceIsOK() { GameDB db = new GameDB(typeof(IList<int>)); }
public void Select() { GameDB db = new GameDB(typeof(string)); List<object> exp = List("olof", "bjarnason"); db.AddRange(exp); List<string> res = new List<string>(); foreach(string s in db.Select(typeof(string))) res.Add(s); CollectionAssert.AreEqual(exp, res); }