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 |
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. |
Quote:
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 |
Quote:
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?) |
Quote:
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? |
Quote:
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. |
Quote:
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 |
Quote:
|
Quote:
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. |
Quote:
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? |
Quote:
|
Quote:
What if you enclosed instructions/data inside the <Select:IID:....> tags, with a randomly chosen user ID? That way it would stop people from cheating, unless they wrote their own plugin to send that data? Thanks for your time again :) |
Quote:
Unfortunately, the "unless they wrote their own plugin" is the problem. Writing a basic Lua plugin is something anybody with even basic high school computer science knowledge can easily do. Heck, my 12 year old daughter is capable of far more complex programming. More sophisticated coding does exist but cheating would not require any sophistication. It is far too easy to display the raw chat. Additionally, it is far too easy to simply modify their own copy of the plugin - there's no way for the plugin to guarantee that the client is the unmodified client and for a card game that makes it just far too easy to cheat. The best solution I came up with was for the dealer to control the game and broadcast only those cards that should be shown 'face up' and to send all other info via private message. It would work fairly well as long as the dealer wasn't cheating since if any of the other clients claimed to have a card that the dealer knew it hadn't dealt they could be called out and booted from the game. Unfortunately the handshaking of the private tells got excessive and just wasn't worth the hassle. I've occasionally looked at the interface to see if there was a way to streamline the communication but it always winds up being ugly and I always have far more important things on the ToDo list so it gets dropped for another year. |
Thanks for that.
That all makes a lot of sense, I'm thinking of working on a tag style game, that can be played anywhere instead of just the ruins in bree. I guess it would be self policing enough, that I would just need to make it harder to do rather than impossible, so I suppose if anyone wants to cheat enough to edit the code, good on them, and they will get identified as cheating anyway. |
All times are GMT -5. The time now is 07:58 PM. |
vBulletin® - Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© MMOUI