Пример #1
0
        public static void ShowFriends(World.Network.WorldClient client, string packet = "")
        {
            string friendPacket = "FL";

            foreach (int i in client.AccountData.FriendsIDs)
            {
                if (Helper.AccountHelper.ExistAccountData(i))
                {
                    Database.Records.AccountDataRecord account = Helper.AccountHelper.GetAccountData(i);
                    friendPacket += "|" + account.NickName;
                    World.Network.WorldClient player = Helper.WorldHelper.GetClientByAccountNickName(account.NickName);
                    if (player != null)
                    {
                        if (player.AccountData.FriendsIDs.Contains(client.AccountData.AccountID))
                        {
                            friendPacket += player.Character.Pattern.CharacterToFriendsListKnow;
                        }
                        else
                        {
                            friendPacket += player.Character.Pattern.CharacterToFriendsListUnKnow;
                        }
                    }
                }
            }
            client.Send(friendPacket);
        }
Пример #2
0
        public static void DeleteFriend(World.Network.WorldClient client, string packet)
        {
            string nickname = packet.Substring(3);

            if (Helper.AccountHelper.ExistAccountData(nickname))
            {
                Database.Records.AccountDataRecord account = Helper.AccountHelper.GetAccountData(nickname);
                if (client.AccountData.FriendsIDs.Contains(account.AccountID))
                {
                    client.AccountData.FriendsIDs.Remove(account.AccountID);
                    ShowFriends(client);
                }
            }
        }
Пример #3
0
        public static void DeleteEnemies(World.Network.WorldClient client, string packet)
        {
            string nickname = packet.Substring(3);

            if (Helper.AccountHelper.ExistAccountData(nickname))
            {
                Database.Records.AccountDataRecord account = Helper.AccountHelper.GetAccountData(nickname);
                if (client.AccountData.EnemiesIDs.Contains(account.AccountID))
                {
                    client.AccountData.EnemiesIDs.Remove(account.AccountID);
                    ShowEnemies(client);
                    client.Action.BasicMessage("Vous venez de perdre un ennemie, Triomphe de la paix.", "36BBFD");
                }
            }
        }
Пример #4
0
 public static Database.Records.AccountDataRecord CreateNewAccountData(Database.Records.AccountRecord account)
 {
     try
     {
         Database.Records.AccountDataRecord newAccountData = new Database.Records.AccountDataRecord();
         newAccountData.AccountID = account.ID;
         newAccountData.NickName = account.Pseudo;
         newAccountData.Bank = World.Game.Items.ItemBag.CreateBag();
         newAccountData.Bank.Create();
         newAccountData.BankID = newAccountData.Bank.ID;
         Database.Cache.AccountDataCache.Cache.Add(newAccountData);
         newAccountData.CreateAndFlush();
         return newAccountData;
     }catch(Exception e)
     {
         Utilities.ConsoleStyle.Error("Error : " + e.ToString());
         return null;
     }
 }
Пример #5
0
 public static Database.Records.AccountDataRecord CreateNewAccountData(Database.Records.AccountRecord account)
 {
     try
     {
         Database.Records.AccountDataRecord newAccountData = new Database.Records.AccountDataRecord();
         newAccountData.AccountID = account.ID;
         newAccountData.NickName  = account.Pseudo;
         newAccountData.Bank      = World.Game.Items.ItemBag.CreateBag();
         newAccountData.Bank.Create();
         newAccountData.BankID = newAccountData.Bank.ID;
         Database.Cache.AccountDataCache.Cache.Add(newAccountData);
         newAccountData.CreateAndFlush();
         return(newAccountData);
     }catch (Exception e)
     {
         Utilities.ConsoleStyle.Error("Error : " + e.ToString());
         return(null);
     }
 }
Пример #6
0
 public static void WarnConnectionToFriends(World.Network.WorldClient client)
 {
     foreach (int i in client.AccountData.FriendsIDs)
     {
         if (Helper.AccountHelper.ExistAccountData(i))
         {
             Database.Records.AccountDataRecord account = Helper.AccountHelper.GetAccountData(i);
             World.Network.WorldClient          player  = Helper.WorldHelper.GetClientByAccountNickName(account.NickName);
             if (player != null)
             {
                 if (player.AccountData.FriendsIDs.Contains(client.AccountData.AccountID))
                 {
                     player.SendImPacket("0143", client.AccountData.NickName +
                                         "(<b><a href='asfunction:onHref,ShowPlayerPopupMenu," +
                                         client.Character.Nickname + "'>" + client.Character.Nickname + "</a></b>)");
                 }
             }
         }
     }
 }