lotrointerface.com
Search Downloads


Go Back   LoTROInterface > DDO > Developer Discussions > General Authoring Discussion (D)

Reply
Thread Tools Display Modes
  #1  
Unread 07-27-2019, 05:05 AM
Agollas's Avatar
Agollas Agollas is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jul 2019
Posts: 9
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
Reply With Quote
  #2  
Unread 07-27-2019, 11:26 AM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 339
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.

Last edited by Garan : 07-27-2019 at 11:48 AM. Reason: clarification
Reply With Quote
  #3  
Unread 07-27-2019, 11:44 AM
Agollas's Avatar
Agollas Agollas is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jul 2019
Posts: 9
Quote:
Originally Posted by Garan
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

Last edited by Agollas : 07-27-2019 at 11:44 AM. Reason: Missing word
Reply With Quote
  #4  
Unread 07-27-2019, 12:49 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 339
Quote:
Originally Posted by Agollas
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?)

Last edited by Garan : 07-27-2019 at 12:51 PM.
Reply With Quote
  #5  
Unread 07-27-2019, 01:44 PM
Agollas's Avatar
Agollas Agollas is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jul 2019
Posts: 9
Quote:
Originally Posted by Garan
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?

Last edited by Agollas : 07-27-2019 at 02:05 PM.
Reply With Quote
  #6  
Unread 07-27-2019, 02:08 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 339
Quote:
Originally Posted by Agollas
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.

Last edited by Garan : 07-27-2019 at 02:28 PM.
Reply With Quote
  #7  
Unread 07-27-2019, 02:20 PM
Agollas's Avatar
Agollas Agollas is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jul 2019
Posts: 9
Quote:
Originally Posted by Garan
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
Reply With Quote
  #8  
Unread 07-27-2019, 02:44 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 339
Quote:
Originally Posted by Agollas
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.

Last edited by Garan : 07-27-2019 at 02:51 PM.
Reply With Quote
  #9  
Unread 07-27-2019, 04:20 PM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 339
Quote:
Originally Posted by Agollas
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.
Reply With Quote
  #10  
Unread 07-27-2019, 07:56 PM
Agollas's Avatar
Agollas Agollas is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jul 2019
Posts: 9
Quote:
Originally Posted by Garan
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?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin support for German and French clients Chiran Lua Programming Help (L) 11 10-13-2014 07:36 PM


All times are GMT -5. The time now is 12:53 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui