Ejemplo n.º 1
0
        public void Apply()
        {
            // insertion d'un nouveau champ pour un nouveau player
            mysql.players newPlayer2 = new mysql.players
            {
                pseudo          = _nameOfNewActor,
                user            = _actor.Username,
                classe          = _selectedClass.ToString(),
                hiddenVillage   = _selectedHiddenVillage.ToString(),
                maskColorString = _maskColorString,
                level           = MainClass.LvlStart,
                maxHEalth       = MainClass.StartPdv,
                currentHealth   = MainClass.StartPdv,
                spirit          = Enums.Spirit.Name.neutral.ToString()
            };

            ((List <mysql.players>)DataBase.DataTables.players).Add(newPlayer2);

            CreatedActorSuccessfullyResponseMessage createdActorSuccessfullyResponseMessage = new CreatedActorSuccessfullyResponseMessage();

            createdActorSuccessfullyResponseMessage.Initialize(null, Nc);
            createdActorSuccessfullyResponseMessage.Serialize();
            createdActorSuccessfullyResponseMessage.Send();
        }
Ejemplo n.º 2
0
        public static void GetData(string[] cmd, NetIncomingMessage im)
        {
            Actor actor = (Actor)im.SenderConnection.Tag;

            if (cmd.Length == 5 && cmd[1] == "spellTuiles")
            {
                #region
                if (actor.Pseudo == "" || actor.map == "" || actor.inBattle == 0)
                {
                    Security.User_banne("spellTuiles", im.SenderConnection);
                    return;
                }

                int pointX, pointY;
                if (!int.TryParse(cmd[3], out pointX))
                {
                    return;
                }

                if (!int.TryParse(cmd[4], out pointY))
                {
                    return;
                }

                int spellId;
                if (!int.TryParse(cmd[2], out spellId))
                {
                    return;
                }

                Point spellPoint = new Point(pointX, pointY);

                // cmd•spellTuiles•sortID•MousePosX•MousePosY
                // check si le joueur est en combat, si le combat est en mode Started
                if (actor.inBattle == 0 && Battle.Battles.Find(f => f.IdBattle == actor.idBattle).State != battleState.state.started)
                {
                    return;
                }

                // check si le client est autorisé a avoir ce sort
                mysql.players player = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == actor.Pseudo);

                if (player == null)
                {
                    return;
                }

                if (!actor.sorts.Exists(f => f.SpellId == spellId))
                {
                    // le client tente de lancer un sort qu'il na pas
                    // bannissement peux etre
                    Console.WriteLine("client qui cheat en lançons un sort qui n'est pas le sien");
                    return;
                }

                // common check
                if (!Fight.spellsChecker.spells(spellId, spellPoint, im))
                {
                    return;
                }

                Battle battle      = Battle.Battles.Find(f => f.IdBattle == actor.idBattle);
                Actor  spellCaster = battle.AllPlayersByOrder.Find(f => f.Pseudo == actor.Pseudo);
                Fight.Effect_Dispatcher.Apply(spellCaster, battle, spellPoint, spellId);
                #endregion
            }
            else if (cmd[1] == "InteractWithPNJ")
            {
                #region
                // interaction avec pnj cmd.InteractWithPNJ.nom pnj.parametre
                if (actor.Pseudo == "")
                {
                    Security.User_banne("InteractWithPNJ", im.SenderConnection);
                    return;
                }

                string pnj = cmd[2];

                if (pnj == "iruka")
                {
                    // 1er PNJ Créée
                    if (cmd.Length > 2 && cmd[3] == "acceptFirstFight")
                    {
                        // "cmd•InteractWithPNJ•iruka•acceptFirstFight"
                        // on vérifie si le joueur a préalablement fait la quête acceptFirstFight
                        int quete = CheckQuete.isSubmitedQuest("FirstFight", actor);
                        if (quete == 1)
                        {
                            //commun.SendMessage("cmd•checkQuete•FirstFight•" + quete, im, true);
                            Console.WriteLine("client a déja la quete, et il essai de la refaire alors que ce n'est pas possible sans avoir modifier le code ou les paquets !!!");
                            return;
                        }

                        // on vérifie si la quete est déja presente et si elle est en mode submited
                        List <mysql.quete> quetes = ((List <mysql.quete>)DataBase.DataTables.quete).FindAll(f => f.pseudo == actor.Pseudo);
                        if (quetes.Count == 0)
                        {
                            // création de la quete chez le client
                            mysql.quete quete2 = new mysql.quete()
                            {
                                pseudo = actor.Pseudo, nom_quete = "FirstFight", currentStep = 1
                            };
                            ((List <mysql.quete>)DataBase.DataTables.quete).Add(quete2);
                        }

                        // envoyer au client que la quete FirstFight a été débuté
                        CommonCode.SendMessage("cmd•beganQuete•FirstFight", im, true);

                        // ce code dois ressembler au code de la cmd AcceptChallenge sur la class Network.cs a part quelque modification comme les position qui ne sont pas enregistrés sur un fichier
                        // on vérifie si le joueur n'est pas en combat se qui est impossible vus que dans cette map il est seul normalement
                        if (actor.inBattle == 1)
                        {
                            Console.WriteLine("Player " + actor.Pseudo + " is in battle, can't interact with pnj iruka");
                            return;
                        }

                        // preparation du combat
                        Console.WriteLine("combat commancé avec PNJ Iruka");
                        // création d'une session de combat
                        // ATTENTION, ce code a été copié depuis la methode Network.cs GetData() cmd AcceptChallenge, Alors si un changement est fait sur cette methode, il faut l'appliquer sur celle la aussi
                        Battle battle = new Battle();

                        // 2eme joueur
                        Actor actor1SideB = (Actor)actor.Clone();
                        actor1SideB.directionLook = 0;
                        actor1SideB.teamSide      = Team.Side.B;
                        actor1SideB.idBattle      = battle.IdBattle;
                        battle.SideB.Add(actor1SideB);

                        // 1er player
                        Actor actor1SideA = new Actor
                        {
                            currentHealth   = 1000,
                            maxHealth       = 1000,
                            classeName      = ActorClass.ClassName.iruka,
                            classeId        = 8,
                            initiative      = 1000,
                            summons         = 5,
                            species         = Species.Name.Pnj,
                            Pseudo          = ActorClass.ClassName.iruka.ToString(),
                            maskColorString = "null/null/null",
                            directionLook   = 2,
                            teamSide        = Team.Side.A,
                            idBattle        = battle.IdBattle,
                            originalPc      = 10,
                            originalPm      = 10,
                            doton           = 500
                        };
                        // pour jouer au premier

                        // ajout des sorts
                        Actor.SpellsInformations infosSorts = new Actor.SpellsInformations {
                            SpellId = 4, SpellColor = 0, Level = 1
                        };
                        actor1SideA.sorts.Add(infosSorts);

                        battle.SideA.Add(actor1SideA);
                        battle.Owner             = actor1SideB.Pseudo;
                        battle.Map               = actor.map;
                        battle.BattleType        = BattleType.Type.VsPnj;
                        battle.BattleFlags[0]    = "iruka";
                        battle.BattleFlags[1]    = "FirstFight";
                        battle.Timestamp         = CommonCode.ReturnTimeStamp();
                        battle.IsFreeCellToSpell = CommonCode.ReturnFreeCellToSpellFunc(battle.Map);
                        battle.IsFreeCellToWalk  = CommonCode.ReturnFreeCellToWalkFunc(battle.Map);
                        Battle.Battles.Add(battle);

                        // sauveguard de l'id dans la tables des joueurs

                        foreach (mysql.players player in ((List <mysql.players>)DataBase.DataTables.players).FindAll(f => f.pseudo == actor.Pseudo || f.pseudo == actor.PlayerChallengeYou))
                        {
                            player.inBattle     = 1;
                            player.inBattleType = battle.BattleType.ToString();
                            player.inBattleID   = battle.IdBattle;
                        }

                        actor.inBattle = 1;
                        actor.idBattle = battle.IdBattle;
                        actor.teamSide = Team.Side.B;

                        // collecte des données des 2 joueurs
                        string playersData = "";

                        playersData += actor1SideA.Pseudo + "#" + actor1SideA.classeName + "#" + actor1SideA.level + "#" + actor1SideA.hiddenVillage + "#" + actor1SideA.maskColorString + "#" + actor1SideA.maxHealth + "#" + actor1SideA.currentHealth + "#" + actor1SideA.officialRang + "#" + actor1SideA.initiative + "#" + actor1SideA.doton + "#" + actor1SideA.katon + "#" + actor1SideA.futon + "#" + actor1SideA.raiton + "#" + actor1SideA.suiton + "#" + actor1SideA.usingDoton + "#" + actor1SideA.usingKaton + "#" + actor1SideA.usingFuton + "#" + actor1SideA.usingRaiton + "#" + actor1SideA.usingSuiton + "#" + actor1SideA.equipedDoton + "#" + actor1SideA.equipedKaton + "#" + actor1SideA.equipedFuton + "#" + actor1SideA.equipedRaiton + "#" + actor1SideA.equipedSuiton + "#" + actor1SideA.originalPc + "#" + actor1SideA.originalPm + "#" + actor1SideA.pe + "#" + actor1SideA.cd + "#" + actor1SideA.summons + "#" + actor1SideA.resiDotonPercent + "#" + actor1SideA.resiKatonPercent + "#" + actor1SideA.resiFutonPercent + "#" + actor1SideA.resiRaitonPercent + "#" + actor1SideA.resiSuitonPercent + "#" + actor1SideA.dodgePC + "#" + actor1SideA.dodgePM + "#" + actor1SideA.dodgePE + "#" + actor1SideA.dodgeCD + "#" + actor1SideA.removePC + "#" + actor1SideA.removePM + "#" + actor1SideA.removePE + "#" + actor1SideA.removeCD + "#" + actor1SideA.escape + "#" + actor1SideA.blocage + "#" + actor1SideA.species.ToString() + "#" + actor1SideA.directionLook + "|";
                        playersData += actor1SideB.Pseudo + "#" + actor1SideB.classeName + "#" + actor1SideB.level + "#" + actor1SideB.hiddenVillage + "#" + actor1SideB.maskColorString + "#" + actor1SideB.maxHealth + "#" + actor1SideB.currentHealth + "#" + actor1SideB.officialRang + "#" + actor1SideB.initiative + "#" + actor1SideB.doton + "#" + actor1SideB.katon + "#" + actor1SideB.futon + "#" + actor1SideB.raiton + "#" + actor1SideB.suiton + "#" + actor1SideB.usingDoton + "#" + actor1SideB.usingKaton + "#" + actor1SideB.usingFuton + "#" + actor1SideB.usingRaiton + "#" + actor1SideB.usingSuiton + "#" + actor1SideB.equipedDoton + "#" + actor1SideB.equipedKaton + "#" + actor1SideB.equipedFuton + "#" + actor1SideB.equipedRaiton + "#" + actor1SideB.equipedSuiton + "#" + actor1SideB.originalPc + "#" + actor1SideB.originalPm + "#" + actor1SideB.pe + "#" + actor1SideB.cd + "#" + actor1SideB.summons + "#" + actor1SideB.resiDotonPercent + "#" + actor1SideB.resiKatonPercent + "#" + actor1SideB.resiFutonPercent + "#" + actor1SideB.resiRaitonPercent + "#" + actor1SideB.resiSuitonPercent + "#" + actor1SideB.dodgePC + "#" + actor1SideB.dodgePM + "#" + actor1SideB.dodgePE + "#" + actor1SideB.dodgeCD + "#" + actor1SideB.removePC + "#" + actor1SideB.removePM + "#" + actor1SideB.removePE + "#" + actor1SideB.removeCD + "#" + actor1SideB.escape + "#" + actor1SideB.blocage + "#" + actor1SideB.species.ToString() + "#" + actor1SideB.directionLook;

                        // modification des position des joueurs selon les position valide du map aléatoirement
                        string[] sideAValidePos = battleStartPositions.Map(battle.Map, battle).Split('|')[0].Split('#');
                        string[] team2ValidePos = battleStartPositions.Map(battle.Map, battle).Split('|')[1].Split('#');

                        battle.SideAValidePos = battleStartPositions.Map(battle.Map, battle).Split('|')[0];
                        battle.SideBValidePos = battleStartPositions.Map(battle.Map, battle).Split('|')[1];

                        Random random = new Random();
                        int    rand   = random.Next(sideAValidePos.Length);
                        actor1SideB.map_position = new Point(Convert.ToInt32(team2ValidePos[rand].Split('/')[0]), Convert.ToInt32(team2ValidePos[rand].Split('/')[1]));

                        rand = random.Next(sideAValidePos.Length);
                        actor1SideA.map_position = new Point(Convert.ToInt32(sideAValidePos[rand].Split('/')[0]), Convert.ToInt32(sideAValidePos[rand].Split('/')[1]));

                        ////////////////////////////////////

                        string team1 = battle.SideA.Aggregate("", (current, piib) => current + (piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#"));
                        team1 = team1.Substring(0, team1.Length - 1);

                        string team2 = battle.SideB.Aggregate("", (current, piib) => current + (piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#"));
                        team2 = team2.Substring(0, team2.Length - 1);

                        ////////////////////////////////////
                        //pseudo#classe#level#village#MaskColors#TotalPdv#CurrentPdv#rang#initiative#doton#katon#futon#raiton#siuton#usingDoton#usingKaton#usingFuton#usingRaiton#usingSuiton#dotonEquiped#katonEquiped#futonEquiped#raitonEquiped#suitonEquiped#pc#pm#pe#cd#invoc#resiDoton#resiKaton#resiFuton#resiRaiton#resiSuiton#esquivePC#esquivePM#esquivePE#esquiveCD#retraitPC#retraitPM#retraitPE#retraitCD#evasion#blocage
                        // envoie au client la confirmation du challenge
                        CommonCode.SendMessage("cmd•challengeBegan•" + playersData + "•" + battle.SideAValidePos + "|" + battle.SideBValidePos + "•" + MainClass.InitialisationBattleWaitTime + "•" + battle.BattleType + "•" + team1 + "•" + team2 + "•" + battle.State + "•" + "14/5#16/5#18/5" + "•" + "14/10#16/10#18/10", im, true);
                        //Console.WriteLine("<--cmd•challengeBegan•" + playersData + "•" + battle.SideAValidePos + "|" + battle.SideBValidePos + "•" + MainClass.InitialisationBattleWaitTime + "•" + battle.BattleType + "•" + team1 + "•" + team2 + "•" + battle.State + "•" + "14/5#16/5#18/5" + "•" + "14/10#16/10#18/10" + " to " + actor.Pseudo);

                        // lock position
                        bool launchBattle = false;
                        battle.LockedPosInIniTime.Add(actor1SideA.Pseudo);

                        foreach (Actor t in battle.SideB)
                        {
                            NetConnection nc = MainClass.netServer.Connections.Find(f => ((Actor)f.Tag).Pseudo == t.Pseudo);
                            if (nc != null)
                            {
                                CommonCode.SendMessage("cmd•BattlePosLocked•" + actor1SideA.Pseudo + "•" + launchBattle, nc, true);
                                //Console.WriteLine("<--cmd•BattlePosLocked•" + actor1SideA.Pseudo + "•" + launchBattle + " to " + ((Actor)nc.Tag).Pseudo);
                            }
                        }
                    }
                    else if (cmd.Length > 4 && cmd[3] == "tp")
                    {
                        // cmd[4] = le tp apres la quette FirtFight
                        switch (cmd[4])
                        {
                        case "1":
                            // tp au village du joueur
                            // pour le moment je vais tp vers une seul map vus qu'au début il n'aura pas bc de monde
                            if (actor.map.ToLower() == "start" && actor.Quests.Exists(f => f.QuestName == "FirstFight" && f.Submited))
                            {
                                // l'utilisateur a déja fait la quete FirstFight, on le tp a son statue

                                actor.map = "_0_0_0";

                                // changement du map du jour sur la table players
                                ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == actor.Pseudo).map = "_0_0_0";

                                // changement du map du jour sur la table connected
                                ((List <mysql.connected>)DataBase.DataTables.connected).Find(f => f.pseudo == actor.Pseudo).map = "_0_0_0";

                                CommonCode.SendMessage("cmd•change map•_0_0_0", im, true);
                                //Console.WriteLine("<--cmd•change map•_0_0_0 to " + actor.Pseudo);
                            }
                            else
                            {
                                // quete pas encore faite
                                Console.WriteLine("Error, quete FirstFight na pas été faite, et le joueur " + actor.Pseudo + " essai de se TP, se qui n'est pas possible");
                                Console.WriteLine("Le client et le serveurs doivent etre synchronisé, si on arrive la c que le joueur a modifier le client");
                            }
                            break;

                            /*if(pi.village == "konoha")
                             * {
                             *  // tp vers map konoha
                             * }
                             * else if(pi.village == "iwa")
                             * {
                             *
                             * }
                             * else if (pi.village == "kiri")
                             * {
                             *
                             * }
                             * else if (pi.village == "kumo")
                             * {
                             *
                             * }
                             * else if (pi.village == "suna")
                             * {
                             *
                             * }*/
                        }
                    }
                }
                #endregion
            }
            else if (cmd.Length > 1 && cmd[1] == "checkQuete")
            {
                #region
                if (actor.Pseudo == "")
                {
                    Security.User_banne("checkQuete", im.SenderConnection);
                    return;
                }
                Actor pi = (Actor)im.SenderConnection.Tag;
                CommonCode.SendMessage("cmd•checkQuete•" + cmd[2] + "•" + CheckQuete.isSubmitedQuest(cmd[2], pi), im, true);
                #endregion
            }
            else if (cmd.Length > 1 && cmd[1] == "requireBattleData")
            {
                #region
                if (actor.Pseudo == "")
                {
                    Security.User_banne("requireBattleData", im.SenderConnection);
                    return;
                }
                CommonCode.RequireBattleData(im);
                #endregion
            }
            else if (cmd.Length > 1 && cmd[1] == "getMyPlayerPos")
            {
                #region
                if (actor.Pseudo == "" || actor.map == "" || actor.inBattle == 1)
                {
                    Security.User_banne("getMyPlayerPos", im.SenderConnection);
                    return;
                }
                if (actor.Pseudo == "")
                {
                    Security.User_banne("getMyPlayerPos", im.SenderConnection);
                    return;
                }
                CommonCode.SendMessage("cmd•getMyPlayerPos•" + actor.map_position.X + "/" + actor.map_position.Y, im, true);
                #endregion
            }
            else if (cmd.Length > 1 && cmd[1] == "upgradeSpell")
            {
                #region
                if (actor.Pseudo == "" || actor.map == "" || actor.inBattle == 1)
                {
                    Security.User_banne("upgradeSpell", im.SenderConnection);
                    return;
                }
                // joueur qui veux augementer le lvl d'un sort
                int spellId;
                if (int.TryParse(cmd[2], out spellId) && actor.inBattle == 0)
                {
                    if (actor.sorts.Exists(f => f.SpellId == spellId))
                    {
                        Actor.SpellsInformations infoSort = actor.sorts.Find(f => f.SpellId == spellId);
                        // on check si le sort na pas atteint sa limite qui est de 5
                        if (infoSort.Level < 5 && actor.spellPointLeft >= infoSort.Level)
                        {
                            actor.spellPointLeft -= infoSort.Level;
                            infoSort.Level++;

                            // augmentation du level su sort
                            string[] spells =
                                ((List <mysql.players>)DataBase.DataTables.players).Find(
                                    f => f.pseudo == actor.Pseudo).sorts.Split('/');

                            for (int cnt = 0; cnt < spells.Length; cnt++)
                            {
                                bool     found      = false;
                                string[] spellsData = spells[cnt].Split(':');
                                if (spellsData[0] == spellId.ToString())
                                {
                                    found = true;
                                }

                                if (found)
                                {
                                    string newSpellData = "";
                                    for (int cnt2 = 0; cnt2 < spellsData.Length; cnt2++)
                                    {
                                        if (cnt2 == 2)
                                        {
                                            newSpellData += (Convert.ToInt16(spellsData[cnt2]) + 1) + ":";
                                        }
                                        else
                                        {
                                            newSpellData += spellsData[cnt2] + ":";
                                        }
                                    }
                                    newSpellData = newSpellData.Substring(0, newSpellData.Length - 1);
                                    spells[cnt]  = newSpellData;
                                }
                            }

                            // reconstruction des states des sorts apres augementation du lvl
                            string newData = spells.Aggregate("", (current, t) => current + t + "/");
                            newData = newData.Substring(0, newData.Length - 1);

                            // mise à jours des données
                            mysql.players player =
                                ((List <mysql.players>)DataBase.DataTables.players).Find(
                                    f => f.pseudo == actor.Pseudo);
                            player.sorts          = newData;
                            player.spellPointLeft = actor.spellPointLeft;
                            CommonCode.SendMessage(
                                "cmd•upgradedSpell•" + spellId + "•" + infoSort.Level + "•" + actor.spellPointLeft,
                                im, true);
                        }
                    }
                }
                #endregion
            }
        }
Ejemplo n.º 3
0
        public void Apply()
        {
            #region
            if (_actor.Pseudo == "")
            {
                Security.User_banne("Player ask for map information while he does'nt have any actor currently used(maybe sessionZero)", Nc);
                return;
            }
            // on check si l'utilisateur est en combat, si oui, verifier si le combat existe, si oui, verifier s'il reste plus d'1 joueur non invoc dans les 2 teams
            // un bug arrive rarement qui fait qu'un client se deconnecte d'un combat, et apres il co et il big sur l'état qu'il été en combat, alors qu'il s'est deconnecté mais le serveur garde la session de combat, donc il cloture pas
            if (_actor.inBattle == 1)
            {
                if (!Battle.Battles.Exists(f => f.IdBattle == _actor.idBattle))
                {
                    _actor.inBattle = 0;
                    // mise a jours sur la bdd
                    // mise du statut inBattle = 0, idBattle = -1 pour les joueurs
                    mysql.players player = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _actor.Pseudo);
                    player.inBattle     = 0;
                    player.inBattleID   = 0;
                    player.inBattleType = "";
                }
            }

            // check si l'utilisateur est en combat
            if (_actor.inBattle == 1)
            {
                // recuperation des pseudo de tous les joueurs des 2 teams
                // check s'il y a une session de notre combat, normalement elle dois se trouver mais par mesure
                if (!Battle.Battles.Exists(f => f.IdBattle == _actor.idBattle))
                {
                    return;
                }
                Battle battle = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle);

                // récupération des données des utilisateurs du sideA
                string sideAData = battle.SideA.Aggregate("", (current, currentPlayerInfo) => current + (currentPlayerInfo.Pseudo + "#" + currentPlayerInfo.classeName + "#" + currentPlayerInfo.level + "#" + currentPlayerInfo.hiddenVillage + "#" + currentPlayerInfo.maskColorString + "#" + currentPlayerInfo.maxHealth + "#" + currentPlayerInfo.currentHealth + "#" + currentPlayerInfo.officialRang + "|"));

                if (sideAData == "")
                {
                    Console.WriteLine("le joueur est supposé etre en combat mais aucun joueurs ne se trouve dans la liste");
                    // la methode qui cloture le combat na pas fini son travail
                }
                if (sideAData != "")
                {
                    sideAData = sideAData.Substring(0, sideAData.Length - 1);
                }

                // récupération des données des utilisateurs team2
                string sideBData = battle.SideB.Aggregate("", (current, currentPlayerInfo) => current + (currentPlayerInfo.Pseudo + "#" + currentPlayerInfo.classeName + "#" + currentPlayerInfo.level + "#" + currentPlayerInfo.hiddenVillage + "#" + currentPlayerInfo.maskColorString + "#" + currentPlayerInfo.maxHealth + "#" + currentPlayerInfo.currentHealth + "#" + currentPlayerInfo.officialRang + "|"));
                if (sideBData.Length > 0)
                {
                    sideBData = sideBData.Substring(0, sideBData.Length - 1);
                }

                // envoie au client les données du combat
                var joinBattleResponseMessage = new JoinBattleInPreparationTimeResponseMessage();
                joinBattleResponseMessage.Initialize(new[] { sideAData, sideBData, battleStartPositions.Map(_actor.map, battle), MainClass.InitialisationBattleWaitTime.ToString(), battle.Timestamp.ToString() }, Nc);
                joinBattleResponseMessage.Serialize();
                joinBattleResponseMessage.Send();
            }
            else
            {
                // récuperer les données du map comme les joueurs abonnées
                string map = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _actor.Pseudo).map;
                _actor.map = map;

                StringBuilder data = new StringBuilder();
                foreach (mysql.connected connected in ((List <mysql.connected>)DataBase.DataTables.connected).FindAll(f => f.map == _actor.map))
                {
                    mysql.players curPlayer = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == connected.pseudo && f.inBattle == 0);
                    if (curPlayer == null)
                    {
                        break;
                    }
                    data.Append(connected.pseudo + "#" + curPlayer.classe + "#");

                    if (curPlayer.pvpEnabled == 0)
                    {
                        data.Append("0:null:null#");
                    }
                    else
                    {
                        data.Append(curPlayer.pvpEnabled + ":" + curPlayer.spirit + ":" + curPlayer.spiritLevel + "#");
                    }

                    int selectedPlayer = MainClass.netServer.Connections.FindIndex(sp => sp.Tag.GetType() == typeof(Actor) && ((Actor)sp.Tag).Pseudo == connected.pseudo);
                    if (selectedPlayer == -1)
                    {
                        return;
                    }
                    Enums.AnimatedActions.Name animatedAction;
                    // le serveur a planté sur l'affectaion du variable action bizarement, peux etre que l'autre client viens just de deco quand on essayé d'extraire son action, du coup il est null
                    if (selectedPlayer >= 0 && ((Actor)MainClass.netServer.Connections[selectedPlayer].Tag).animatedAction != Enums.AnimatedActions.Name.idle)
                    {
                        animatedAction = ((Actor)MainClass.netServer.Connections[selectedPlayer].Tag).animatedAction;
                    }
                    else
                    {
                        animatedAction = Enums.AnimatedActions.Name.idle;
                    }
                    List <Point> wayPointList = ((Actor)MainClass.netServer.Connections[selectedPlayer].Tag).wayPoint;
                    // il faut allimenter le wayPointString par les infos du joueur est non du celui qui demande les infos
                    string wayPointString = wayPointList.Aggregate("", (current, t) => current + (t.X + "," + t.Y + ':'));

                    if (wayPointString != string.Empty)
                    {
                        wayPointString = wayPointString.Substring(0, wayPointString.Length - 1);
                    }

                    // (_actor.Pseudo == connected.pseudo) ? curPlayer.level : 0) ?? étrange, on vérifie s'il s'agit de notre personnage, si c le cas on envoie notre niveau si non on envoie la valeur 0, pk envoyer nos states ? il faut juste selectionner les autres, ainsi pour le total pdv ... il faut enlever dans la boucle foreach la selection de notre personnage et envoyer que 0 sur les autre states level pdv ... ou les supprimer carémenet de la cmd
                    data.Append(curPlayer.hiddenVillage + "#" + curPlayer.maskColorString + "#" + curPlayer.map_position + "#" + curPlayer.directionLook + "#" + (_actor.Pseudo == connected.pseudo ? curPlayer.level : 0) + "#" + animatedAction + "#" + wayPointString + "#" + (_actor.Pseudo == connected.pseudo ? curPlayer.maxHEalth : 0) + "#" + (_actor.Pseudo == connected.pseudo ? curPlayer.currentHealth : 0) + "#" + _actor.officialRang + " |");
                    wayPointList.Clear();
                }

                if (data.ToString() == "")
                {
                    return;
                }
                data = new StringBuilder(data.ToString().Substring(0, data.Length - 1));

                GrabingMapInformationResponseMessage grabingMapInformationResponseMessage = new GrabingMapInformationResponseMessage();
                grabingMapInformationResponseMessage.Initialize(new[] { data.ToString() }, Nc);
                grabingMapInformationResponseMessage.Serialize();
                grabingMapInformationResponseMessage.Send();
            }
            #endregion
        }
