LoTROInterface

LoTROInterface (https://www.lotrointerface.com/forums/index.php)
-   General Authoring Discussion (D) (https://www.lotrointerface.com/forums/forumdisplay.php?f=45)
-   -   Broadcasting to plugins on other Clients (https://www.lotrointerface.com/forums/showthread.php?t=3762)

Agollas 07-27-2019 05:05 AM

Broadcasting to plugins on other Clients
 
I'm working on a plugin at the moment. As part of it, it would be nice for it to be able to broadcast something to update a value on everyone's plugin server wide (only very occasionally and on a button click).

Would using a userChat channel for this be allowed?

Or would that be considered as spam?

Thanks

Garan 07-27-2019 11:26 AM

I created a chat system for the multi-player Cards game (unpublished). This would not be spam as it would be broadcast to a channel that players have voluntarily chosen to accept. There are however a couple of issues that have to be considered. However, all other rules of chat such as harassment, etc. would still apply even if it is a user chat - I assume your plugin is not a Monty Pythonesque channel ;) so this shouldn't be an issue.

First, you have to determine which chat channel number your channel is on each client. Since you can't really control which channels the user already has in use, you will have to determine that at run time. This isn't too complicated, it just requires a /listchannels command in a button on your interface, then you parse the response to see if your channel already exists, if not, you present a /joinchannel button that joins the channel. You could skip the /listchannels, but then if the user did already have your channel set the response to a join is just 'You are already in room 'whatever'' without telling you which channel number so your plugin wouldn't know which number to use without first dropping the channel and re-adding it - it is simpler to just use the /listchannels to see if it is already being used and determine the channel id from that.

Unfortunately, it would be possible for someone to maliciously lock you (and any users of your plugin) out of your chosen chat channel after a server restart. We had issues with this occurring with the old glff channel on occaision - a malicious user would get in shortly after the server came up and create the channel with a password, effectively locking all other users out. Unfortunately, creating your channel with a password does not protect against this as all user chat channels are wiped when the last user leaves and the next join command creates a new channel (with whatever optional password they specify).

The second issue I haven't tested lately, but it used to be that you have to make sure your users have the specific user chat channel selected in the chat channel filters for at least one chat tab or the user won't get the messages (and your plugin won't either). I believe this is still the current rule.

These buttons can simply be displayed in a Chat Settings window that is only opened as needed to configure the plugin initially. I also allowed users to specify their own channel name there so that they could hold private games with more than 24 players/spectators.

FWIW, the chat system worked fine, I suspended development of the game system because it was far too easy for players to cheat. I toyed with a number of solutions to the cheating issue but none of them were satisfactory so I scrapped it but the user chat subsystem was a sound idea for cross client plugin communication.

Agollas 07-27-2019 11:44 AM

Quote:

Originally Posted by Garan (Post 12331)
I created a chat system for the multi-player Cards game (unpublished). This would not be spam as it would be broadcast to a channel that players have voluntarily chosen to accept. There are however a couple of issues that have to be considered.

First, you have to determine which chat channel number your channel is on each client. Since you can't really control which channels the user already has in use, you will have to determine that at run time. This isn't too complicated, it just requires a /listchannels command in a button on your interface, then you parse the response to see if your channel already exists, if not, you present a /joinchannel button that joins the channel. You could skip the /listchannels, but then if the user did already have your channel set the response to a join is just 'You are already in room 'whatever'' without telling you which channel number so your plugin wouldn't know which number to use without first dropping the channel and re-adding it - it is simpler to just use the /listchannels to see if it is already being used and determine the channel id from that.

Unfortunately, it would be possible for someone to maliciously lock you (and any users of your plugin) out of your chosen chat channel after a server restart. We had issues with this occurring with the old glff channel on occaision - a malicious user would get in shortly after the server came up and create the channel with a password, effectively locking all other users out. Unfortunately, creating your channel with a password does not protect against this as all user chat channels are wiped when the last user leaves and the next join command creates a new channel (with whatever optional password they specify).

The second issue I haven't tested lately, but it used to be that you have to make sure your users have the specific user chat channel selected in the chat channel filters for at least one chat tab or the user won't get the messages (and your plugin won't either). I believe this is still the current rule.

These buttons can simply be displayed in a Chat Settings window that is only opened as needed to configure the plugin initially. I also allowed users to specify their own channel name there so that they could hold private games with more than 24 players/spectators.

FWIW, the chat system worked fine, I suspended development of the game system because it was far too easy for players to cheat. I toyed with a number of solutions to the cheating issue but none of them were satisfactory so I scrapped it but the user chat subsystem was a sound idea for cross client plugin communication.


Thank you for that, it would only form a tiny part of the project, so might add in a later update.

One other question, I've been struggling to recieve the message when I've sent a tell to someone else, but works fine the other way, do you know of a way to fix that? Thanks

Garan 07-27-2019 12:49 PM

Quote:

Originally Posted by Agollas (Post 12332)
One other question, I've been struggling to recieve the message when I've sent a tell to someone else, but works fine the other way, do you know of a way to fix that? Thanks

This sounds like the issue I mentioned where an account doesn't have the specific user chat channel enabled in their chat filters on at least one chat tab.

For instance, if user1 has the custom channel in user chat 1 (uc1) and user2 had the custom channel in user chat 2 (uc2) then user 1 must have uc1 enabled in their chat filters and user 2 must have uc2 enabled in their chat filters. If user 2 has uc1 enabled but not uc2, they will not get the messages. I would recommend double checking the chat filters on the client that is not receiving the messages - if they display in the chat window but are still not received by the plugin then it is a different issue (are you sure your plugin is monitoring the correct user chat channel on each client?)

Agollas 07-27-2019 01:44 PM

Quote:

Originally Posted by Garan (Post 12333)
This sounds like the issue I mentioned where an account doesn't have the specific user chat channel enabled in their chat filters on at least one chat tab.

For instance, if user1 has the custom channel in user chat 1 (uc1) and user2 had the custom channel in user chat 2 (uc2) then user 1 must have uc1 enabled in their chat filters and user 2 must have uc2 enabled in their chat filters. If user 2 has uc1 enabled but not uc2, they will not get the messages. I would recommend double checking the chat filters on the client that is not receiving the messages - if they display in the chat window but are still not received by the plugin then it is a different issue (are you sure your plugin is monitoring the correct user chat channel on each client?)

Thanks again, yeah I was testing it and had it just repeating anything that was logged in chat.

If I typed /tell agorlas hi,

it would only repeat agorlas tells you: 'hi'

but wouldn't repeat you tell agorlas hi, even though that appears in the chat window.


Edit: Sorry, just realised I posted on the wrong section, it's meant to be for LoTRO, although I'm assuming it's similar for both?

Garan 07-27-2019 02:08 PM

Quote:

Originally Posted by Agollas (Post 12334)
Thanks again, yeah I was testing it and had it just repeating anything that was logged in chat.

If I typed /tell agorlas hi,

it would only repeat agorlas tells you: 'hi'

but wouldn't repeat you tell agorlas hi, even though that appears in the chat window.

ah. my mistake, I thought that you weren't receiving the tells from the other party. Is there a need to track your outgoing tells? You should still be able to, but it might require encoding the sender name in the message since the API reports the 'Sender' as the local player name (making Sender useless, or it was the last time I played with this about three years ago) for incoming messages. The actual sender is encoded in the beginning of the message in a <Select:IID> tag (which is handy if you want to create a control with a clickable link to the user). Note, that's only a problem with tells since with custom chats (or any channel other than tells), the message will be like "[To mychannel] some message" when you send the message.

Another thing I didn't mention, the response to /listchannels is a bit odd in that instead of just listing the user chats and their channels in Standard, it sends the user chat name to the actual channel for each channel that you have enabled in your filters - if you don't have a channel enabled, even if it has joined a custom chat, it will not generate a response since the chat server doesn't send messages on channels that aren't enabled in your filters. If you have a channel enabled in your filters but haven't actually joined any user chats on that channel it will respond with '<NOT CONNECTED>' on that channel.

Agollas 07-27-2019 02:20 PM

Quote:

Originally Posted by Garan (Post 12335)
ah. my mistake, I thought that you weren't receiving the tells from the other party. Is there a need to track your outgoing tells? You should still be able to, but it might require encoding the sender name in the message since there is a bug in the API that reports the 'Sender' as the local player name (making Sender useless, or it was the last time I played with this about three years ago) for incoming messages.

Yeah, i got around finding the sender issue using the xml(i think?) tags to identify the player. I've also started a log as part of the plug in, so that when the name is mentioned again, it will be displayed with the tag, so that you can access the right click menu.

I'm trying to make a chat plugin that lets you rename other players (and has the option to automatically rename them if it detects that they don't fit with "lore etc."), among other things. It's all working fine, apart from when you try to send a tell to a person who's been renamed, (particularly when done by right click on name + send tell). The right clicking works, but it then sends a tell to the new name (in brackets to stop accidentally sending it to the wrong person).

Now I just need to work out a way of capturing that outgoing failed tell, to correct it with the right name, then i can have a hidden alias button to send it to the correct person.

Any ideas for alternatives?
Cheers

Garan 07-27-2019 02:44 PM

Quote:

Originally Posted by Agollas (Post 12334)
Edit: Sorry, just realised I posted on the wrong section, it's meant to be for LoTRO, although I'm assuming it's similar for both?

Heh. I hadn't noticed either. I actually don't know what if any APIs DDO supports (last I knew it only supported skins, no APIs, i.e. no actual Programming) even though I played DDO years ago, it didn't have any APIs at the time. You could send a PM to Dolby or Cairenn and ask them to move the thread but I kind of doubt if anyone will object.

Garan 07-27-2019 04:20 PM

Quote:

Originally Posted by Agollas (Post 12336)
Yeah, i got around finding the sender issue using the xml(i think?) tags to identify the player. I've also started a log as part of the plug in, so that when the name is mentioned again, it will be displayed with the tag, so that you can access the right click menu.

I'm trying to make a chat plugin that lets you rename other players (and has the option to automatically rename them if it detects that they don't fit with "lore etc."), among other things. It's all working fine, apart from when you try to send a tell to a person who's been renamed, (particularly when done by right click on name + send tell). The right clicking works, but it then sends a tell to the new name (in brackets to stop accidentally sending it to the wrong person).

Now I just need to work out a way of capturing that outgoing failed tell, to correct it with the right name, then i can have a hidden alias button to send it to the correct person.

Any ideas for alternatives?
Cheers

Interesting idea, but how do you prevent your plugin from using an alternate name that actually exists? For instance player xyz gets renamed in your plugin as misterX. What if another character already exists called misterX or a new character gets created called misterX? Isn't that likely to create some issues?

I see now why the outgoing message is an issue for you, unfortunately I don't have any advice on this one. I'll let you know if I think of anything.

Agollas 07-27-2019 07:56 PM

Quote:

Originally Posted by Garan (Post 12338)
Interesting idea, but how do you prevent your plugin from using an alternate name that actually exists? For instance player xyz gets renamed in your plugin as misterX. What if another character already exists called misterX or a new character gets created called misterX? Isn't that likely to create some issues?

I see now why the outgoing message is an issue for you, unfortunately I don't have any advice on this one. I'll let you know if I think of anything.

So characters that have been renamed have brackets around them for now. But could change things, so that they change name again once they realise they're a duplicate.

One idea I did have was if there was a way to overwrite the/tell command with a custom one, but I don't know if that's possible?


All times are GMT -5. The time now is 06:34 AM.

vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI