/// <summary>
        /// Apaga o usuário.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void strip_delete_Click(object sender, EventArgs e)
        {
            if (pData.ID == 0)
            {
                DarkMessageBox.ShowInformation("Você precisa carregar um usuário para fazer essa ação.", "Aviso");
                return;
            }

            var result = DarkMessageBox.ShowWarning("Deseja realmente apagar este usuário?", "Aviso", DarkDialogButton.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }

            if (AccountDB.DeleteAccountData(pData.ID) > 0)
            {
                DarkMessageBox.ShowInformation("Usuário deletado.", "Aviso");

                CharacterDB.DeleteAllCharacter(pData.ID);

                Clear();
                pData.Clear();
                return;
            }

            DarkMessageBox.ShowWarning("Não foi possível fazer a exclusão.", "Aviso");
        }
        /// <summary>
        /// Deleta o personagem.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void strip_delete_Click(object sender, EventArgs e)
        {
            if (pData.ID == 0)
            {
                return;
            }

            var result = DarkMessageBox.ShowWarning("Deseja realmente apagar o personagem?", "Aviso", DarkDialogButton.YesNo);

            if (result == DialogResult.No)
            {
                return;
            }

            if (CharacterDB.DeleteCharacter(pData.ID) > 0)
            {
                DarkMessageBox.ShowInformation("O personagem foi deletado.", "Aviso");

                //carrega novamente os nomes dos personagens.
                Program.AccountForm.FillPlayerNames();

                Close();
            }
            else
            {
                DarkMessageBox.ShowWarning("Não foi possível fazer a exclusão.", "Aviso");
            }
        }
        /// <summary>
        /// Salva as alterações do personagem.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void strip_save_Click(object sender, EventArgs e)
        {
            if (txt_name.Text.Trim().Length < 4)
            {
                DarkMessageBox.ShowInformation("O nome de personagem precisa ser maior que 4 caracteres.", "Aviso");
                return;
            }

            //verifica todos os campos
            VerifyTextbox();

            //se não há classes, sai do metodo
            if (Static.Classes.Count == 0)
            {
                return;
            }

            //preenche os dados
            FillCharacterData();


            if (CharacterDB.SaveCharacterData(pData) > 0)
            {
                DarkMessageBox.ShowInformation("O personagem foi salvo.", "Aviso");

                //carrega novamente os nomes dos personagens.
                Program.AccountForm.FillPlayerNames();
            }
            else
            {
                DarkMessageBox.ShowWarning("Não foi possível salvar as informações.", "Aviso");
            }
        }
        public ActionResult <object> InsertCharacter(string discordId, string userName)
        {
            CharacterDB characterDB = new CharacterDB();
            var         character   = characterDB.InsertCharacter(discordId, userName);

            return(JsonConvert.SerializeObject(character));
        }
Пример #5
0
    private static CharacterDB.Job GetCharacterData(UnitParam unit, JobParam job, ArtifactParam skin)
    {
        // ISSUE: object of a compiler-generated type is created
        // ISSUE: variable of a compiler-generated type
        DownloadUtility.\u003CGetCharacterData\u003Ec__AnonStorey1F1 dataCAnonStorey1F1 = new DownloadUtility.\u003CGetCharacterData\u003Ec__AnonStorey1F1();
        CharacterDB.Character character = CharacterDB.FindCharacter(unit.model);
        if (character == null)
        {
            DebugUtility.LogWarning("Unknown character '" + unit.model + "'");
            return((CharacterDB.Job)null);
        }
        // ISSUE: reference to a compiler-generated field
        dataCAnonStorey1F1.jobResourceID = skin == null ? string.Empty : skin.asset;
        // ISSUE: reference to a compiler-generated field
        if (string.IsNullOrEmpty(dataCAnonStorey1F1.jobResourceID))
        {
            // ISSUE: reference to a compiler-generated field
            dataCAnonStorey1F1.jobResourceID = job == null ? "none" : job.model;
        }
        // ISSUE: reference to a compiler-generated method
        int index = character.Jobs.FindIndex(new Predicate <CharacterDB.Job>(dataCAnonStorey1F1.\u003C\u003Em__1B7));

        if (index < 0)
        {
            // ISSUE: reference to a compiler-generated field
            DebugUtility.LogWarning("Invalid Character " + unit.model + "@" + dataCAnonStorey1F1.jobResourceID);
            index = 0;
        }
        return(character.Jobs[index]);
    }
        public ActionResult <object> GetCharacterInfo(string discordId)
        {
            CharacterDB characterDB = new CharacterDB();
            var         character   = characterDB.GetCharacterInfo(discordId);

            return(JsonConvert.SerializeObject(character));
        }