Ejemplo n.º 4
0
        public bool Check()
        {
            if (_actor.Username == "" || _actor.Pseudo != "" || _actor.map != "")   // client dois être en session_zero
            {
                return(false);
            }

            if (CommandStrings.Length != 5)
            {
                return(false);
            }

            _nameOfNewActor = CommandStrings[1].ToString();

            // vérifier si le client envoie un nom de classe indisponible pour voir se que le parse va retourner, peux etre qu'il selectionne tjr la 1ere occurance
            if (!Enum.TryParse(CommandStrings[2].ToString(), out _selectedClass))
            {
                return(false); // class name introuvable
            }
            if (!Enum.TryParse(CommandStrings[3].ToString(), out _selectedHiddenVillage))
            {
                CreateNewActorVillageNotSelectedResponseMessage createNewActorVillageNotSelectedResponseMessage = new CreateNewActorVillageNotSelectedResponseMessage();
                createNewActorVillageNotSelectedResponseMessage.Initialize(null, Nc);
                createNewActorVillageNotSelectedResponseMessage.Serialize();
                createNewActorVillageNotSelectedResponseMessage.Send();
                return(false); // village introuvable
            }

            _maskColorString = CommandStrings[4].ToString();

            _maskColor = _maskColorString.Split('/');

            if (_maskColorString.Length < 14 || _maskColorString.Length > 35)
            {
                // MaskColor incorrect
                return(false);
            }
            if (_maskColor.Length != 3)
            {
                // MaskColor incorrect
                return(false);
            }

            // verification de la syntax du pseudo contre les caractères non autorisés
            // verification si le pseudo est déja utilisé
            mysql.players newPlayer = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _nameOfNewActor);

            if (newPlayer != null)
            {
                // traitement quand l'utilisateur tente de créer un joueur avec un pseudo déja utilisé
                CreateNewActorNameAlreadyUsedResponseMessage newActorNameAlreadyUsedResponseMessage = new CreateNewActorNameAlreadyUsedResponseMessage();
                newActorNameAlreadyUsedResponseMessage.Initialize(null, Nc);
                newActorNameAlreadyUsedResponseMessage.Serialize();
                newActorNameAlreadyUsedResponseMessage.Send();
                return(false);
            }
            if (_nameOfNewActor.Length < 3 || _nameOfNewActor.Length > 10)
            {
                // traitement quand l'utilisateur tente de créer un joueur avec un pseudo déja utilisé
                CreateNewActorNameWrongSizeResponseMessage newActorPseudoWrongSizeResponseMessage = new CreateNewActorNameWrongSizeResponseMessage();
                newActorPseudoWrongSizeResponseMessage.Initialize(null, Nc);
                newActorPseudoWrongSizeResponseMessage.Serialize();
                newActorPseudoWrongSizeResponseMessage.Send();
                return(false);
            }
            if (!Security.check_valid_pseudo(_nameOfNewActor.ToLower()))
            {
                CreateNewActorNameNotAllowedResponseMessage newActorNameNotAllowedResponseMessage = new CreateNewActorNameNotAllowedResponseMessage();
                newActorNameNotAllowedResponseMessage.Initialize(null, Nc);
                newActorNameNotAllowedResponseMessage.Serialize();
                newActorNameNotAllowedResponseMessage.Send();
                return(false);
            }

            // verification si le joueurs a attein le nombre maximum des joueurs (5)
            List <mysql.players> player = ((List <mysql.players>)DataBase.DataTables.players).FindAll(f => f.user == _actor.Username);

            if (player.Count == 5)
            {
                CreateNewActorMaxCharactersReachedReponseMessage newActorMaxActorReachedReponseMessage = new CreateNewActorMaxCharactersReachedReponseMessage();
                newActorMaxActorReachedReponseMessage.Initialize(null, Nc);
                newActorMaxActorReachedReponseMessage.Serialize();
                newActorMaxActorReachedReponseMessage.Send();
                return(false);
            }

            for (int cnt = 0; cnt < 3; cnt++)
            {
                if (_maskColor[cnt] == "null")
                {
                    continue;
                }
                string[] flag = _maskColor[cnt].Split('-');

                if (flag.Length != 3)
                {
                    // maskColor incorrecte
                    return(false);
                }
                for (int cnt2 = 0; cnt2 < 3; cnt2++)
                {
                    int  tmpInt;
                    bool result = int.TryParse(flag[cnt2], out tmpInt);

                    if (!result)
                    {
                        // MaskColor incorrect
                        return(false);
                    }
                    if (tmpInt < 0 || tmpInt > 255)
                    {
                        // MaskColor incorrect
                        return(false);
                    }
                }
                // end for
            }

            return(true);
        }
