Beispiel #1
0
        public ActionResult AddCharacter(ManageCharactersViewModel vModel)
        {
            string userId = User.Identity.GetUserId();
            ManageCharactersViewModel model = new ManageCharactersViewModel
            {
                AuthedUser   = UserManager.FindById(userId),
                ValidGenders = TemplateCache.GetAll <IGender>()
            };

            PlayerTemplate newChar = new PlayerTemplate
            {
                Name                = vModel.NewCharacter.Name,
                SurName             = vModel.NewCharacter.SurName,
                Gender              = vModel.NewCharacter.Gender,
                SuperSenses         = vModel.NewCharacter.SuperSenses,
                GamePermissionsRank = StaffRank.Player,
                Race                = vModel.NewCharacter.Race
            };

            if (User.IsInRole("Admin"))
            {
                newChar.GamePermissionsRank = vModel.NewCharacter.GamePermissionsRank;
            }

            string message = model.AuthedUser.GameAccount.AddCharacter(newChar);

            return(RedirectToAction("ManageCharacters", new { Message = message }));
        }
Beispiel #2
0
 public static void printHabilidades(PlayerTemplate playerTempl)
 {
     foreach (HabilidadTemplate hab in playerTempl.getHabilidadesConjunto1())
     {
         print(hab.nombre);
     }
 }
Beispiel #3
0
    private static PlayerCore buildPlayerCoreByActivo(PlayerTemplate player)
    {
        int activo = player.conjuntoActivo;

        switch (activo)
        {
        case 1:

            player.playerCore.equip       = player.itemConjunto1;
            player.playerCore.weapon      = player.weaponConjunto1;
            player.playerCore.habilidades = player.habilidadesConjunto1;
            break;

        case 2:
            player.playerCore.equip       = player.itemConjunto2;
            player.playerCore.weapon      = player.weaponConjunto2;
            player.playerCore.habilidades = player.habilidadesConjunto2;

            break;

        case 3:
            player.playerCore.equip       = player.itemConjunto3;
            player.playerCore.weapon      = player.weaponConjunto3;
            player.playerCore.habilidades = player.habilidadesConjunto3;

            break;
        }

        return(player.playerCore);
    }
Beispiel #4
0
        protected override object ReadObject <T>(ES3Reader reader)
        {
            var instance = new PlayerTemplate();

            ReadObject <T>(reader, instance);
            return(instance);
        }
Beispiel #5
0
    public static GameObject buildEnemy(PlayerTemplate enemyTemplate)
    {
        GameObject enemyClone = null;

        //Añadimos las habilidades del enemigo sin necesidad de usar botones físicos
        if (enemyTemplate != null)
        {
            Vector3 posicionPlayer = new Vector3(-7f, -2.5f, 0f);
            Vector3 posicionEnemy  = new Vector3(-posicionPlayer.x, posicionPlayer.y, posicionPlayer.z);
            enemyClone = Instantiate(Resources.Load("Prefabs/Players/enemy1") as GameObject, posicionEnemy, new Quaternion());
            GameObject habilidades = new GameObject("habilidades");
            GameObject.Destroy(habilidades);
            habilidades = Instantiate(habilidades, enemyClone.transform);
            habilidades.transform.localPosition = new Vector3(0, 0, 0);
            habilidades.transform.localScale    = new Vector3(1, 1, 1);
            habilitiesEnemy = new List <WeaponInterface>();
            foreach (HabilidadTemplate hab in enemyTemplate.getHabilidadesConjunto1())
            {
                if (hab != null)
                {
                    GameObject hab1 = Resources.Load("Prefabs/Habilidades/" + hab.nombre) as GameObject;
                    hab1 = Instantiate(hab1, habilidades.transform);

                    WeaponScript script = hab1.GetComponent <WeaponScript>();
                    script.setMaxProximity(hab.maxProximity);
                    script.setCoolDown(hab.cooldown);
                    script.setDamage(hab.damage);
                    script.prioridad = hab.prioridad;
                    if (script is CuraScript)
                    {
                        (script as CuraScript).setCuracion(hab.curacion);
                    }

                    GameObject   enemyButton = new GameObject("Button" + hab.nombre);
                    ButtonScript buttonEnem  = enemyButton.AddComponent <ButtonScript>() as ButtonScript;
                    script.setButtonScript(buttonEnem);

                    habilitiesEnemy.Add(script);
                }
            }
            foreach (ItemTemplate item in enemyTemplate.itemConjunto1)
            {
                item.itemMaestro = UtilsItems.getItemMaestro(item.identificador);

                if (item.itemMaestro != null)
                {
                    enemyClone.GetComponent <PlayerScript>().setSpriteTo(item);
                }
            }
        }
        else
        {
            Vector3 posicionPlayer = new Vector3(-7f, -2.5f, 0f);
            Vector3 posicionEnemy  = new Vector3(-posicionPlayer.x, posicionPlayer.y, posicionPlayer.z);
            enemyClone = Instantiate(Resources.Load("Prefabs/Players/enemy1") as GameObject, posicionEnemy, new Quaternion());
        }

        return(enemyClone);
    }
Beispiel #6
0
        /// <summary>
        /// 经验条更新
        /// </summary>
        private void UpdateExbar()
        {
            PlayerTemplate pRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(ObjectSelf.GetInstance().Level);

            if (Exbar != null)
            {
                Exbar.value = (float)ObjectSelf.GetInstance().Exp / (float)pRow.getExp();
            }
        }
Beispiel #7
0
    public static PlayerCore getPlayerCore(PlayerTemplate player)
    {
        if (player.playerCore == null)
        {
            player.playerCore = new PlayerCore();
        }

        return(buildPlayerCoreByActivo(player));
    }