Пример #7
0
        public ActionResult EditCharacter(int id)
        {
            CharacterDB character = db.Characters.Find(id);


            return(View(character));
        }
Пример #8
0
        public ActionResult CreateCharacter(CharacterDB character)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateCharacter"));
            }

            if (db.Characters.Any(x => x.Name == character.Name))
            {
                return(View("Index", db.Characters.ToList()));
            }

            Random random = new Random();
            int    i      = random.Next(2000);

            CharacterDB newCharacter = new CharacterDB()
            {
                Name         = character.Name,
                Description  = character.Description,
                CharacterID  = i,
                ThumbnailURL = character.ThumbnailURL,
                URL          = character.URL
            };

            db.Characters.Add(newCharacter);
            db.SaveChanges();
            return(View("Index", db.Characters.ToList()));
        }
Пример #9
0
    // Use this for initialization
    void Awake()
    {
        Character loadedCharacter;

        if (dbCharacter != "")
        {
            CharacterDB cdb = Resources.Load <CharacterDB>("CharacterDB");
            loadedCharacter = cdb.GetCharacter(dbCharacter);
        }
        else if (rosterCharacter != "")
        {
            // get a character from the roster
            loadedCharacter = UnitRoster.Instance.GetCharacter(rosterCharacter);
        }
        else
        {
            // use preset character
            Debug.LogWarning("Prefferably load from roster or database instead of hardcoding a character here. ");
            loadedCharacter           = presetCharacter;
            presetCharacter.Skilltree = SkillTreeDB.GetSkillTreeClone("Empty");
            presetCharacter.Sprite    = GetComponent <SpriteRenderer>().sprite;
        }

        if (setLevel > 0)
        {
            loadedCharacter.Level = setLevel;
        }
        GetComponent <Unit>().Character = loadedCharacter;
    }
Пример #10
0
 public charmgr(CharacterDB db, MarketDB marketDB, ItemFactory itemFactory, WalletManager WalletManager)
 {
     this.DB            = db;
     this.MarketDB      = marketDB;
     this.ItemFactory   = itemFactory;
     this.WalletManager = WalletManager;
 }
Пример #11
0
        /// <summary>
        /// Insere um novo personagem.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void strip_save_Click(object sender, System.EventArgs e)
        {
            VerifyTextbox();

            if (CharacterDB.ExistCharacter(txt_user.Text))
            {
                DarkMessageBox.ShowWarning("Este usuário já está sendo utilizado.", "Aviso");
                return;
            }

            var index     = list_classes.SelectedIndices[0];
            var character = FillCharacterData();
            var classe    = Static.Classes[index];

            if (CharacterDB.InsertCharacter(_accountID, character, classe) > 0)
            {
                DarkMessageBox.ShowInformation("O personagem foi cadastrado.", "Aviso");
                Program.AccountForm.FillPlayerNames();
                Clear();
            }
            else
            {
                DarkMessageBox.ShowWarning("Não foi possível cadastrar.", "Aviso");
            }
        }
Пример #12
0
 public account(CharacterDB db, WalletDB walletDB, ItemManager itemManager, CacheStorage cacheStorage, NotificationManager notificationManager)
 {
     this.DB                  = db;
     this.WalletDB            = walletDB;
     this.ItemManager         = itemManager;
     this.CacheStorage        = cacheStorage;
     this.NotificationManager = notificationManager;
 }
Пример #13
0
 public facWarMgr(ChatDB chatDB, CharacterDB characterDB, CacheStorage cacheStorage, ItemFactory itemFactory, NotificationManager notificationManager)
 {
     this.ChatDB              = chatDB;
     this.CharacterDB         = characterDB;
     this.CacheStorage        = cacheStorage;
     this.ItemFactory         = itemFactory;
     this.NotificationManager = notificationManager;
 }
        /// <summary>
        /// Atualiza os nomes dos personagens.
        /// </summary>
        public void FillPlayerNames()
        {
            pData.CharacterName = CharacterDB.GetCharacterNames(pData.ID);

            btn_char1.Text = pData.CharacterName[0];
            btn_char2.Text = pData.CharacterName[1];
            btn_char3.Text = pData.CharacterName[2];
            btn_char4.Text = pData.CharacterName[3];
        }
Пример #15
0
 public LSC(ChatDB db, MessagesDB messagesDB, CharacterDB characterDB, ItemManager itemManager, NodeContainer nodeContainer, Logger logger)
 {
     this.DB            = db;
     this.MessagesDB    = messagesDB;
     this.CharacterDB   = characterDB;
     this.ItemManager   = itemManager;
     this.NodeContainer = nodeContainer;
     this.Log           = logger.CreateLogChannel("LSC");
 }
