Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chat channel onJoin message gets send to all others but not the one that joined #4618

Open
xmish opened this issue Jan 7, 2024 · 1 comment

Comments

@xmish
Copy link
Contributor

xmish commented Jan 7, 2024

https://github.com/otland/forgottenserver/blob/6579f1263271b0c431b00ae779b5b102569178d8/data/chatchannels/scripts/advertising.lua#L42C10-L45

onJoin message gets sent to all other members but the one that joined as it uses sendToAll
https://github.com/otland/forgottenserver/blob/6579f1263271b0c431b00ae779b5b102569178d8/src/chat.cpp#L117C6-L117C17

client

@xmish
Copy link
Contributor Author

xmish commented Jan 7, 2024

my naive workaround (delayed as OTClient complained that channel is not yet open (channel is null - problem in OTClient I guess)):

	addEvent(function(pid) 
		local player = Player(pid)
		if not player then
			return
		end

		player:sendChannelMessage("", "Here you can advertise all kinds of things. Among others, you can trade items, advertise ingame events, seek characters for a quest or a hunting group, find members for your guild or look for somebody to help you with something.", MESSAGE_GUILD, CHANNEL_ADVERTISING)
		player:sendChannelMessage("", "It goes without saying that all advertisements must conform to the Rules, e.g. it is illegal to advertise trades including real money.", MESSAGE_GUILD, CHANNEL_ADVERTISING)
	end, 100, player:getId())

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

No branches or pull requests

1 participant