Beispiel #8
0
    private static void savePlayerTemp(PlayerTemplate playerTemp)
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Create(Application.persistentDataPath + "/savedGames.gd");

        bf.Serialize(file, playerTemp);
        playerTemplate = playerTemp;

        file.Close();
    }
        private void parse(string path)
        {
            XmlDocument xmlDocument = new XmlDocument();
            FileStream  fileStream  = new FileStream(path, FileMode.Open);

            if (fileStream.Length == 0L)
            {
                CLogger.getInstance().info("[PlayerTemplateParser]: File is Empty: " + path);
            }
            else
            {
                try
                {
                    xmlDocument.Load((Stream)fileStream);
                    for (XmlNode xmlNode1 = xmlDocument.FirstChild; xmlNode1 != null; xmlNode1 = xmlNode1.NextSibling)
                    {
                        if ("list".Equals(xmlNode1.Name))
                        {
                            for (XmlNode xmlNode2 = xmlNode1.FirstChild; xmlNode2 != null; xmlNode2 = xmlNode2.NextSibling)
                            {
                                if ("template".Equals(xmlNode2.Name))
                                {
                                    XmlNamedNodeMap xmlNamedNodeMap = (XmlNamedNodeMap)xmlNode2.Attributes;
                                    List <PlayerTemplateInventory> _startInventory = new List <PlayerTemplateInventory>();
                                    int id   = int.Parse(xmlNamedNodeMap.GetNamedItem("id").Value);
                                    int rank = int.Parse(xmlNamedNodeMap.GetNamedItem("rank").Value);
                                    int gp   = int.Parse(xmlNamedNodeMap.GetNamedItem("gp").Value);
                                    int exp  = int.Parse(xmlNamedNodeMap.GetNamedItem("exp").Value);

                                    string   itemid = xmlNamedNodeMap.GetNamedItem("itemid").Value;
                                    string[] _temp  = itemid.Split(new char[] { ';' });
                                    for (int i = 0; i < _temp.Length - 1; i++)
                                    {
                                        string[] _temp2 = _temp[i].Split(new char[] { ',' });
                                        PlayerTemplateInventory _invTemp = new PlayerTemplateInventory();
                                        _invTemp.id      = Int32.Parse(_temp2[0]);
                                        _invTemp.slot    = Int32.Parse(_temp2[1]);
                                        _invTemp.onEquip = Int32.Parse(_temp2[2]);
                                        _startInventory.Add(_invTemp);
                                    }
                                    PlayerTemplate playerTemplate = new PlayerTemplate(id, rank, exp, gp, _startInventory);
                                    _holder.addPlayerTemplateInfo(playerTemplate);
                                }
                            }
                        }
                    }
                }
                catch (XmlException ex)
                {
                    CLogger.getInstance().info("[PlayerTemplateParser]: Error in file: " + path);
                    throw ex;
                }
                fileStream.Close();
            }
        }
    //初始化UI
    void InitUI()
    {
        int _frontLevrel = ObjectSelf.GetInstance().GetPlayOldLevel();
        int _curLevel    = (int)ObjectSelf.GetInstance().Level;

        _FrontLevel.text = _frontLevrel.ToString();
        _CurLevel.text   = _curLevel.ToString();
        int _power = 0;
        int _hero  = 0;
        int _bag   = 0;
        //for (int i = _frontLevrel; i < _curLevel; i++)
        //{
        //    PlayerTemplate pRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(i);
        //    _power = pRow.getExtraAp() + _cofig.getInitial_ap_upper_limit();
        //    _hero += pRow.getExtraHeroPackset();
        //    _bag += pRow.getExtraCommonItemPackset();
        //}
        VipTemplate    _vipData = (VipTemplate)DataTemplate.GetInstance().m_VipTable.getTableData(ObjectSelf.GetInstance().VipLevel);
        GameConfig     _cofig   = (GameConfig)DataTemplate.GetInstance().m_GameConfig;
        PlayerTemplate _pRow    = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_frontLevrel);

        _power           = _pRow.getExtraAp() + _cofig.getInitial_ap_upper_limit() + _vipData.getExtraAp();
        _FrontPower.text = _power.ToString();
        _CurPower.text   = ObjectSelf.GetInstance().ActionPointMax.ToString();
        _hero            = _cofig.getInitial_hero_packset() + _pRow.getExtraHeroPackset();
        _FrontHero.text  = _hero.ToString();
        _CurHero.text    = ObjectSelf.GetInstance().HeroContainerBag.GetHeroBagSizeMax().ToString();
        _bag             = _cofig.getInitial_common_item_packset() + _pRow.getExtraCommonItemPackset();
        _FrontBag.text   = _bag.ToString();
        _CurBag.text     = ObjectSelf.GetInstance().CommonItemContainer.GetBagItemSizeMax().ToString();

        int _apRecover = 0;

        if ((_curLevel - _frontLevrel) > 1)
        {
            for (int i = 0; i < (_curLevel - _frontLevrel); i++)
            {
                PlayerTemplate _nRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_curLevel - i);
                _apRecover += _nRow.getApRecover();
            }
        }
        else
        {
            PlayerTemplate _nRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_curLevel);
            _apRecover = _nRow.getApRecover();
        }
        string _text = string.Format(GameUtils.getString("fight_playerlevelup_content1"), _apRecover);

        m_PromptObjTxt.text = _text;

        //播放特效
        StartCoroutine(PlayEffectRow(0, 1.5f, () => { m_Level.gameObject.SetActive(true); }));
        StartCoroutine(PlayEffectRow(1, 2.0f, () => { m_Power.gameObject.SetActive(true); }));
        StartCoroutine(PlayEffectRow(2, 2.5f, () => { m_PowerMax.gameObject.SetActive(true); }));
    }
Beispiel #11
0
 public void HandleDidChangePlayerRecord(string arg1, PlayerTemplate arg2, IDictionary arg3, string[] arg4)
 {
     if (arg2.active == false)
     {
         playerList.Find(x => x.GetComponent <PlayerHandler>().playerID.Equals(arg2.playerID)).SetActive(false);
     }
     else if (arg2.active == true)
     {
         playerList.Find(x => x.GetComponent <PlayerHandler>().playerID.Equals(arg2.playerID)).SetActive(true);
     }
 }
Beispiel #12
0
    //返回英雄背包最大上线
    public int GetHeroBagSizeMax()
    {
        int nInitialSize = DataTemplate.GetInstance().m_GameConfig.getInitial_hero_packset();                                            //初始上限
        int nCurSizeSum  = DataTemplate.GetInstance().m_GameConfig.getHero_packset_per_expand() * ObjectSelf.GetInstance().HeroBuyCount; //已购买增加的上限

        int            nCurLevel      = ObjectSelf.GetInstance().Level;
        PlayerTemplate _row           = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(nCurLevel);
        int            nLeveladdition = _row.getExtraHeroPackset();//等级加成

        return(nInitialSize + nCurSizeSum + nLeveladdition);
    }
Beispiel #13
0
    public static PlayerTemplate getPlayerTemplate(PlayerCore core)
    {
        PlayerTemplate player = new PlayerTemplate();

        player.itemConjunto1        = core.equip;
        player.weaponConjunto1      = core.weapon;
        player.habilidadesConjunto1 = core.habilidades;

        player.playerCore = core;

        return(player);
    }
Beispiel #14
0
 private void DrawAddPlayerBox()
 {
     if (_currentlyEdited == null || (_currentlyEdited.playerName == "" && _currentlyEdited.customId == 0))
     {
         _currentlyEdited = PlayerTemplate.CreateNewPlayer(true);
     }
     PlayerTemplateEditor.DrawPlayerTemplate(_currentlyEdited);
     SimpleGUI.ActionButton("Add player", () =>
     {
         _controller.Emulator.SpawnPlayer(GotoUdonSettings.Instance, _currentlyEdited);
         _currentlyEdited = PlayerTemplate.CreateNewPlayer(true);
     });
 }
Beispiel #15
0
    public static PlayerTemplate updatePlayer(PlayerTemplate playerTemp)
    {
        if (!isOnline())
        {
            UtilsPlayer.print("Sin conexión a BBDD");
            return(playerTemp);
        }

        playercollection = db.GetCollection <PlayerTemplate>("usuarios");
        playercollection.Save(playerTemp);

        return(playerTemp);
    }