Пример #16
0
 public contractMgr(ContractDB db, ItemDB itemDB, MarketDB marketDB, CharacterDB characterDB, ItemFactory itemFactory, NotificationManager notificationManager, WalletManager walletManager)
 {
     this.DB                  = db;
     this.ItemDB              = itemDB;
     this.MarketDB            = marketDB;
     this.CharacterDB         = characterDB;
     this.ItemFactory         = itemFactory;
     this.NotificationManager = notificationManager;
     this.WalletManager       = walletManager;
 }
Пример #17
0
 public ActionResult EditCharacter(CharacterDB character, int id)
 {
     if (ModelState.IsValid)
     {
         db.Entry(character).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(character));
 }
    private void Start()
    {
        //Make MenuManager accessible from any script
        Instance = this;

        backgroundPos = backgroundImage.GetComponent <Transform>();

        CharacterDB mCharacterDB = new CharacterDB();

        mCharacterDB.deleteAllData();
        mCharacterDB.close();
    }
Пример #19
0
 public LSC(ChatDB db, MessagesDB messagesDB, CharacterDB characterDB, ItemFactory itemFactory, NodeContainer nodeContainer, Logger logger, NotificationManager notificationManager, MachoNet machoNet, MailManager mailManager)
 {
     this.DB                  = db;
     this.MessagesDB          = messagesDB;
     this.CharacterDB         = characterDB;
     this.ItemFactory         = itemFactory;
     this.NodeContainer       = nodeContainer;
     this.NotificationManager = notificationManager;
     this.MachoNet            = machoNet;
     this.MailManager         = mailManager;
     this.Log                 = logger.CreateLogChannel("LSC");
 }
Пример #20
0
 public marketProxy(MarketDB db, CharacterDB characterDB, ItemDB itemDB, SolarSystemDB solarSystemDB, ItemFactory itemFactory, CacheStorage cacheStorage, NodeContainer nodeContainer, ClientManager clientManager, NotificationManager notificationManager, WalletManager walletManager)
 {
     this.DB                  = db;
     this.CharacterDB         = characterDB;
     this.ItemDB              = itemDB;
     this.SolarSystemDB       = solarSystemDB;
     this.CacheStorage        = cacheStorage;
     this.ItemFactory         = itemFactory;
     this.NodeContainer       = nodeContainer;
     this.ClientManager       = clientManager;
     this.NotificationManager = notificationManager;
     this.WalletManager       = walletManager;
 }
Пример #21
0
 private void UpdateUIScript()
 {
     if (DatabaseHandler.requestCharacter)
     {
         DatabaseHandler.character        = CharacterDB.GetCharacter();
         DatabaseHandler.requestCharacter = false;
     }
     if (DatabaseHandler.requestCharacterInventory)
     {
         DatabaseHandler.characterInventory        = InventoryDB.GetCharacterInventory();
         DatabaseHandler.requestCharacterInventory = false;
     }
 }
Пример #22
0
 public character(CacheStorage cacheStorage, CharacterDB db, ChatDB chatDB, ItemManager itemManager, TypeManager typeManager, Logger logger, Configuration.Character configuration, NodeContainer container)
 {
     this.Log              = logger.CreateLogChannel("character");
     this.mConfiguration   = configuration;
     this.DB               = db;
     this.ChatDB           = chatDB;
     this.ItemManager      = itemManager;
     this.TypeManager      = typeManager;
     this.CacheStorage     = cacheStorage;
     this.Container        = container;
     this.mBloodlineCache  = this.DB.GetBloodlineInformation();
     this.mAncestriesCache = this.DB.GetAncestryInformation(this.mBloodlineCache);
 }
        public CharacterDatabase(Player player)
        {
            pData = player;

            db      = new CharacterDB();
            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);
            }
        }
