PennMUSH Community

Changeset 1245

Show
Ignore:
Timestamp:
09/08/08 17:01:58 (3 months ago)
Author:
walker
Message:

Added cbufferadd(), which adds text to a buffer.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/devel/game/txt/hlp/pennchat.hlp

    r1225 r1245  
    348348  or buffer size of <channel>, respectively. This information is 
    349349  also displayed in @chan/list. 
     350& CBUFFERADD() 
     351  cbufferadd(<channel>, <text>[, <spoof>]) 
     352 
     353  Adds text to a chan buffer without broadcasting it to all people on the 
     354  channel. In order to perform this, you must be able to peform an @nscemit. 
    350355& CWHO() 
    351356  cwho(<channel>) 
     
    419424  include their timestamps; otherwise, they will not. 
    420425 
    421 See also: @channel3 
     426See also: @channel3, cbufferadd() 
    422427& Channel functions 
    423428  Channel functions work with the channel system. 
    424429 
    425   cbuffer()     cdesc()       cemit()       cflags()      channels() 
    426   clflags()     clock()       cmsgs()       cowner()      crecall() 
    427   cstatus()     ctitle()      cusers()      cwho() 
     430  cbuffer()     cbufferadd()  cdesc()       cemit()       cflags() 
     431  channels()    clflags()     clock()       cmsgs()       cowner() 
     432  crecall()     cstatus()     ctitle()      cusers()      cwho() 
  • 1.8.3/branches/devel/src/extchat.c

    r1231 r1245  
    22672267} 
    22682268 
     2269/* ARGSUSED */ 
     2270FUNCTION(fun_cbufferadd) { 
     2271  CHAN *c; 
     2272  dbref victim; 
     2273 
     2274  // Person must be able to do nospoof cemits. 
     2275  if (!command_check_byname(executor, "@nscemit") || 
     2276      fun->flags & FN_NOSIDEFX) { 
     2277    safe_str(T(e_perm), buff, bp); 
     2278    return; 
     2279  } 
     2280 
     2281  // Find the channel. 
     2282  if (!args[0] || !*args[0]) { 
     2283    safe_str(T("#-1 NO CHANNEL GIVEN"), buff, bp); 
     2284    return; 
     2285  } 
     2286 
     2287  // Make sure we have text. 
     2288  if (!args[1] || !*args[1]) { 
     2289    safe_str(T("#-1 NO TEXT GIVEN"), buff, bp); 
     2290    return; 
     2291  } 
     2292 
     2293  victim = executor; 
     2294  // Do we spoof somebody else? 
     2295  if (nargs == 3) { 
     2296    if ((victim = noisy_match_result(executor, args[2], NOTYPE, MAT_EVERYTHING)) 
     2297        < 0) { 
     2298      safe_str(T(e_notvis), buff, bp); 
     2299      return; 
     2300    } 
     2301  } 
     2302 
     2303  // Get the message. 
     2304  switch (find_channel(args[0], &c, executor)) { 
     2305  case CMATCH_NONE: 
     2306    safe_str(T("#-1 NO SUCH CHANNEL"), buff, bp); 
     2307    return; 
     2308  case CMATCH_AMBIG: 
     2309    safe_str(T("#-1 AMBIGUOUS CHANNEL NAME"), buff, bp); 
     2310    return; 
     2311  default: 
     2312    if (ChanBufferQ(c) != NULL) { 
     2313      add_to_bufferq(ChanBufferQ(c), 0, victim, args[1]); 
     2314    } else { 
     2315      safe_str(T("#-1 CHANNEL DOES NOT HAVE A BUFFER"), buff, bp); 
     2316    } 
     2317  } 
     2318} 
     2319 
    22692320 
    22702321/* ARGSUSED */ 
  • 1.8.3/branches/devel/src/function.c

    r1226 r1245  
    350350  {"CAT", fun_cat, 1, INT_MAX, FN_REG}, 
    351351  {"CBUFFER", fun_cinfo, 1, 1, FN_REG}, 
     352  {"CBUFFERADD", fun_cbufferadd, 2, 3, FN_REG}, 
    352353  {"CDESC", fun_cinfo, 1, 1, FN_REG}, 
    353354  {"CEMIT", fun_cemit, 2, 3, FN_REG},