Beispiel #16
0
        protected internal override void run()
        {
            GameClient     client         = base.getClient();
            PlayerTemplate playerTemplate = PlayerTemplateHolder.getPlayerTemplate(Config.PlayerTemplateId);
            bool           flag           = !AccountManager.getInstance().isPlayerNameExist(this.name);

            if (flag)
            {
                AccountManager.getInstance().get(base.getClient().getPlayer().name).setRank(playerTemplate._rank);
                AccountManager.getInstance().get(base.getClient().getPlayer().name).setExp(playerTemplate._exp);
                AccountManager.getInstance().get(base.getClient().getPlayer().name).setGP(playerTemplate._gp);
                AccountManager.getInstance().get(base.getClient().getPlayer().name).setPlayerName(this.name);
                PlayerInventory playerInventory = new PlayerInventory(base.getClient().getPlayer().getPlayerId());
                Account         account         = AccountManager.getInstance().get(base.getClient().getPlayer().name);
                int             num             = AccountManager.getInstance().CreatePlayer(client.getPlayer().name, account);
                bool            flag2           = num >= 0;
                if (flag2)
                {
                    for (int i = 0; i < playerTemplate._startInventory.Count; i++)
                    {
                        ItemsModel item = new ItemsModel
                        {
                            id   = playerTemplate._startInventory[i].id,
                            slot = playerTemplate._startInventory[i].slot
                        };
                        playerInventory.getItemsAll().Add(item);
                    }
                    account.setInventory(playerInventory);
                    base.getClient().setAccount(account.player_id);
                    base.getClient().sendPacket(new PROTOCOL_LOBBY_CREATE_NICK_NAME_ACK(0L));
                    ChannelInfoHolder.getChannel(base.getClient().getChannelId()).addPlayer(account);
                }
                else
                {
                    bool flag3 = num == -1;
                    if (flag3)
                    {
                        base.getClient().sendPacket(new PROTOCOL_LOBBY_CREATE_NICK_NAME_ACK(2147483373L));
                    }
                    else
                    {
                        base.getClient().sendPacket(new PROTOCOL_LOBBY_CREATE_NICK_NAME_ACK(2147483373L));
                    }
                }
            }
            else
            {
                base.getClient().sendPacket(new PROTOCOL_LOBBY_CREATE_NICK_NAME_ACK(2147483373L));
            }
            CLogger.getInstance().debug("[Create Player] Player Name: " + this.name);
        }
Beispiel #17
0
    public static GameObject findRandomEnemy()
    {
        if (!isOnline())
        {
            UtilsPlayer.print("Sin conexión a BBDD");
            return(null);
        }
        playercollection = db.GetCollection <PlayerTemplate>("usuarios");
        var            whereNotMe    = Query.Not(new QueryDocument("_id", SaveLoad.playerTemplate.Id));
        PlayerTemplate enemyTemplate = playercollection.Find(whereNotMe).ElementAt(UnityEngine.Random.Range(0, Convert.ToInt32(playercollection.Find(whereNotMe).Count())));

        GameObject enemy = UtilsPlayer.buildEnemy(enemyTemplate);

        return(enemy);
    }
Beispiel #18
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            _maps = _context.Game.AssetStore.MapCaches
                    .Where(m => _context.Game.ContentManager.GetMapEntry(m.Name) != null)
                    .Select(m => (mapCache: m, mapName: m.IsOfficial ? m.GetNameKey().Translate() : m.Name))
                    .OrderBy(m => m.mapCache.IsOfficial ? 0 : 1).ThenBy(m => m.mapName)
                    .ToDictionary(m => m.mapCache, m => m.mapName);
            if (_maps.FirstOrDefault() is var(mapCache, value))
            {
                _map = (mapCache, value);
            }

            _playableSides = _context.Game.GetPlayableSides().ToList();
            _faction       = _playableSides.FirstOrDefault();

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });
            AddView(new ObjectListView(context));
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new GameSettingsView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
            AddView(new InspectorView(context));
            AddView(new PreviewView(context));
            AddView(new CameraView(context));
            AddView(new PartitionView(context));
        }
    //显示经验值  经验条
    private void ShoweExbar()
    {
        PlayerTemplate pRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(ObjectSelf.GetInstance().Level);

        _ExpBar.value        = (float)ObjectSelf.GetInstance().Exp / (float)pRow.getExp();
        _PlayerLevelTxt.text = ObjectSelf.GetInstance().Level.ToString();

        StringBuilder str = new StringBuilder();

        str.Append("<color=yellow>");
        str.Append(ObjectSelf.GetInstance().Exp.ToString());
        str.Append("</color>");
        str.Append("/");
        str.Append(pRow.getExp());
        _ExpTxt.text = str.ToString();
    }
        protected internal override void run()
        {
            GameClient     gc = getClient();
            PlayerTemplate pt = PlayerTemplateHolder.getPlayerTemplate(Config.PlayerTemplateId);

            if (!AccountManager.getInstance().isPlayerNameExist(name))
            {
                AccountManager.getInstance().get(getClient().getPlayer().name).setRank(pt._rank);
                AccountManager.getInstance().get(getClient().getPlayer().name).setExp(pt._exp);
                AccountManager.getInstance().get(getClient().getPlayer().name).setGP(pt._gp);
                AccountManager.getInstance().get(getClient().getPlayer().name).setPlayerName(name);
                PlayerInventory pi      = new PlayerInventory(getClient().getPlayer().getPlayerId());
                Account         acc     = AccountManager.getInstance().get(getClient().getPlayer().name);
                int             success = AccountManager.getInstance().CreatePlayer(gc.getPlayer().name, acc);
                if (success >= 0)
                {
                    for (int r = 0; r < pt._startInventory.Count; r++)
                    {
                        ItemsModel io = new ItemsModel();
                        io.id   = pt._startInventory[r].id;
                        io.slot = pt._startInventory[r].slot;
                        pi.getItemsAll().Add(io);
                    }
                    acc.setInventory(pi);
                    getClient().setAccount(acc.player_id);

                    getClient().sendPacket(new S_LOBBY_CREATE_NICKNAME(0));
                    ChannelInfoHolder.getChannel(getClient().getChannelId()).addPlayer(acc);
                    return;
                }
                else if (success == -1)
                {
                    getClient().sendPacket(new S_LOBBY_CREATE_NICKNAME(0x80000113));
                }
                else
                {
                    getClient().sendPacket(new S_LOBBY_CREATE_NICKNAME(0x80000113));
                }
            }
            else
            {
                getClient().sendPacket(new S_LOBBY_CREATE_NICKNAME(0x80000113));
            }
        }
Beispiel #21
0
    private void DrawTemplatesEditor()
    {
        EditorGUI.BeginChangeCheck();
        DrawGlobalOptions(GotoUdonSettings.Instance);
        SimpleGUI.SectionSpacing();

#if GOTOUDON_SIMULATION_LEGACY
        List <PlayerTemplate> templates = GotoUdonSettings.Instance.playerTemplates;
        if (templates.Count == 0)
        {
            templates.Add(PlayerTemplate.CreateNewPlayer(true));
        }

        GUILayout.Label("Players to create at startup:");
        PlayerTemplate toRemove = null;
        foreach (var template in templates)
        {
            if (PlayerTemplateEditor.DrawPlayerTemplateWithRemoveButton(template))
            {
                toRemove = template;
            }
            SimpleGUI.OptionSpacing();
        }

        templates.Remove(toRemove);
        if (templates.Count == 0)
        {
            templates.Add(PlayerTemplate.CreateNewPlayer(true));
        }

        SimpleGUI.ActionButton("Add another player",
                               () => templates.Add(PlayerTemplate.CreateNewPlayer(templates.Count == 0)));
        SimpleGUI.SectionSpacing();

        if (SimpleGUI.EndChangeCheck())
        {
            EditorUtility.SetDirty(GotoUdonSettings.Instance);
        }

        SimpleGUI.InfoBox(true, "In play mode you will be able to control all created players here, or add more");
#endif
    }