Пример #24
0
        public slash(Logger logger, ItemFactory itemFactory, MarketDB marketDB, CharacterDB characterDB, ItemDB itemDB, NotificationManager notificationManager, WalletManager walletManager)
        {
            this.Log                 = logger.CreateLogChannel("Slash");
            this.ItemFactory         = itemFactory;
            this.MarketDB            = marketDB;
            this.CharacterDB         = characterDB;
            this.ItemDB              = itemDB;
            this.NotificationManager = notificationManager;
            this.WalletManager       = walletManager;

            // register commands
            this.mCommands["create"]     = CreateCmd;
            this.mCommands["createitem"] = CreateCmd;
            this.mCommands["giveskills"] = GiveSkillCmd;
            this.mCommands["giveskill"]  = GiveSkillCmd;
            this.mCommands["giveisk"]    = GiveIskCmd;
        }
    public void SaveCharacter()
    {
        //GameObject character = new GameObject();

        if (DropdownMenu.Instance.genVal == 0)
        {
            try
            {
                //character = GameObject.Find("Canvas/FemaleCharacter");

                Debug.Log("Female Character successfully found");
                //Debug.Log(DropdownMenu.Instance.typeVal + hairVal + skinVal + eyeVal + outfitVal);

                CharacterDB mCharacterDB = new CharacterDB();
                //mCharacterDB.deleteAllData();
                mCharacterDB.addData(new CharacterData("0", DropdownMenu.Instance.typeVal, DropdownMenu.Instance.genVal, hairVal, skinVal, eyeVal, outfitVal));
                mCharacterDB.close();
            }
            catch
            {
                Debug.Log("Female Character not found");
            }
        }
        else if (DropdownMenu.Instance.genVal == 1)
        {
            try
            {
                //character = GameObject.Find("Canvas/MaleCharacter");

                Debug.Log("Male Character successfully found");
                //Debug.Log(DropdownMenu.Instance.typeVal + hairVal + skinVal + eyeVal + outfitVal);

                CharacterDB mCharacterDB = new CharacterDB();
                //mCharacterDB.deleteAllData();
                mCharacterDB.addData(new CharacterData("0", typeVal, DropdownMenu.Instance.genVal, hairVal, skinVal, eyeVal, outfitVal));
                mCharacterDB.close();
            }
            catch
            {
                Debug.Log("Male Character not found");
            }
        }


        SceneManager.LoadScene("ARSection");
    }
Пример #26
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();
            }
        }
Пример #27
0
    //여기부터 아이템 사기위한 함수목록



    public void BuyTrader()
    {
        // Buy the non-consumable product using its general identifier. Expect a response either
        // through ProcessPurchase or OnPurchaseFailed asynchronously.

        CharacterDB data = DatabaseLoader.Instance.GetCharacterDB(CharacterType.Trader);

        if (data != null)
        {
            if (data.hasCharacter == false)
            {
                BuyProductID(kProductIDNonConsumable);
            }
            else
            {
                return;
            }
        }
    }
Пример #28
0
        /// <summary>
        /// Realiza a pesquisa e preenche com os dados.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_find_Click(object sender, EventArgs e)
        {
            var user = txt_finduser.Text.Trim();

            if (string.IsNullOrEmpty(user))
            {
                return;
            }

            if (!ExistAccount())
            {
                DarkMessageBox.ShowError("Usuário não encontrado.", "Aviso");
                return;
            }

            pData = AccountDB.LoadAccountData(user);
            pData.CharacterName = CharacterDB.GetCharacterNames(pData.ID);

            FillControl();
        }
Пример #29
0
    private void UpdateCharacterInfoText()
    {
        if (nowSelectSlot == null)
        {
            return;
        }
        if (characterName == null)
        {
            return;
        }
        if (characterDescription == null)
        {
            return;
        }
        CharacterDB db = DatabaseLoader.Instance.GetCharacterDB(nowSelectSlot.CharacterType);

        if (db == null)
        {
            return;
        }
        LanguageType nowLanguage = Language.Instance.NowLanguage;

        if (nowLanguage == LanguageType.Korean)
        {
            characterName.text = nowSelectSlot.CharacterType.ToString() + "\n" + "Skill : " + db.skillNameKor;

            characterDescription.text     = db.descriptionKor;
            characterDescription.font     = Language.Instance.KoreanFont;
            characterDescription.fontSize = originSize + 40;
            characterName.fontSize        = 47;
        }
        else
        {
            characterName.text        = nowSelectSlot.CharacterType.ToString() + "\n" + "Skill : " + db.skillNameEng;
            characterDescription.text = db.descriptionEng;
            characterDescription.font = Language.Instance.EnglishFont;
        }

        //  string.Format("{1} \n{2}", db.skillName, db.description);
    }
Пример #30
0
    private void CheckBuy()
    {
        if (buyButton == null || buyText == null)
        {
            return;
        }

        CharacterDB data = DatabaseLoader.Instance.GetCharacterDB(CharacterType.Trader);

        if (data != null)
        {
            if (data.hasCharacter == true)
            {
                buyButton.enabled = false;
                buyText.text      = "Sold out";
                buyText.color     = Color.red;
            }
            else
            {
                buyButton.enabled = true;
            }
        }
    }
    void CharactersTab()
    {
        if (Character_DB == null)
        {
            Character_DB = ScriptableObjectDatabase<CharacterDB>.GetDatabase<CharacterDB>(DATABASE_FOLDER_NAME, DATABASE_CHARACTERS_NAME);
        }

        GUILayout.BeginHorizontal("Box", GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));

        CharacterList();

        GUILayout.EndHorizontal();
    }