View Issue Details

IDProjectCategoryView StatusLast Update
0000596LDMud 3.5Efunspublic2018-01-30 03:59
Reporterfufu Assigned ToGnomi  
PrioritynormalSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Fixed in Version3.5.0 
Summary0000596: new efuns for configuring objects and the driver
Description(This is a summary of an email exchange between Gnomi, Zesstra and me. The proposal is not yet complete, and open for discussion.)

The driver has numerous efuns for setting various options on objects and the driver, for example enable_commands(), set_buffer_size() or set_limits(). The idea of this proposal is to replace this increasing number of efuns by a generic interface for configuring objects and the driver:

  void configure_object(object ob, int what, mixed data)
  void configure_interactive(object ob, int what, mixed data)
  void configure_driver(int what, mixed data)

'what' would be an identifier for the setting - I'd suggest OC_*, IC_* or DC_*, for each of the respective respectively.

'ob' would be the object to configure. If we want to support changing the defaults, ob = 0 can be used for that.

Changing some settings will cause a privilege violation. Changing defaults should always cause a privilege violation.

If we find a good use for it, the return value can be changed to int for returning error codes. (Zesstra wants this. Gnomi and I currently don't.)

In addition, there should also be functions for querying the settings:

  mixed object_info(object ob, int what[, int index])
      (the extra argument comes from the existing object_info())
  mixed interactive_info(object ob, int what)
  mixed driver_info(int what[, mixed arg1[, mixed arg2]])
      (the extra arguments come from debug_info())

Candidates for replacement are as follows:

objects:
  enable_commands / disable_commands (set, query)
  set_heart_beat (set, query)
  set_modify_commands (set, query)
  query_actions (query only)
  object_info (reuse OINFO_*, I guess. query only)
  query_shadowing (query only)
  query_once_interactive (query only)

interactives:
  set_prompt (set, query)
  enable_telnet (set, query)
  start_mccp_compress / end_mccp_compress / query_mccp (set, query)
  set_buffer_size (set, query)
  set_combine_charset (set, query)
  set_connection_charset (set, query)
  set_max_commands (set, query)
  query_editing (query only)
  query_idle (query only)
  query_input_pending (query only)
  query_ip_name (query only)
  query_ip_number (query only)
  query_mccp_stats (query only)
  query_snoop (query only)

driver:
  set_driver_hook (reuse H_*, I guess. set, possibly query)
  set_limits / query_limits (reuse LIMIT_*, I guess. set, query)
  set_extra_wizinfo_size (set, query)
  mixed debug_info(int what[, mixed arg1[, mixed arg2]]) (query only)
  query_load_average (query only)
  query_mud_port (query only)
  query_udp_port (query only)

unsure:
  set_light, set_is_wizard if we want to support compat mode
  snoop
  query_command
  query_notify_fail
  query_verb
  set_extra_wizinfo
TagsNo tags attached.

Relationships

duplicate of 0000235 resolvedGnomi LDMud 3.6 Extend debug_info() to handle interactives 
related to 0000258 resolvedGnomi LDMud 3.5 Shadow efuns: next_shadow/query_shadow() instead of shadow(ob,0) 
related to 0000601 resolvedzesstra LDMud 3.3 Add possibility to change limits for memory allocation (MAX_MALLOCED, SOFT_MALLOC_LIMIT) at runtime 
related to 0000813 resolvedGnomi LDMud query_ip_number(&ob) returns &ob 

Activities

_xtian_

2009-01-16 04:43

reporter   ~0000896

Even if this is targeted for 3.5, please don't remove the old functions. Mark them as deprecated but leave them. Changing that much mudlib code (and surely all MUDs will be affected) just to make the interface more elegant is ... well I could invest that time into more productive things.
You should also consider making the switch to 3.5 as easy as possible for your users.
Overall, we arent that many implementers any more.

_xtian_

2009-01-16 04:51

reporter   ~0000897

Also, you are changing object_info() semantically. This means the conversion to the suggested new interface would become non-trivial. Those who remember the switching over from filter_array() to filter() a few years back know how much work that is over our huge mudlibs. And this change was simpler.

(It's not intellectually complicated - it just means many hours of grepping/editing and testing).

Gnomi

2009-01-16 04:52

manager   ~0000898

Would it be okay, if the old efuns were removed and we published reference implementations as simul_efuns to replace them?

zesstra

2009-01-16 05:07

administrator   ~0000899

Just to add, why I like having <int> as return type:
Using runtime errors to signal all kinds of errors limits the possibility for handling errors in the mudlib very drastically.
e.g. if setting the buffer length fails, because the host system doesn't support that buffer size at the moment it is IMHO bad to throw a runtime error. In that case signaling the error by return code enables to mudlib to fall back to a different size.
Of course it depends on the type of error. Using wrong types of arguments should certainly cause a runtime error. ;-)

Gnomi

2009-01-16 05:07

manager   ~0000900

What do you mean with object_info? In the proposal it has the same signature as it has now to keep the old interface working.

Sorcerer

2009-01-16 07:06

updater   ~0000902

First of all: I like the idea and I also support Zesstras move for returning error codes. As stated by himself above this will allow a more subtle handling of errors.
For most of the efuns I agree that providing them as simul_efuns should be sufficient. But at least those that are heavily used by wizards not directly involved in the base-lib of a MUD (e.g. query_idle(), query_editing(), query_once_interactive(), perhaps enable_/disable_commands()) should be provided as (deprecated) "real" efuns in 3.5.
So if a MUD wants to migrate they can do it in two steps: first, die base-lib maintainers update the base-lib (and get rid of the then dispensable simul_efuns), but the mayority of the code (domains, guilds etc.) will keep running using those "real" efuns and can be changed over time - as _xtian_ pointed out the number of implementers is not that high any more...

_xtian_

2009-01-16 09:51

reporter   ~0000903

Simply put: Anything where I can upgrade and don't need to change the mudlib is the better choice for me (representatively speaking).
I can understand the motivation completely - the urge to provide cleaner interfaces. But the timecost-benefit ratio doesn't have any merit here on the ldmud-user side.
If a 3.3-compatability-mode is good for you it is good for me.

Gnomi: I must have mis-read the signature of object_info() this morning. Please ignore that last comment.

Gnomi

2009-01-16 10:43

manager   ~0000904

I think returning error codes does only make sense for errors that you can't prevent and do happen quite regularly.

Errors you can prevent are programming errors (e.g. giving a false type as a parameter, using unknown <what>s) and they should be thrown (how can you do error handling correctly if you can't call the function properly?). For errors that aren't expected to come up regularly you often are tempted to ignore these codes and that's worse then throwing an error. (Error handling has its cost, instead of one code line you have a lot more of them.)

file_size is a nice example for reasonable error codes. But e.g. out of memory exceptions should always be thrown because they're so rare that handling them explicitly is to expensive.

Bardioc

2009-01-17 09:58

reporter   ~0000917

I must say I like this very much as it really cleans the interface and as this only reflects certain driver functions or more internal lib dependend functions, it should not be too diffcult to change.

So 2 cents from me for this ;-)

Issue History

Date Modified Username Field Change
2009-01-15 16:47 fufu New Issue
2009-01-15 16:48 fufu Project LDMud => LDMud 3.5
2009-01-16 04:43 _xtian_ Note Added: 0000896
2009-01-16 04:51 _xtian_ Note Added: 0000897
2009-01-16 04:52 Gnomi Note Added: 0000898
2009-01-16 05:07 zesstra Note Added: 0000899
2009-01-16 05:07 Gnomi Note Added: 0000900
2009-01-16 07:06 Sorcerer Note Added: 0000902
2009-01-16 09:51 _xtian_ Note Added: 0000903
2009-01-16 10:43 Gnomi Note Added: 0000904
2009-01-17 09:58 Bardioc Note Added: 0000917
2009-01-17 12:07 zesstra Relationship added related to 0000601
2009-09-27 15:02 zesstra Relationship added duplicate of 0000235
2012-11-26 22:30 Gnomi Relationship added related to 0000813
2012-12-06 19:22 zesstra Relationship added related to 0000258
2015-05-01 21:03 Gnomi Assigned To => Gnomi
2015-05-01 21:03 Gnomi Status new => assigned
2016-01-26 19:00 Gnomi Status assigned => resolved
2016-01-26 19:00 Gnomi Fixed in Version => 3.5.0
2016-01-26 19:00 Gnomi Resolution open => fixed
2016-01-26 19:43 Source_changeset_attached => ldmud.git master aaaca9a3
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 95afc0c4
2016-01-26 19:43 Source_changeset_attached => ldmud.git master d8354869
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 7f18daac
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 5d33623a
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 4e3ad545
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 18e7830e
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 964f0165
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 00c4239b
2016-01-26 19:43 Source_changeset_attached => ldmud.git master ea20b165
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 715f640b
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 786c63d8
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 0f2dcc96
2016-01-26 19:43 Source_changeset_attached => ldmud.git master badd8ff9
2016-01-26 19:43 Source_changeset_attached => ldmud.git master bf2de6b2
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 016d6765
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 666bb8dc
2016-01-26 19:43 Source_changeset_attached => ldmud.git master bb9e7a76
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 6063936d
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 5a8d289a
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 40ca915a
2016-01-26 19:43 Source_changeset_attached => ldmud.git master be405533
2016-01-26 19:43 Source_changeset_attached => ldmud.git master b6ca26e4
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 8548489a
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 48b02ba9
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 2477bb1e
2016-01-26 19:43 Source_changeset_attached => ldmud.git master f426c71b
2016-01-26 19:43 Source_changeset_attached => ldmud.git master 6f500ab0
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 6f500ab0
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master f426c71b
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 2477bb1e
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 48b02ba9
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 8548489a
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master b6ca26e4
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master be405533
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 40ca915a
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 5a8d289a
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 6063936d
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master bb9e7a76
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 666bb8dc
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 016d6765
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master bf2de6b2
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master badd8ff9
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 0f2dcc96
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 786c63d8
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 715f640b
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master ea20b165
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 00c4239b
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 964f0165
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 18e7830e
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 4e3ad545
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 5d33623a
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 7f18daac
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master d8354869
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master 95afc0c4
2018-01-29 18:59 Gnomi Source_changeset_attached => ldmud.git master aaaca9a3
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 6f500ab0
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master f426c71b
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 2477bb1e
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 48b02ba9
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 8548489a
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master b6ca26e4
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master be405533
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 40ca915a
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 5a8d289a
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 6063936d
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master bb9e7a76
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 666bb8dc
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 016d6765
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master bf2de6b2
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master badd8ff9
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 0f2dcc96
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 786c63d8
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 715f640b
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master ea20b165
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 00c4239b
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 964f0165
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 18e7830e
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 4e3ad545
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 5d33623a
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 7f18daac
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master d8354869
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master 95afc0c4
2018-01-29 21:57 Gnomi Source_changeset_attached => ldmud.git master aaaca9a3
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 6f500ab0
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master f426c71b
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 2477bb1e
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 48b02ba9
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 8548489a
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master b6ca26e4
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master be405533
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 40ca915a
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 5a8d289a
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 6063936d
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master bb9e7a76
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 666bb8dc
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 016d6765
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master bf2de6b2
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master badd8ff9
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 0f2dcc96
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 786c63d8
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 715f640b
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master ea20b165
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 00c4239b
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 964f0165
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 18e7830e
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 4e3ad545
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 5d33623a
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 7f18daac
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master d8354869
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master 95afc0c4
2018-01-30 03:59 Gnomi Source_changeset_attached => ldmud.git master aaaca9a3