Mass Friend Request

Posts 1–3 of 3 · Page 1 of 1
Mass Friend Request
This only works on people that are in your current world/location. Using PlayerList...duuhhhh
This will also freeze when doing it, but it aint no biggie. Thread.Sleep :PP
Also sometimes crashes randomly from what I can see.


I'm not versed, but if you can list all Map/cell IDs, teleport to each of them, then SendFriendRequest once you're there. That way you can get more people.

This could be useful to some people I guess?
I personally put this in Game class in Update() void
Code:
if (Input.GetKey(KeyCode.Insert))
{
	foreach (Player player2 in Entities.Instance.PlayerList)
	{
		Chat.Notify(player2.name.ToString(), "[FF0000]", Chat.FilterType.General);
	}
}
1) Find SendFriendRequest. There should be 2 of them, 1 using int/ID and another one using string/name.
2) Change SendFriendRequest(int id) to
Code:
public void SendFriendRequest(int id)
{
	if (Session.MyPlayerData.CanAddMoreFriends)
	{
		foreach (Player player2 in Entities.Instance.PlayerList)
		{
			RequestFriend requestFriend = new RequestFriend();
			requestFriend.CharID = Session.MyPlayerData.ID;
			requestFriend.FriendID = player2.ID;
			this.aec.sendRequest(requestFriend);
			Thread.Sleep(500);
		}
	}
}
3) Change SendFriendRequest(string name) to
Code:
	public void SendFriendRequest(string name)
	{
		if (Session.MyPlayerData.CanAddMoreFriends)
		{
			foreach (Player player2 in Entities.Instance.PlayerList)
			{
				RequestFriend requestFriend = new RequestFriend();
				requestFriend.CharID = Session.MyPlayerData.ID;
				requestFriend.FriendID = -1;
				requestFriend.Name = player2.name.ToString();
				this.aec.sendRequest(requestFriend);
				Thread.Sleep(500);
			}
		}
	}
4) Save
5) Profit



UPDATE: To bypass Ignore for adding friends.
Find SyncIgnore void
Take out the sendrequest part
Enjoy adding people who have you blocked

Quote Originally Posted by bennyboo123 View Post
[FONT="Verdana"][COLOR="Black"][SIZE="2"][COLOR="#B22222"]This only works on people that are in your current world/location. Using PlayerList...duuhhhh
I personally wouldn't use Thread.Sleep if possible. Instead try adding
using System.Threading.Tasks;
then make your method async and call
await Task.Delay(int DelayInMS);
Just my preference, not trying to say it's better.
Quote Originally Posted by IfOnlyYouKnew View Post
I personally wouldn't use Thread.Sleep if possible. Instead try adding
then make your method async and call Just my preference, not trying to say it's better.
You're 100% correct. Just the first thing that popped in my mind to make it work :P
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us