Changeset 1008
- Timestamp:
- 07/07/07 20:59:59 (1 year ago)
- Files:
-
- 1.8.3/branches/devel/CHANGES.183 (modified) (1 diff)
- 1.8.3/branches/devel/game/txt/hlp/pennchat.hlp (modified) (2 diffs)
- 1.8.3/branches/devel/hdrs/lock.h (modified) (1 diff)
- 1.8.3/branches/devel/src/extchat.c (modified) (7 diffs)
- 1.8.3/branches/devel/src/lock.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/CHANGES.183
r1007 r1008 46 46 * @search (and by relation search()) now has an 'elock' 47 47 search class, permitting boolean expression searches. [GM] 48 48 * @channel/recall extended to support recalling by time. Example: 49 '@chan/recall Foo=1h' will recall lines only from the past 50 hour. Patch by Talvo. 51 49 52 Functions: 50 53 * cond() works like an if, else if, else if ... ncond(), 1.8.3/branches/devel/game/txt/hlp/pennchat.hlp
r938 r1008 174 174 @channel/mute <channel> = <yes|no> 175 175 @channel/gag <channel> = <yes|no> 176 @channel/recall <channel> [ = <lines >[,<start line>] ]176 @channel/recall <channel> [ = <lines|duration>[,<start line>] ] 177 177 178 178 Some channels broadcast messages when players connect or disconnect from … … 191 191 @channel/recall shows you the most recent messages on the channel; 192 192 the number of messages depends on how the channel is configured, but 193 can be limited by specifying <lines> to show and a <start line> to start 194 display from. You must be on a channel to recall from it. 193 can be limited by specifying <lines> to show and a <start line> to 194 start display from. If <lines> is an elapsed time, like '1h', 195 messages from within the given interval will be recalled. You must 196 be on a channel to recall from it. 195 197 196 198 See "help @channel4" for more. 1.8.3/branches/devel/hdrs/lock.h
r1007 r1008 99 99 extern lock_type Page_Lock; 100 100 extern lock_type Tport_Lock; 101 extern lock_type Speech_Lock; /* Who can speak aloud in me */102 extern lock_type Listen_Lock; /* Who can trigger ^s/ahears on me */103 extern lock_type Command_Lock; /* Who can use $commands on me */104 extern lock_type Parent_Lock; /* Who can @parent to me */105 extern lock_type Link_Lock; /* Who can @link to me */106 extern lock_type Leave_Lock; /* Who can leave me */107 extern lock_type Drop_Lock; /* Who can drop me */108 extern lock_type Give_Lock; /* Who can give me */109 extern lock_type Mail_Lock; /* Who can @mail me */110 extern lock_type Follow_Lock; /* Who can follow me */111 extern lock_type Examine_Lock; /* Who can examine visual me */112 extern lock_type Chzone_Lock; /* Who can @chzone to this object? */113 extern lock_type Forward_Lock; /* Who can @forwardlist to object? */114 extern lock_type Control_Lock; /* Who can control this object? */115 extern lock_type Dropto_Lock; /* Who follows the dropto of this room? */116 extern lock_type Destroy_Lock; /* Who can @dest me if I'm dest_ok? */101 extern lock_type Speech_Lock; /* Who can speak aloud in me */ 102 extern lock_type Listen_Lock; /* Who can trigger ^s/ahears on me */ 103 extern lock_type Command_Lock; /* Who can use $commands on me */ 104 extern lock_type Parent_Lock; /* Who can @parent to me */ 105 extern lock_type Link_Lock; /* Who can @link to me */ 106 extern lock_type Leave_Lock; /* Who can leave me */ 107 extern lock_type Drop_Lock; /* Who can drop me */ 108 extern lock_type Give_Lock; /* Who can give me */ 109 extern lock_type Mail_Lock; /* Who can @mail me */ 110 extern lock_type Follow_Lock; /* Who can follow me */ 111 extern lock_type Examine_Lock; /* Who can examine visual me */ 112 extern lock_type Chzone_Lock; /* Who can @chzone to this object? */ 113 extern lock_type Forward_Lock; /* Who can @forwardlist to object? */ 114 extern lock_type Control_Lock; /* Who can control this object? */ 115 extern lock_type Dropto_Lock; /* Who follows the dropto of this room? */ 116 extern lock_type Destroy_Lock; /* Who can @dest me if I'm dest_ok? */ 117 117 extern lock_type Interact_Lock; 118 extern lock_type MailForward_Lock; /* Who can forward mail to me */119 extern lock_type Take_Lock; /* Who can take from the contents of this object? */118 extern lock_type MailForward_Lock; /* Who can forward mail to me */ 119 extern lock_type Take_Lock; /* Who can take from the contents of this object? */ 120 120 121 121 #endif /* __LOCK_H */ 1.8.3/branches/devel/src/extchat.c
r963 r1008 3071 3071 CHAN *chan; 3072 3072 CHANUSER *u; 3073 int start = -1, num_lines = 10; 3073 int start = -1, num_lines; 3074 bool recall_timestring = false; 3075 time_t recall_from = 0; 3074 3076 char *p = NULL, *buf, *name; 3075 3077 time_t timestamp; … … 3088 3090 3089 3091 if (!args[1] || !*args[1]) { 3090 /* nothing*/3092 num_lines = 10; /* default */ 3091 3093 } else if (is_integer(args[1])) { 3092 3094 num_lines = parse_integer(args[1]); 3093 3095 if (num_lines == 0) 3094 3096 num_lines = INT_MAX; 3097 } else if (etime_to_secs(args[1], &num_lines)) { 3098 recall_timestring = 1; 3099 recall_from = (time_t) mudtime - num_lines; 3095 3100 } else { 3096 3101 safe_str(T(e_int), buff, bp); … … 3137 3142 } 3138 3143 3144 if (recall_timestring) { 3145 num_lines = 0; 3146 while ((buf = 3147 iter_bufferq(ChanBufferQ(chan), &p, &speaker, &type, ×tamp))) { 3148 if (timestamp >= recall_from) 3149 num_lines++; 3150 } 3151 p = NULL; 3152 } 3139 3153 if (start < 0) 3140 3154 start = BufferQNum(ChanBufferQ(chan)) - num_lines; … … 3387 3401 CHAN *chan; 3388 3402 CHANUSER *u; 3389 c onst char *lines;3403 char *lines; 3390 3404 const char *startpos; 3391 int num_lines = 10; /* Default if none is given */3405 int num_lines; 3392 3406 int start = -1; 3407 time_t recall_from = 0; 3408 bool recall_timestring = false; 3393 3409 int all; 3394 3410 char *p = NULL, *buf; … … 3415 3431 if (num_lines == 0) 3416 3432 num_lines = INT_MAX; 3433 } else if (etime_to_secs(lines, &num_lines)) { 3434 recall_timestring = 1; 3435 recall_from = (time_t) mudtime - num_lines; 3417 3436 } else { 3418 3437 notify(player, T("How many lines did you want to recall?")); 3419 3438 return; 3420 3439 } 3421 } 3440 } else { 3441 num_lines = 10; /* default value */ 3442 } 3443 3422 3444 if (num_lines < 1) { 3423 3445 notify(player, T("How many lines did you want to recall?")); … … 3444 3466 return; 3445 3467 } 3468 if (recall_timestring) { 3469 num_lines = 0; 3470 while ((buf = 3471 iter_bufferq(ChanBufferQ(chan), &p, &speaker, &type, ×tamp))) { 3472 if (timestamp >= recall_from) 3473 num_lines++; 3474 } 3475 p = NULL; 3476 } 3446 3477 if (start < 0) 3447 3478 start = BufferQNum(ChanBufferQ(chan)) - num_lines; … … 3451 3482 return; 3452 3483 } 3453 3454 3484 all = (start <= 0 && num_lines >= BufferQNum(ChanBufferQ(chan))); 3455 3485 notify_format(player, T("CHAT: Recall from channel <%s>"), ChanName(chan)); 1.8.3/branches/devel/src/lock.c
r1007 r1008 300 300 newlock->key = TRUE_BOOLEXP; 301 301 newlock->next = NULL; 302 hashadd((char *)newlock->type, newlock, &htab_locks);302 hashadd((char *) newlock->type, newlock, &htab_locks); 303 303 } 304 304
