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); } }
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); } }
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); }