Exemple #1
0
        private static void Invite(YiObj player, ref MsgTeam packet)
        {
            if (!TeamSystem.Teams.ContainsKey(player.UniqueId))
            {
                return;
            }
            if (TeamSystem.Teams[player.UniqueId].Members.ContainsKey(packet.TargetUniqueId))
            {
                return;
            }
            if (TeamSystem.Teams[player.UniqueId].Members.Count > 4)
            {
                return;
            }

            if (!GameWorld.Maps[player.MapId].Entities.TryGetValue(packet.TargetUniqueId, out var found))
            {
                return;
            }
            if (found == null)
            {
                return;
            }
            var target = found;

            (target as Player)?.Send(Invite(player));
            if (target is Bot)
            {
                TeamSystem.Join(player, target);
            }
        }
Exemple #2
0
 private static void AcceptInvite(YiObj player, ref MsgTeam packet)
 {
     if (GameWorld.Maps[player.MapId].Entities.TryGetValue(packet.TargetUniqueId, out var found))
     {
         var leader = found;
         TeamSystem.Join(leader, player);
     }
 }
Exemple #3
0
 private static void AcceptJoin(YiObj player, ref MsgTeam packet)
 {
     if (!TeamSystem.Teams.ContainsKey(player.UniqueId))
     {
         return;
     }
     if (TeamSystem.Teams[player.UniqueId].Members.Count > 4)
     {
         return;
     }
     if (!GameWorld.Maps[player.MapId].Entities.TryGetValue(packet.TargetUniqueId, out var found))
     {
         return;
     }
     if (found == null)
     {
         return;
     }
     TeamSystem.Join(player, found);
 }