Beispiel #22
0
    //After Awake
    void Start()
    {
        ContentLoader loader = GetComponentInChildren <ContentLoader>();

        loader.LoadContent();
        if (loader.HasLoaded())
        {
            Destroy(loader.gameObject);
            SceneManager.LoadScene("MainMenu");
        }
        //Create the playerSettings object in memory and then add 4 fighters to it. as fighter is the first character in the list

        for (int i = 0; i < 4; ++i)
        {
            playerSettings[i] = new PlayerTemplate(PlayerTemplate.CharacterIndex.FIGHTER, 0); //When skins are implemented, pass i instead of 0. atm skins do nothing
        }

        ////Until Character Select sreen is created this is where we define our active players
        //RegisterPlayer(0);
        //RegisterPlayer(1);
    }
Beispiel #23
0
    public static GameObject Load()
    {
        GameObject player = null;

        // File.Delete(Application.persistentDataPath + "/savedGames.gd");
        //  if (false)
        if (File.Exists(Application.persistentDataPath + "/savedGames.gd"))
        {
            BinaryFormatter bf          = new BinaryFormatter();
            FileStream      file        = File.Open(Application.persistentDataPath + "/savedGames.gd", FileMode.Open);
            PlayerTemplate  playerTempl = (PlayerTemplate)bf.Deserialize(file);
            file.Close();
            file.Dispose();

            playerTemplate = playerTempl;
        }
        else
        {
            playerTemplate = new PlayerTemplate();
        }
        player = UtilsPlayer.buildPlayer(playerTemplate);
        return(player);
    }
Beispiel #24
0
 public DuelPlayer(Player player, PlayerTemplate template)
 {
     this.player   = player;
     this.template = template;
 }
 internal void addPlayerTemplateInfo(PlayerTemplate gsi)
 {
     PlayerTemplateHolder._templates.Add(gsi);
 }
Beispiel #26
0
        public void Draw(ref bool isGameViewFocused)
        {
            var viewport = ImGui.GetMainViewport();

            ImGui.SetNextWindowPos(viewport.GetWorkPos());
            ImGui.SetNextWindowSize(viewport.GetWorkSize());
            ImGui.SetNextWindowViewport(viewport.ID);
            ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0.0f);
            ImGui.PushStyleVar(ImGuiStyleVar.WindowBorderSize, 0.0f);
            ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);

            var windowFlags = ImGuiWindowFlags.MenuBar | ImGuiWindowFlags.NoDocking;

            windowFlags |= ImGuiWindowFlags.NoTitleBar | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove;
            windowFlags |= ImGuiWindowFlags.NoBringToFrontOnFocus | ImGuiWindowFlags.NoNavFocus;
            //windowFlags |= ImGuiWindowFlags.NoBackground;

            ImGui.Begin("Root", windowFlags);

            ImGui.PopStyleVar(3);

            ImGui.DockSpace(ImGui.GetID("DockSpace"), Vector2.Zero, ImGuiDockNodeFlags.None);

            float menuBarHeight = 0;

            if (ImGui.BeginMenuBar())
            {
                menuBarHeight = ImGui.GetWindowHeight();

                if (ImGui.BeginMenu("File"))
                {
                    if (ImGui.MenuItem("Exit", "Alt+F4", false, true))
                    {
                        Environment.Exit(0);
                    }

                    ImGui.EndMenu();
                }

                if (ImGui.BeginMenu("Jump"))
                {
                    if (ImGui.BeginMenu("Faction: " + _faction.Side))
                    {
                        foreach (var side in _playableSides)
                        {
                            if (ImGui.MenuItem(side.Side))
                            {
                                _faction = side;
                                ImGui.SetWindowFocus(side.Name);
                            }
                        }

                        ImGui.EndMenu();
                    }

                    if (ImGui.BeginMenu("Map: " + _map.Item1.Name))
                    {
                        foreach (var mapCache in _maps)
                        {
                            if (ImGui.MenuItem(mapCache.Value))
                            {
                                _map = (mapCache.Key, mapCache.Value);
                            }
                        }

                        ImGui.EndMenu();
                    }

                    if (ImGui.Button("Go!"))
                    {
                        var random   = new Random();
                        var faction2 = _playableSides[random.Next(0, _playableSides.Count())];

                        if (_map.Item1.IsMultiplayer)
                        {
                            _context.Game.StartMultiPlayerGame(
                                _map.Item1.Name,
                                new EchoConnection(),
                                new PlayerSetting?[]
                            {
                                new PlayerSetting(null, _faction, new ColorRgb(255, 0, 0), PlayerOwner.Player),
                                new PlayerSetting(null, faction2, new ColorRgb(255, 255, 255), PlayerOwner.EasyAi),
                            },
                                0
                                );
                        }
                        else
                        {
                            _context.Game.StartSinglePlayerGame(_map.Item1.Name);
                        }
                    }

                    ImGui.EndMenu();
                }

                if (ImGui.BeginMenu("Windows"))
                {
                    foreach (var view in _views)
                    {
                        if (ImGui.MenuItem(view.DisplayName, null, view.IsVisible, true))
                        {
                            view.IsVisible = true;

                            ImGui.SetWindowFocus(view.Name);
                        }
                    }

                    ImGui.EndMenu();
                }

                if (ImGui.BeginMenu("Preferences"))
                {
                    var isVSyncEnabled = _context.Game.GraphicsDevice.SyncToVerticalBlank;
                    if (ImGui.MenuItem("VSync", null, ref isVSyncEnabled, true))
                    {
                        _context.Game.GraphicsDevice.SyncToVerticalBlank = isVSyncEnabled;
                    }
                    var isFullscreen = _context.Game.Window.Fullscreen;
                    if (ImGui.MenuItem("Fullscreen", "Alt+Enter", ref isFullscreen, true))
                    {
                        _context.Game.Window.Fullscreen = isFullscreen;
                    }
                    ImGui.EndMenu();
                }

                if (_context.Game.Configuration.UseRenderDoc && ImGui.BeginMenu("RenderDoc"))
                {
                    var renderDoc = Game.RenderDoc;

                    if (ImGui.MenuItem("Trigger Capture"))
                    {
                        renderDoc.TriggerCapture();
                    }
                    if (ImGui.BeginMenu("Options"))
                    {
                        bool allowVsync = renderDoc.AllowVSync;
                        if (ImGui.Checkbox("Allow VSync", ref allowVsync))
                        {
                            renderDoc.AllowVSync = allowVsync;
                        }
                        bool validation = renderDoc.APIValidation;
                        if (ImGui.Checkbox("API Validation", ref validation))
                        {
                            renderDoc.APIValidation = validation;
                        }
                        int delayForDebugger = (int)renderDoc.DelayForDebugger;
                        if (ImGui.InputInt("Debugger Delay", ref delayForDebugger))
                        {
                            delayForDebugger           = Math.Clamp(delayForDebugger, 0, int.MaxValue);
                            renderDoc.DelayForDebugger = (uint)delayForDebugger;
                        }
                        bool verifyBufferAccess = renderDoc.VerifyBufferAccess;
                        if (ImGui.Checkbox("Verify Buffer Access", ref verifyBufferAccess))
                        {
                            renderDoc.VerifyBufferAccess = verifyBufferAccess;
                        }
                        bool overlayEnabled = renderDoc.OverlayEnabled;
                        if (ImGui.Checkbox("Overlay Visible", ref overlayEnabled))
                        {
                            renderDoc.OverlayEnabled = overlayEnabled;
                        }
                        bool overlayFrameRate = renderDoc.OverlayFrameRate;
                        if (ImGui.Checkbox("Overlay Frame Rate", ref overlayFrameRate))
                        {
                            renderDoc.OverlayFrameRate = overlayFrameRate;
                        }
                        bool overlayFrameNumber = renderDoc.OverlayFrameNumber;
                        if (ImGui.Checkbox("Overlay Frame Number", ref overlayFrameNumber))
                        {
                            renderDoc.OverlayFrameNumber = overlayFrameNumber;
                        }
                        bool overlayCaptureList = renderDoc.OverlayCaptureList;
                        if (ImGui.Checkbox("Overlay Capture List", ref overlayCaptureList))
                        {
                            renderDoc.OverlayCaptureList = overlayCaptureList;
                        }
                        ImGui.EndMenu();
                    }
                    if (ImGui.MenuItem("Launch Replay UI"))
                    {
                        renderDoc.LaunchReplayUI();
                    }

                    ImGui.EndMenu();
                }

                DrawTimingControls();

                var fpsText     = $"{ImGui.GetIO().Framerate:N2} FPS";
                var fpsTextSize = ImGui.CalcTextSize(fpsText).X;
                ImGui.SetCursorPosX(ImGui.GetWindowContentRegionWidth() - fpsTextSize);
                ImGui.Text(fpsText);

                ImGui.EndMenuBar();
            }

            foreach (var view in _views)
            {
                view.Draw(ref isGameViewFocused);
            }

            var launcherImage = _context.Game.LauncherImage;

            if (launcherImage != null)
            {
                var launcherImageMaxSize = new Vector2(150, 150);

                var launcherImageSize = SizeF.CalculateSizeFittingAspectRatio(
                    new SizeF(launcherImage.Width, launcherImage.Height),
                    new Size((int)launcherImageMaxSize.X, (int)launcherImageMaxSize.Y));

                const int launcherImagePadding = 10;
                ImGui.SetNextWindowPos(new Vector2(
                                           _context.Game.Window.ClientBounds.Width - launcherImageSize.Width - launcherImagePadding,
                                           menuBarHeight + launcherImagePadding));

                ImGui.PushStyleVar(ImGuiStyleVar.WindowPadding, Vector2.Zero);
                ImGui.Begin("LauncherImage", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoInputs | ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoDecoration);

                ImGui.Image(
                    _context.ImGuiRenderer.GetOrCreateImGuiBinding(_context.Game.GraphicsDevice.ResourceFactory, launcherImage),
                    new Vector2(launcherImageSize.Width, launcherImageSize.Height),
                    Vector2.Zero,
                    Vector2.One,
                    Vector4.One,
                    Vector4.Zero);

                ImGui.End();
                ImGui.PopStyleVar();
            }

            ImGui.End();
        }
