Skip to content

Conversation

@rostov114
Copy link
Contributor

Check it if possible. Especially "Modify" hook.

true - offline invite
false - online invite

@Lorenzo-oo
Copy link
Contributor

Not sure why this flag is needed. Param #3 is userID for online invite and Zero for offline invite

@rostov114
Copy link
Contributor Author

userID for online invite and Zero for offline invite

userID - it always exists. And it always contains a valid SteamID.

RelationshipManager.sendofflineinvite

...
		ulong @ulong = arg.GetULong(0, 0UL);
		if (@ulong == 0UL)
		{
			return;
		}
		BasePlayer basePlayer2 = BasePlayer.FindAwakeOrSleepingByID(@ulong);
		if (basePlayer2 != null && !basePlayer2.GetInfoBool("client.allowteaminvitesremoteplayers", true))
		{
			basePlayer.ShowToast(GameTip.Styles.Error, RelationshipManager.RemoteInvitesBlocked, false, Array.Empty<string>());
			return;
		}
		if (basePlayer2 == null || (!basePlayer2.IsNpc && basePlayer2.currentTeam == 0UL))
		{
			if (Interface.CallHook("OnTeamMemberInvite", playerTeam, basePlayer, @ulong) != null)
			{
				return;
			}
			playerTeam.SendInvite(basePlayer2, @ulong);
		}

RelationshipManager.sendinvite

...
		ulong @ulong = arg.GetULong(0, 0UL);
		if (@ulong == 0UL)
		{
			return;
		}
		BasePlayer basePlayer2 = BaseNetworkable.serverEntities.Find(new NetworkableId(@ulong)) as BasePlayer;
		if (basePlayer2 && basePlayer2 != basePlayer && !basePlayer2.IsNpc && basePlayer2.currentTeam == 0UL)
		{
			float num = 7f;
			if (Vector3.Distance(basePlayer2.transform.position, basePlayer.transform.position) > num)
			{
				return;
			}
			if (Interface.CallHook("IOnTeamInvite", basePlayer, basePlayer2) != null)
			{
				return;
			}
			if (Interface.CallHook("OnTeamMemberInvite", playerTeam, basePlayer, basePlayer2.userID.Get()) != null)
			{
				return;
			}
			playerTeam.SendInvite(basePlayer2);
		}

If userID is zero, hook is not executed.

@Lorenzo-oo
Copy link
Contributor

my bad !

@ads102003 ads102003 merged commit 5b94287 into OxideMod:develop Nov 29, 2025
ads102003 pushed a commit that referenced this pull request Nov 29, 2025
ads102003 pushed a commit that referenced this pull request Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants