Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature Request: Make scripts valid message senders #1179
Brief summary of issue:
For those of us familiar with MUSH systems as staffers, we likely know about job systems. In my efforts to create one for my own MUSH, I ran into a snag. Specifically, that I could not set the job handler script as a message's sender as it only supports objects, players, and external sources as senders.
Steps to reproduce the issue:
In concrete terms, any attempts to send a message with a script as a sender results in a None-type object being saved to the field. This can cause significant issues when attempting to display or retrieve the message later. Hence, any attempts to do so tend to throw an AttributeError.
Well, the basic idea I have is adding the script DB as a valid list of objects (In the object-oriented coding sense) to compare the incoming script against. I'm not sure if there is a reason here, but it seems to be problematic what I was attempting to do.
You can attach tags to Msg objects with arbitrary data, so for custom models I have that I wanted to associate with Msg objects, I just made tags of a category that identified the model and then made a tag that corresponded to some combination of the model/id to identify it uniquely. You could do the same by having tags like
Alternately, you can use the db_senders_external field in a Msg object to attach a string name of the sender, and just pass along the script name if you want to make it appear from them, but don't necessarily need to access its data. Or use it similarly to tags for getting the script objects from its key when you pass it along.
changed the title from
Scripts are invalid message senders.
Feature Request: Make scripts valid message senders
Jan 29, 2017
This is not a bug but a well-documented feature of Msg:es. They originally only supported Players, but was extended to also support ObjecDBs by popular demand. We could by all means extend it to Scripts too, there was just never a reason to.
Changed to a feature request.