Beispiel #27
0
    public static GameObject buildPlayer(PlayerTemplate playerTempl)
    {
        GameObject player = null;

        //Añadimos las habilidades del enemigo sin necesidad de usar botones físicos
        if (playerTempl != null)
        {
            player = Resources.Load("Prefabs/Players/player") as GameObject;

            // Creacion de la carpteta de habilidades
            GameObject habilidades = new GameObject("habilidades");
            GameObject.Destroy(habilidades);
            habilidades = Instantiate(habilidades, player.transform);
            habilidades.transform.localPosition = new Vector3(0, 0, 0);
            habilidades.transform.localScale    = new Vector3(1, 1, 1);

            // Creacion de la carpteta de habilidad basica del arma
            GameObject habilidadWeap = new GameObject("habilidadBasica");
            GameObject.Destroy(habilidadWeap);
            habilidadWeap = Instantiate(habilidadWeap, player.transform);
            habilidadWeap.transform.localPosition = new Vector3(0, 0, 0);
            habilidadWeap.transform.localScale    = new Vector3(1, 1, 1);

            foreach (HabilidadTemplate hab in playerTempl.getHabilidadesConjunto1())
            {
                if (hab != null)
                {
                    GameObject hab1 = Resources.Load("Prefabs/Habilidades/" + hab.nombre) as GameObject;
                    hab1 = Instantiate(hab1, habilidades.transform);

                    WeaponScript script = hab1.GetComponent <WeaponScript>();
                    script.setMaxProximity(hab.maxProximity);
                    script.setCoolDown(hab.cooldown);
                    script.setDamage(hab.damage);
                    script.prioridad = hab.prioridad;
                    if (script is CuraScript)
                    {
                        (script as CuraScript).setCuracion(hab.curacion);
                    }
                }
            }

            foreach (ItemTemplate item in playerTempl.itemConjunto1)
            {
                item.itemMaestro = UtilsItems.getItemMaestro(item.identificador);
                if (item.itemMaestro != null)
                {
                    player.GetComponent <PlayerScript>().setSpriteTo(item);
                }
            }

            if (playerTempl.getWeaponConjunto1() != null)
            {
                WeaponTemplate weap = playerTempl.getWeaponConjunto1();

                weap.weaponMaestro = UtilsItems.getWeaponMaestro(weap.identificador);

                if (weap.identificador != null)
                {
                    player.GetComponent <PlayerScript>().setWeaponTo(weap);

                    string     habilidadW = UtilsWeapon.getWeaponHab(weap.weaponMaestro.tipoHabilidadBasica);
                    GameObject habW       = Resources.Load("Prefabs/Habilidades/basicas/" + habilidadW) as GameObject;

                    habW = Instantiate(habW, habilidadWeap.transform);

                    WeaponScript script = habW.GetComponent <WeaponScript>();
                    script.setMaxProximity(5);
                    script.setCoolDown(weap.weaponMaestro.velocidad);
                    script.setDamage(weap.weaponMaestro.damage);
                    script.setAlcance(weap.weaponMaestro.alcance);
                    print(weap.weaponMaestro.alcance);

                    script.prioridad = 0;
                }
            }
            //Insertamos las habilidades básicas de las armas.
        }
        else
        {
            Vector3 posicionPlayer = new Vector3(-7f, -2.5f, 0f);
            player = Instantiate(Resources.Load("Prefabs/Players/player") as GameObject, posicionPlayer, new Quaternion());
        }

        return(player);
    }
