Esempio n. 1
0
 public void InviteToGuild(RealmTime t, GuildInvitePacket pkt)
 {
     if (GuildRank >= 20)
     {
         foreach (var i in RealmManager.Clients.Values)
         {
             foreach (var l in RealmManager.Worlds)
             {
                 if (l.Key != 0)
                 {
                     foreach (var e in l.Value.Players)
                     {
                         if (e.Value.Name == pkt.Name)
                         {
                             if (e.Value.Guild == "")
                             {
                                 e.Value.Client.SendPacket(new InvitedToGuildPacket()
                                 {
                                     Name  = psr.Account.Name,
                                     Guild = psr.Account.Guild.Name
                                 });
                                 i.Player.Invited = true;
                                 return;
                             }
                             else
                             {
                                 SendError("Player is already in a guild!");
                             }
                         }
                     }
                 }
             }
         }
     }
     else
     {
         psr.SendPacket(new TextPacket()
         {
             BubbleTime = 0,
             Stars      = -1,
             Name       = "",
             Text       = "Members and initiates cannot invite!"
         });
     }
 }
 public void InviteToGuild(RealmTime t, GuildInvitePacket pkt)
 {
     if (GuildRank >= 20)
     {
         foreach (var i in RealmManager.Clients.Values)
         {
             foreach (var l in RealmManager.Worlds)
             {
                 if (l.Key != 0)
                 {
                     foreach (var e in l.Value.Players)
                     {
                         if (e.Value.Name == pkt.Name)
                         {
                             if (e.Value.Guild == "")
                             {
                                 e.Value.Client.SendPacket(new InvitedToGuildPacket()
                                 {
                                     Name = psr.Account.Name,
                                     Guild = psr.Account.Guild.Name
                                 });
                                 i.Player.Invited = true;
                                 return;
                             }
                             else
                             {
                                 SendError("Player is already in a guild!");
                             }
                         }
                     }
                 }
             }
         }
     }
     else
     {
         psr.SendPacket(new TextPacket()
         {
             BubbleTime = 0,
             Stars = -1,
             Name = "",
             Text = "Members and initiates cannot invite!"
         });
     }
 }