Ejemplo n.º 5
0
        public void Apply()
        {
            string tmp = ((List <mysql.players>)DataBase.DataTables.players).FindAll(f => f.user == _actor.Username).Aggregate(string.Empty, (current, p) => current + (p.pseudo + "#" + p.level + "#" + p.spirit + "#" + p.classe + "#" + p.pvpEnabled + "#" + p.spiritLevel + "#" + p.hiddenVillage + "#" + p.maskColorString + "#null#null|"));

            // verification si le joueur a créée des personnages
            if (((List <mysql.players>)DataBase.DataTables.players).Exists(f => f.user == _actor.Username))
            {
                // on check si l'utilisateur est en combat, si oui, verifier si le combat existe, si oui, verifier s'il reste plus d'1 joueur non invoc dans les 2 teams
                // un probleme arrive rarement qui fait qu'un client se deconnecte d'un combat, et apres il co et il bug sur l'état qu'il été en combat, alors qu'il s'est deconnecté mais le serveur garde la session de combat, donc il cloture pas
                if (_actor.inBattle == 1)
                {
                    if (!Battle.Battles.Exists(f => f.IdBattle == _actor.idBattle))
                    {
                        _actor.inBattle = 0;
                        // mise a jours sur la bdd
                        // mise du statut inBattle = 0, idBattle = -1 pour les joueurs
                        mysql.players p = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == _actor.Pseudo);
                        p.inBattle     = 0;
                        p.inBattleID   = 0;
                        p.inBattleType = "";
                    }
                    else
                    {
                        Battle battle = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle);
                        if (battle.SideA.FindAll(f => f.species == Species.Name.Human).Count + battle.SideB.FindAll(f => f.species == Species.Name.Human).Count < 2)
                        {
                            // le combat dois etre cloturé puisqu'il reste qu'un seul joueur dans l'une des 2 team
                            if (CommonCode.IsClosedBattle(battle, false))
                            {
                                // il faut cloturer le combat
                                battle.State = battleState.state.closed;
                                //Console.WriteLine ("1client qui été en combat alors qu'il viens just de co peux etre, peux etre que ca va faire beuguer le client avec les cmd de cloture");
                                _actor.inBattle = 0;
                            }
                        }
                    }
                }


                // verification si le joueur été en combat avec un personnage
                mysql.players actorAlreadyConnectedInBattle = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.inBattle == 1 && f.user == _actor.Username);

                // check si un des joueurs est en combat

                // verifier si il faut utiliser la valeur "actor.inBattle == 1" ou bien "actorAlreadyConnectedInBattle != null"
                // un check si le jouer est en combat est deja fait en haut, mais celui d'en haut est pour réctifier un problème qui arrive
                // du coup on répare ce bug et dans cette 2eme condition on revérifie, il faut peux etre penser a réunir cette 2éme partie dans la 1ere "celle d'en haut"
                // au lieu de revérifier apres avoir déjà fait le control
                //if (actorAlreadyConnectedInBattle != null)
                if (_actor.inBattle == 1)
                {
                    #region ///////// DECO RECO pas encore testé
                    // l'un des joueur est en combat, recuperation du map
                    Console.WriteLine("player " + actorAlreadyConnectedInBattle.pseudo + " inBattle-map: " + actorAlreadyConnectedInBattle.map);
                    _actor.Pseudo = actorAlreadyConnectedInBattle.pseudo;
                    CommonCode.RefreshStats(Nc);
                    ////////////////////////////////
                    string spells = ((List <mysql.players>)DataBase.DataTables.players).Find(f => f.pseudo == actorAlreadyConnectedInBattle.pseudo).sorts;
                    // recuperer le totalXp du niveau en cours
                    int maxXp;

                    maxXp = ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Count == _actor.level ? ((List <mysql.xplevel>)DataBase.DataTables.xplevel)[((List <mysql.xplevel>)DataBase.DataTables.xplevel).Count - 1].xp : ((List <mysql.xplevel>)DataBase.DataTables.xplevel).Find(f => f.level == (_actor.level + 1)).xp;

                    // convertir la list de quete en string, ce code se trouve sur 2 endroit, quand le joueur selectionne un player et quand le joueur été déja dans un combat et que apres un co qui précédé une deco, le player se selectionne tous seul
                    string quete = "";
                    foreach (Actor.QuestInformation t in _actor.Quests)
                    {
                        quete += t.QuestName + ":" + t.MaxSteps + ":" + t.CurrentStep + ":" + t.Submited + "/";
                    }

                    if (quete != "")
                    {
                        quete = quete.Substring(0, quete.Length - 1);
                    }

                    // si une modification sur cette cmd a été faite, il faut vérifier tous les cmd avec cmd•SelectedPlayer et aussi checkandupdatestates
                    string buffer = _actor.Pseudo + "#" + _actor.classeName + "#" + _actor.spirit + "#" +
                                    _actor.spiritLvl.ToString() + "#" + _actor.Pvp.ToString() + "#" + _actor.hiddenVillage + "#" + _actor.maskColorString + "#" +
                                    _actor.directionLook.ToString() + "#" + _actor.level.ToString() + "#" + _actor.map + "#" + _actor.officialRang.ToString() +
                                    "#" + _actor.currentHealth.ToString() + "#" + _actor.maxHealth.ToString() + "#" + _actor.xp.ToString() +
                                    "#" + maxXp + "#" + _actor.doton.ToString() + "#" + _actor.katon.ToString() + "#" +
                                    _actor.futon.ToString() + "#" + _actor.raiton.ToString() + "#" + _actor.suiton.ToString() + "#" +
                                    MainClass.chakralvl1 + "#" + MainClass.chakralvl2 + "#" + MainClass.chakralvl3 + "#" +
                                    MainClass.chakralvl4 + "#" + MainClass.chakralvl5 + "#" + _actor.usingDoton.ToString() + "#" +
                                    _actor.usingKaton.ToString() + "#" + _actor.usingFuton.ToString() + "#" + _actor.usingRaiton.ToString() +
                                    "#" + _actor.usingSuiton.ToString() + "#" + _actor.equipedDoton.ToString() + "#" +
                                    _actor.equipedKaton.ToString() + "#" + _actor.equipedFuton.ToString() + "#" +
                                    _actor.equipedRaiton.ToString() + "#" + _actor.equipedSuiton.ToString() + "#" +
                                    _actor.originalPc.ToString() + "#" + _actor.originalPm.ToString() + "#" + _actor.pe.ToString() + "#" +
                                    _actor.cd.ToString() + "#" + _actor.summons.ToString() + "#" + _actor.initiative.ToString() + "#" +
                                    _actor.job1 + "#" + _actor.job2 + "#" + _actor.specialty1 + "#" +
                                    _actor.specialty2 + "#" + _actor.maxWeight.ToString() + "#" + _actor.currentWeight.ToString() +
                                    "#" + _actor.ryo.ToString() + "#" + _actor.resiDotonPercent.ToString() + "#" +
                                    _actor.resiKatonPercent.ToString() + "#" + _actor.resiFutonPercent.ToString() + "#" +
                                    _actor.resiRaitonPercent.ToString() + "#" + _actor.resiSuitonPercent.ToString() + "#" +
                                    _actor.dodgePC.ToString() + "#" + _actor.dodgePM.ToString() + "#" + _actor.dodgePE.ToString() + "#" +
                                    _actor.dodgeCD.ToString() + "#" + _actor.removePC.ToString() + "#" + _actor.removePM.ToString() + "#" +
                                    _actor.removePE.ToString() + "#" + _actor.removeCD.ToString() + "#" + _actor.escape.ToString() + "#" +
                                    _actor.blocage.ToString() + "#" + spells + "#" + _actor.resiDotonFix + "#" + _actor.resiKatonFix + "#" +
                                    _actor.resiFutonFix + "#" + _actor.resiRaitonFix + "#" + _actor.resiSuitonFix + "#" + _actor.resiFix + "#" +
                                    _actor.domDotonFix + "#" + _actor.domKatonFix + "#" + _actor.domFutonFix + "#" + _actor.domRaitonFix + "#" +
                                    _actor.domSuitonFix + "#" + _actor.domFix + "#" + _actor.power + "#" + _actor.equipedPower + "•" + quete +
                                    "•inBattle•" + _actor.spellPointLeft;

                    AutoSelectActorInBattleResponseMessage selectedActorGrantedResponseMessage = new AutoSelectActorInBattleResponseMessage();
                    selectedActorGrantedResponseMessage.Initialize(new[] { buffer }, Nc);
                    selectedActorGrantedResponseMessage.Serialize();
                    selectedActorGrantedResponseMessage.Send();

                    mysql.connected newConnection = ((List <mysql.connected>)DataBase.DataTables.connected).Find(f => f.user == _actor.Username);
                    newConnection.pseudo       = _actor.Pseudo;
                    newConnection.timestamp    = CommonCode.ReturnTimeStamp();
                    newConnection.map          = _actor.map;
                    newConnection.map_position = _actor.map_position.X + "/" + _actor.map_position.Y;

                    // mise en combat du joueur
                    _actor.inBattle = 1;
                    Battle battle = Battle.Battles.Find(f => f.IdBattle == _actor.idBattle);
                    _actor.teamSide = battle.SideA.Exists(f => f.Pseudo == _actor.Pseudo) ? Team.Side.A : Team.Side.B;

                    // envoie d'une cmd au client qui contiens tous les infos du combat

                    // collecte des données des 2 joueurs

                    /*
                     * // envoie au client la confirmation du challenge
                     * commun.SendMessage("cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(pi.map) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Start().Split('|')[0] + "•" + battleStartPositions.Start().Split('|')[1], im, true);*/

                    // modification des position des joueurs selon les position valide du map aléatoirement

                    /*string[] team1ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0].Split('#');
                     * string[] team2ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1].Split('#');
                     *
                     * _battle.team1ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0];
                     * _battle.team2ValidePos = battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1];
                     *
                     * string playersData = "";
                     *
                     * for (int cnt = 0; cnt < _battle.Team1.Count; cnt++)
                     * {
                     *  PlayerInfo pit1 = _battle.Team1[cnt];
                     *  playersData += pit1.Pseudo + "#" + pit1.ClasseName + "#" + pit1.Level + "#" + pit1.village + "#" + pit1.MaskColors + "#" + pit1.totalPdv + "#" + pit1.CurrentPdv + "#" + pit1.rang + "#" + pit1.Initiative + "#" + pit1.doton + "#" + pit1.katon + "#" + pit1.futon + "#" + pit1.raiton + "#" + pit1.suiton + "#" + pit1.usingDoton + "#" + pit1.usingKaton + "#" + pit1.usingFuton + "#" + pit1.usingRaiton + "#" + pit1.usingSuiton + "#" + pit1.dotonEquiped + "#" + pit1.katonEquiped + "#" + pit1.futonEquiped + "#" + pit1.raitonEquiped + "#" + pit1.suitonEquiped + "#" + pit1.pc + "#" + pit1.pm + "#" + pit1.pe + "#" + pit1.cd + "#" + pit1.invoc + "#" + pit1.resiDoton + "#" + pit1.resiKaton + "#" + pit1.resiFuton + "#" + pit1.resiRaiton + "#" + pit1.resiSuiton + "#" + pit1.esquivePC + "#" + pit1.esquivePM + "#" + pit1.esquivePE + "#" + pit1.esquiveCD + "#" + pit1.retraitPC + "#" + pit1.retraitPM + "#" + pit1.retraitPE + "#" + pit1.retraitCD + "#" + pit1.evasion + "#" + pit1.blocage + "#" + pit1.genre.ToString() + "#" + pit1.Orientation + ":";
                     *
                     *  Random random = new Random();
                     *  int rand = random.Next(team2ValidePos.Length);
                     *  pit1.map_position = new Point(Convert.ToInt32(team1ValidePos[rand].Split('/')[0]), Convert.ToInt32(team1ValidePos[rand].Split('/')[1]));
                     * }
                     *
                     * if (playersData != "")
                     *  playersData = playersData.Substring(0, playersData.Length - 1);
                     *
                     * playersData += "|";
                     *
                     * for (int cnt = 0; cnt < _battle.Team2.Count; cnt++)
                     * {
                     *  PlayerInfo pit2 = _battle.Team2[cnt];
                     *  playersData += pit2.Pseudo + "#" + pit2.ClasseName + "#" + pit2.Level + "#" + pit2.village + "#" + pit2.MaskColors + "#" + pit2.totalPdv + "#" + pit2.CurrentPdv + "#" + pit2.rang + "#" + pit2.Initiative + "#" + pit2.doton + "#" + pit2.katon + "#" + pit2.futon + "#" + pit2.raiton + "#" + pit2.suiton + "#" + pit2.usingDoton + "#" + pit2.usingKaton + "#" + pit2.usingFuton + "#" + pit2.usingRaiton + "#" + pit2.usingSuiton + "#" + pit2.dotonEquiped + "#" + pit2.katonEquiped + "#" + pit2.futonEquiped + "#" + pit2.raitonEquiped + "#" + pit2.suitonEquiped + "#" + pit2.pc + "#" + pit2.pm + "#" + pit2.pe + "#" + pit2.cd + "#" + pit2.invoc + "#" + pit2.resiDoton + "#" + pit2.resiKaton + "#" + pit2.resiFuton + "#" + pit2.resiRaiton + "#" + pit2.resiSuiton + "#" + pit2.esquivePC + "#" + pit2.esquivePM + "#" + pit2.esquivePE + "#" + pit2.esquiveCD + "#" + pit2.retraitPC + "#" + pit2.retraitPM + "#" + pit2.retraitPE + "#" + pit2.retraitCD + "#" + pit2.evasion + "#" + pit2.blocage + "#" + pit2.genre.ToString() + "#" + pit2.Orientation;
                     *
                     *  Random random = new Random();
                     *  int rand = random.Next(team2ValidePos.Length);
                     *  pit2.map_position = new Point(Convert.ToInt32(team2ValidePos[rand].Split('/')[0]), Convert.ToInt32(team2ValidePos[rand].Split('/')[1]));
                     * }
                     * ////////////////////////////////////
                     * string team1 = "";
                     * string team2 = "";
                     *
                     * foreach (PlayerInfo piib in _battle.Team1)
                     *  team1 += piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#";
                     * team1 = team1.Substring(0, team1.Length - 1);
                     *
                     * foreach (PlayerInfo piib in _battle.Team2)
                     *  team2 += piib.Pseudo + "|" + piib.map_position.X + "/" + piib.map_position.Y + "#";
                     * team2 = team2.Substring(0, team2.Length - 1);
                     *
                     * commun.SendMessage("cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0] + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1], im, true);
                     * Console.WriteLine("<--cmd•challengeBegan•" + playersData + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType) + "•" + MainClass.InitialisationBattleWaitTime + "•" + _battle.BattleType + "•" + team1 + "•" + team2 + "•" + _battle.State + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[0] + "•" + battleStartPositions.Map(_battle.Map, _battle.BattleType).Split('|')[1] + " to " + pi.Pseudo);*/
                    #endregion
                }
                else
                {
                    tmp = tmp.Substring(0, tmp.Length - 1);
                    GrabingActorsInformationResponseMessage grabingPlayersInformationResponseMessage = new GrabingActorsInformationResponseMessage();
                    grabingPlayersInformationResponseMessage.Initialize(new [] { tmp }, Nc);
                    grabingPlayersInformationResponseMessage.Serialize();
                    grabingPlayersInformationResponseMessage.Send();
                }
            }
            else
            {
                // l'utilisateur na pas de joueurs, il faut le basculer vers le map CreatePlayer
                CreateNewActorResponseMessage createNewPlayerResponseMessage = new CreateNewActorResponseMessage();
                createNewPlayerResponseMessage.Initialize(CommandStrings, Nc);
                createNewPlayerResponseMessage.Serialize();
                createNewPlayerResponseMessage.Send();
            }
        }