Beispiel #28
0
        public MainView(DiagnosticViewContext context)
        {
            _context = context;

            _views = new List <DiagnosticView>();

            _maps = _context.Game.AssetStore.MapCaches
                    .Where(m => _context.Game.ContentManager.GetMapEntry(m.Name) != null)
                    .Select(m => (mapCache: m, mapName: m.IsOfficial ? m.GetNameKey().Translate() : m.Name))
                    .OrderBy(m => m.mapCache.IsOfficial ? 0 : 1).ThenBy(m => m.mapName)
                    .ToDictionary(m => m.mapCache, m => m.mapName);
            if (_maps.FirstOrDefault() is var(mapCache, value))
            {
                _map = (mapCache, value);
            }

            _playableSides = _context.Game.GetPlayableSides().ToList();
            _faction       = _playableSides.FirstOrDefault();

            void AddView(DiagnosticView view)
            {
                _views.Add(AddDisposable(view));
            }

            AddView(new GameView(context)
            {
                IsVisible = true
            });

            AddView(new ObjectListView(context));
            AddView(new AssetListView(context));
            AddView(new MapSettingsView(context));
            AddView(new RenderSettingsView(context));
            AddView(new ScriptingView(context));
            AddView(new StatisticsView(context));
            AddView(new StringsView(context));
            AddView(new AptView(context));
            AddView(new AptConstantsView(context));
            AddView(new AptGeometryView(context));
            AddView(new WndView(context));
            AddView(new GameLoopView(context));
            AddView(new GameSettingsView(context));
            AddView(new LuaScriptConsole(context));
            AddView(new LogView(context));
            AddView(new InspectorView(context));
            AddView(new PreviewView(context));
            AddView(new CameraView(context));
            AddView(new PartitionView(context));

            if (File.Exists(IniFileName))
            {
                foreach (var line in File.ReadAllText(IniFileName).Split(Environment.NewLine))
                {
                    var settings    = line.Split(" = ");
                    var displayName = settings[0];
                    var visibility  = bool.Parse(settings[1]);

                    var view = _views.FirstOrDefault(x => x.DisplayName == displayName);
                    if (view != null)
                    {
                        view.IsVisible = visibility;
                    }
                }
            }
        }
        protected internal override void write()
        {
            Account account = AccountManager.getInstance().get(this._lc.getLogin());
            Clan    clan    = ClanManager.getInstance().get(account.getClanId());
            Mission mission = MissionManager.getInstance().get(account.getPlayerId());
            bool    flag    = account.getPlayerName() == null || account.getPlayerName() == "";

            if (flag)
            {
                PlayerTemplate playerTemplate = PlayerTemplateHolder.getPlayerTemplate(Config.PlayerTemplateId);
                account.setRank(playerTemplate._rank);
                account.setExp(playerTemplate._exp);
                account.setGP(playerTemplate._gp);
            }
            base.writeH(2566);
            base.writeD(4);
            base.writeC(1);
            base.writeS(account.getPlayerName(), 33);
            base.writeD(account.getExp());
            base.writeD(account.getRank());
            base.writeD(4);
            base.writeD(account.getGP());
            base.writeD(account.getMoney());
            base.writeD((int)((short)((account == null || clan == null) ? 0 : clan.getClanId())));
            base.writeD(2);
            base.writeD(0);
            base.writeD(0);
            base.writeH((short)account.getPcCafe());
            base.writeC((byte)account.getNameColor());
            base.writeS(Convert.ToString((account == null || clan == null) ? "" : clan.getClanName()), 17);
            base.writeH((short)((account == null || clan == null) ? 0 : clan.getClanRank()));
            base.writeC(Convert.ToByte((account == null || clan == null) ? 255 : clan.getLogo1()));
            base.writeC(Convert.ToByte((account == null || clan == null) ? 255 : clan.getLogo2()));
            base.writeC(Convert.ToByte((account == null || clan == null) ? 255 : clan.getLogo3()));
            base.writeC(Convert.ToByte((account == null || clan == null) ? 255 : clan.getLogo4()));
            base.writeC(Convert.ToByte((account == null || clan == null) ? 0 : clan.getLogoColor()));
            base.writeC(0);
            base.writeD(0);
            base.writeD(0);
            base.writeD(0);
            base.writeD(account._statistic.getFights_s());
            base.writeD(account._statistic.getWinFights_s());
            base.writeD(account._statistic.getLostFights_s());
            base.writeD(0);
            base.writeD(account._statistic.getKills_s());
            base.writeD(account._statistic.getHeadShotKills());
            base.writeD(account._statistic.getDeaths_s());
            base.writeD(0);
            base.writeD(account._statistic.getKills_s());
            base.writeD(account._statistic.getEscapes_s());
            base.writeD(account._statistic.getFights_s());
            base.writeD(account._statistic.getWinFights_s());
            base.writeD(account._statistic.getLostFights_s());
            base.writeD(0);
            base.writeD(account._statistic.getKills_s());
            base.writeD(account._statistic.getHeadShotKills());
            base.writeD(account._statistic.getDeaths_s());
            base.writeD(0);
            base.writeD(account._statistic.getKills_s());
            base.writeD(account._statistic.getEscapes_s());
            account.setStatus(1);
            AccountManager.getInstance().UpdateStatus(account.getPlayerId(), 1);
            account.CheckCorrectInventory();
            base.writeD(account.getCharRed());
            base.writeD(account.getCharBlue());
            base.writeD(account.getCharHelmet());
            base.writeD(account.getCharBeret());
            base.writeD(account.getCharDino());
            base.writeD(account.getPrimaryWeapon());
            base.writeD(account.getSecondaryWeapon());
            base.writeD(account.getMeleeWeapon());
            base.writeD(account.getThrownNormalWeapon());
            base.writeD(account.getThrownSpecialWeapon());
            base.writeH(0);
            base.writeH(55);
            base.writeH(0);
            base.writeH(55);
            base.writeB(new byte[38]);
            bool flag2 = account.getPlayerName() == null || account.getPlayerName() == "";

            if (flag2)
            {
                account.setCharRed(1001001005);
                account.setCharBlue(1001002006);
                account.setCharHelmet(1102003001);
                account.setCharDino(1006003041);
                account.setCharBeret(0);
                account.setPrimaryWeapon(200004006);
                account.setSecondaryWeapon(601002003);
                account.setMeleeWeapon(702001001);
                account.setThrownNormalWeapon(803007001);
                account.setThrownSpecialWeapon(904007002);
            }
            else
            {
                base.writeC(1);
            }
            bool flag3 = account.getPlayerName() == null || account.getPlayerName() == "";

            if (flag3)
            {
                base.writeD(account.getInvetoryOnlyEquip(2).Count);
                base.writeD(account.getInvetoryOnlyEquip(1).Count);
                base.writeD(account.getInvetoryOnlyEquip(3).Count);
                base.writeD(0);
            }
            else
            {
                base.writeD(account.getInvetoryOnly(2).Count);
                base.writeD(account.getInvetoryOnly(1).Count);
                base.writeD(account.getInvetoryOnly(3).Count);
                base.writeD(0);
            }
            bool flag4 = account.getPlayerName() == null || account.getPlayerName() == "";

            if (flag4)
            {
                for (int i = 0; i < account.getInvetoryOnlyEquip(2).Count; i++)
                {
                    base.writeD(account.getInvetoryOnlyEquip(2)[i].id);
                    base.writeD(account.getInvetoryOnlyEquip(2)[i].id);
                    base.writeD(account.getInvetoryOnlyEquip(2)[i].id);
                    base.writeC((byte)account.getInvetoryOnlyEquip(2)[i].equip_type);
                    base.writeD(account.getInvetoryOnlyEquip(2)[i].count);
                }
                for (int j = 0; j < account.getInvetoryOnlyEquip(1).Count; j++)
                {
                    base.writeD(account.getInvetoryOnlyEquip(1)[j].id);
                    base.writeD(account.getInvetoryOnlyEquip(1)[j].id);
                    base.writeD(account.getInvetoryOnlyEquip(1)[j].id);
                    base.writeC((byte)account.getInvetoryOnlyEquip(1)[j].equip_type);
                    base.writeD(account.getInvetoryOnlyEquip(1)[j].count);
                }
                for (int k = 0; k < account.getInvetoryOnlyEquip(3).Count; k++)
                {
                    base.writeD(account.getInvetoryOnlyEquip(3)[k].id);
                    base.writeD(account.getInvetoryOnlyEquip(3)[k].id);
                    base.writeD(account.getInvetoryOnlyEquip(3)[k].id);
                    base.writeC((byte)account.getInvetoryOnlyEquip(3)[k].equip_type);
                    base.writeD(account.getInvetoryOnlyEquip(3)[k].count);
                }
                for (int l = 0; l < account.getInvetoryOnlyEquip(4).Count; l++)
                {
                    base.writeD(account.getInvetoryOnlyEquip(4)[l].id);
                    base.writeD(account.getInvetoryOnlyEquip(4)[l].id);
                    base.writeD(account.getInvetoryOnlyEquip(4)[l].id);
                    base.writeC((byte)account.getInvetoryOnlyEquip(4)[l].equip_type);
                    base.writeD(account.getInvetoryOnlyEquip(4)[l].count);
                }
            }
            else
            {
                for (int m = 0; m < account.getInvetoryOnly(2).Count; m++)
                {
                    base.writeD(account.getInvetoryOnly(2)[m].id);
                    base.writeD(account.getInvetoryOnly(2)[m].id);
                    base.writeD(account.getInvetoryOnly(2)[m].id);
                    base.writeC((byte)account.getInvetoryOnly(2)[m].equip_type);
                    base.writeD(account.getInvetoryOnly(2)[m].count);
                }
                for (int n = 0; n < account.getInvetoryOnly(1).Count; n++)
                {
                    base.writeD(account.getInvetoryOnly(1)[n].id);
                    base.writeD(account.getInvetoryOnly(1)[n].id);
                    base.writeD(account.getInvetoryOnly(1)[n].id);
                    base.writeC((byte)account.getInvetoryOnly(1)[n].equip_type);
                    base.writeD(account.getInvetoryOnly(1)[n].count);
                }
                for (int num = 0; num < account.getInvetoryOnly(3).Count; num++)
                {
                    base.writeD(account.getInvetoryOnly(3)[num].id);
                    base.writeD(account.getInvetoryOnly(3)[num].id);
                    base.writeD(account.getInvetoryOnly(3)[num].id);
                    base.writeC((byte)account.getInvetoryOnly(3)[num].equip_type);
                    base.writeD(account.getInvetoryOnly(3)[num].count);
                }
                for (int num2 = 0; num2 < account.getInvetoryOnly(4).Count; num2++)
                {
                    base.writeD(account.getInvetoryOnly(4)[num2].id);
                    base.writeD(account.getInvetoryOnly(4)[num2].id);
                    base.writeD(account.getInvetoryOnly(4)[num2].id);
                    base.writeC((byte)account.getInvetoryOnly(4)[num2].equip_type);
                    base.writeD(account.getInvetoryOnly(4)[num2].count);
                }
            }
            base.writeC((byte)Config.OutpostEnable);
            base.writeD(account.getBrooch());
            base.writeD(account.getInsignia());
            base.writeD(account.getMedal());
            base.writeD(account.getBlueOrder());
            base.writeC((byte)account.getMissionId());
            base.writeD(account.getCardId());
            mission = this.getMissionById(0);
            bool flag5 = account.getMission1() == account.getCard1_1();

            if (flag5)
            {
                bool flag6 = account.getMission2() == account.getCard1_2();
                if (flag6)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag7 = account.getMission2() == account.getCard1_2();
                if (flag7)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag8 = account.getMission3() == account.getCard1_3();

            if (flag8)
            {
                bool flag9 = account.getMission4() == account.getCard1_4();
                if (flag9)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag10 = account.getMission4() == account.getCard1_4();
                if (flag10)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(1);
            bool flag11 = account.getMission1() == account.getCard2_1();

            if (flag11)
            {
                bool flag12 = account.getMission2() == account.getCard2_2();
                if (flag12)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag13 = account.getMission2() == account.getCard2_2();
                if (flag13)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag14 = account.getMission3() == account.getCard2_3();

            if (flag14)
            {
                bool flag15 = account.getMission4() == account.getCard2_4();
                if (flag15)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag16 = account.getMission4() == account.getCard2_4();
                if (flag16)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(2);
            bool flag17 = account.getMission1() == account.getCard1_1();

            if (flag17)
            {
                bool flag18 = account.getMission2() == account.getCard3_2();
                if (flag18)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag19 = account.getMission2() == account.getCard3_2();
                if (flag19)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag20 = account.getMission3() == account.getCard1_3();

            if (flag20)
            {
                bool flag21 = account.getMission4() == account.getCard3_4();
                if (flag21)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag22 = account.getMission4() == account.getCard3_4();
                if (flag22)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(3);
            bool flag23 = account.getMission1() == account.getCard4_1();

            if (flag23)
            {
                bool flag24 = account.getMission2() == account.getCard4_2();
                if (flag24)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag25 = account.getMission2() == account.getCard4_2();
                if (flag25)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag26 = account.getMission3() == account.getCard4_3();

            if (flag26)
            {
                bool flag27 = account.getMission4() == account.getCard4_4();
                if (flag27)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag28 = account.getMission4() == account.getCard4_4();
                if (flag28)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(4);
            bool flag29 = account.getMission1() == account.getCard5_1();

            if (flag29)
            {
                bool flag30 = account.getMission2() == account.getCard5_2();
                if (flag30)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag31 = account.getMission2() == account.getCard5_2();
                if (flag31)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag32 = account.getMission3() == account.getCard5_3();

            if (flag32)
            {
                bool flag33 = account.getMission4() == account.getCard5_4();
                if (flag33)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag34 = account.getMission4() == account.getCard5_4();
                if (flag34)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(5);
            bool flag35 = account.getMission1() == account.getCard6_1();

            if (flag35)
            {
                bool flag36 = account.getMission2() == account.getCard6_2();
                if (flag36)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag37 = account.getMission2() == account.getCard6_2();
                if (flag37)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag38 = account.getMission3() == account.getCard6_3();

            if (flag38)
            {
                bool flag39 = account.getMission4() == account.getCard6_4();
                if (flag39)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag40 = account.getMission4() == account.getCard6_4();
                if (flag40)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(6);
            bool flag41 = account.getMission1() == account.getCard7_1();

            if (flag41)
            {
                bool flag42 = account.getMission2() == account.getCard7_2();
                if (flag42)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag43 = account.getMission2() == account.getCard7_2();
                if (flag43)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag44 = account.getMission3() == account.getCard7_3();

            if (flag44)
            {
                bool flag45 = account.getMission4() == account.getCard7_4();
                if (flag45)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag46 = account.getMission4() == account.getCard7_4();
                if (flag46)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(7);
            bool flag47 = account.getMission1() == account.getCard8_1();

            if (flag47)
            {
                bool flag48 = account.getMission2() == account.getCard8_2();
                if (flag48)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag49 = account.getMission2() == account.getCard8_2();
                if (flag49)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag50 = account.getMission3() == account.getCard8_3();

            if (flag50)
            {
                bool flag51 = account.getMission4() == account.getCard8_4();
                if (flag51)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag52 = account.getMission4() == account.getCard8_4();
                if (flag52)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(8);
            bool flag53 = account.getMission1() == account.getCard9_1();

            if (flag53)
            {
                bool flag54 = account.getMission2() == account.getCard9_2();
                if (flag54)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag55 = account.getMission2() == account.getCard9_2();
                if (flag55)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag56 = account.getMission3() == account.getCard9_3();

            if (flag56)
            {
                bool flag57 = account.getMission4() == account.getCard9_4();
                if (flag57)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag58 = account.getMission4() == account.getCard9_4();
                if (flag58)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            mission = this.getMissionById(9);
            bool flag59 = account.getMission1() == account.getCard10_1();

            if (flag59)
            {
                bool flag60 = account.getMission2() == account.getCard10_2();
                if (flag60)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag61 = account.getMission2() == account.getCard10_2();
                if (flag61)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            bool flag62 = account.getMission3() == account.getCard10_3();

            if (flag62)
            {
                bool flag63 = account.getMission4() == account.getCard10_4();
                if (flag63)
                {
                    base.writeC(255);
                }
                else
                {
                    base.writeC(239);
                }
            }
            else
            {
                bool flag64 = account.getMission4() == account.getCard10_4();
                if (flag64)
                {
                    base.writeC(254);
                }
                else
                {
                    base.writeC(0);
                }
            }
            base.writeB(new byte[]
            {
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                1,
                0
            });
            base.writeC((byte)account.getCard1_1());
            base.writeC((byte)account.getCard1_2());
            base.writeC((byte)account.getCard1_3());
            base.writeC((byte)account.getCard1_4());
            base.writeC((byte)account.getCard2_1());
            base.writeC((byte)account.getCard2_2());
            base.writeC((byte)account.getCard2_3());
            base.writeC((byte)account.getCard2_4());
            base.writeC((byte)account.getCard3_1());
            base.writeC((byte)account.getCard3_2());
            base.writeC((byte)account.getCard3_3());
            base.writeC((byte)account.getCard3_4());
            base.writeC((byte)account.getCard4_1());
            base.writeC((byte)account.getCard4_2());
            base.writeC((byte)account.getCard4_3());
            base.writeC((byte)account.getCard4_4());
            base.writeC((byte)account.getCard5_1());
            base.writeC((byte)account.getCard5_2());
            base.writeC((byte)account.getCard5_3());
            base.writeC((byte)account.getCard5_4());
            base.writeC((byte)account.getCard6_1());
            base.writeC((byte)account.getCard6_2());
            base.writeC((byte)account.getCard6_3());
            base.writeC((byte)account.getCard6_4());
            base.writeC((byte)account.getCard7_1());
            base.writeC((byte)account.getCard7_2());
            base.writeC((byte)account.getCard7_3());
            base.writeC((byte)account.getCard7_4());
            base.writeC((byte)account.getCard8_1());
            base.writeC((byte)account.getCard8_2());
            base.writeC((byte)account.getCard8_3());
            base.writeC((byte)account.getCard8_4());
            base.writeC((byte)account.getCard9_1());
            base.writeC((byte)account.getCard9_2());
            base.writeC((byte)account.getCard9_3());
            base.writeC((byte)account.getCard9_4());
            base.writeC((byte)account.getCard10_1());
            base.writeC((byte)account.getCard10_2());
            base.writeC((byte)account.getCard10_3());
            base.writeC((byte)account.getCard10_4());
            base.writeB(new byte[]
            {
                1,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            });
            base.writeC((byte)account.title.getP1());
            base.writeC((byte)account.title.getP2());
            base.writeC((byte)account.title.getP3());
            base.writeC((byte)account.title.getP4());
            base.writeC((byte)account.title.getP5());
            base.writeC((byte)account.title.getP6());
            base.writeC(0);
            base.writeC(0);
            base.writeB(new byte[]
            {
                Convert.ToByte(account.title.getEquipedTitle1()),
                Convert.ToByte(account.title.getEquipedTitle2()),
                Convert.ToByte(account.title.getEquipedTitle3())
            });
            base.writeD(account.getTitleSlotCount());
            base.writeD(0);
            base.writeD(3);
            base.writeD(25);
            base.writeD(37);
            base.writeD(1);
            base.writeD(39);
            base.writeD(1);
            base.writeD(40);
            base.writeD(1);
            base.writeD(1);
            base.writeD(0);
            base.writeD(0);
            base.writeD(54);
            base.writeC(60);
            base.writeC(2);
            base.writeB(new byte[]
            {
                0,
                1,
                254,
                4,
                212,
                15,
                118,
                199,
                127,
                8
            });
            base.writeB(new byte[]
            {
                0,
                1,
                254,
                15,
                212,
                254,
                143,
                199,
                127,
                163
            });
            base.writeB(new byte[]
            {
                23,
                160,
                141,
                1,
                136,
                0,
                137,
                0,
                141,
                0,
                141,
                0,
                141,
                0,
                141,
                1,
                9,
                0,
                1,
                0,
                0,
                0,
                141,
                0,
                128,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                140,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                8,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                8,
                0,
                0,
                0,
                0,
                0,
                8,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            });
            base.writeB(new byte[]
            {
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1,
                1
            });
            base.writeC(1);
            base.writeB(new byte[]
            {
                238,
                3,
                3,
                0
            });
            base.writeD(1);
            base.writeD(1);
            base.writeC(1);
            base.writeH(50);
            base.writeD((account.getRank() == 53 || account.getRank() == 54) ? 1 : 0);
            base.writeD(702001024);
            base.writeC(1);
            base.writeB(new byte[5]);
        }
        private void parse(string path)
        {
            XmlDocument xmlDocument = new XmlDocument();
            FileStream  fileStream  = new FileStream(path, FileMode.Open);
            bool        flag        = fileStream.Length == 0L;

            if (flag)
            {
                CLogger.getInstance().info("[PlayerTemplateParser]: File is Empty: " + path);
            }
            else
            {
                try
                {
                    xmlDocument.Load(fileStream);
                    for (XmlNode xmlNode = xmlDocument.FirstChild; xmlNode != null; xmlNode = xmlNode.NextSibling)
                    {
                        bool flag2 = "list".Equals(xmlNode.Name);
                        if (flag2)
                        {
                            for (XmlNode xmlNode2 = xmlNode.FirstChild; xmlNode2 != null; xmlNode2 = xmlNode2.NextSibling)
                            {
                                bool flag3 = "template".Equals(xmlNode2.Name);
                                if (flag3)
                                {
                                    XmlNamedNodeMap attributes          = xmlNode2.Attributes;
                                    List <PlayerTemplateInventory> list = new List <PlayerTemplateInventory>();
                                    int      id    = int.Parse(attributes.GetNamedItem("id").Value);
                                    int      rank  = int.Parse(attributes.GetNamedItem("rank").Value);
                                    int      gp    = int.Parse(attributes.GetNamedItem("gp").Value);
                                    int      exp   = int.Parse(attributes.GetNamedItem("exp").Value);
                                    string[] array = attributes.GetNamedItem("itemid").Value.Split(new char[]
                                    {
                                        ';'
                                    });
                                    for (int i = 0; i < array.Length - 1; i++)
                                    {
                                        string[] array2 = array[i].Split(new char[]
                                        {
                                            ','
                                        });
                                        PlayerTemplateInventory item = new PlayerTemplateInventory
                                        {
                                            id      = int.Parse(array2[0]),
                                            slot    = int.Parse(array2[1]),
                                            onEquip = int.Parse(array2[2])
                                        };
                                        list.Add(item);
                                    }
                                    PlayerTemplate gsi = new PlayerTemplate(id, rank, exp, gp, list);
                                    this._holder.addPlayerTemplateInfo(gsi);
                                }
                            }
                        }
                    }
                }
                catch (XmlException ex)
                {
                    CLogger.getInstance().info("[PlayerTemplateParser]: Error in file: " + path);
                    throw ex;
                }
                fileStream.Close();
            }
        }