#include <util.h>#include <thing/properties.h>#include <player.h>#include <player/comm.h>#include <daemon.h>#include <wizlevels.h>#include <defines.h>#include <sys_debug.h>
gehe zum Quellcode dieser Datei
Makrodefinitionen | |
| #define | NEED_PROTOTYPES |
| #define | P_SWAP_CHANNELS "swap_channels" |
| #define | P_CHANNEL_SHORT "short_channels" |
| #define | CHANNELCMDS "[#@%$&()<>a-zA-Z0-9\\-]" |
| #define | DEFAULT_CHANNELS ({"Abenteuer", "Anfaenger","Grats","Tod"}) |
| #define | DEFAULT_SHORTCUTS |
| #define | WIZARD_SHORTCUTS |
| #define | DEBUG(x) |
Funktionen | |
| void | create () |
| static string * | _query_localcmds () |
| mixed | RegisterChannels () |
| mixed | RemoveChannels () |
| varargs private string | getName (mixed x, int fall) |
| string | ChannelMessage (mixed *msg, int nonint) |
| private void | createList (string n, mixed a, mixed m, mixed l) |
| private mixed | getChannel (string ch) |
| int | ChannelParser (string args) |
| int | ChannelAdmin (string args) |
Variablen | |
| static private mapping | shortcut |
| static private int | c_status |
| #define CHANNELCMDS "[#@%$&()<>a-zA-Z0-9\\-]" |
Definiert in Zeile 28 der Datei channel.c.
Wird benutzt von ChannelAdmin() und ChannelParser().
| #define DEBUG | ( | x | ) |
if (funcall(symbol_function('find_player),"zesstra"))\ tell_object(funcall(symbol_function('find_player),"zesstra"),\ "MDBG: "+x+"\n")
| #define DEFAULT_CHANNELS ({"Abenteuer", "Anfaenger","Grats","Tod"}) |
| #define DEFAULT_SHORTCUTS |
([ \ "b":"Abenteuer", \ "a":"Allgemein", \ "B":"Beileid", \ "q":"D-chat", \ "G":"Grats", \ "M":"Moerder", \ "h":"Seher", \ "T":"Tod", \ ])
Definiert in Zeile 31 der Datei channel.c.
Wird benutzt von ChannelAdmin() und create().
| #define P_CHANNEL_SHORT "short_channels" |
Definiert in Zeile 26 der Datei channel.c.
Wird benutzt von ChannelAdmin(), create() und RegisterChannels().
| #define P_SWAP_CHANNELS "swap_channels" |
Definiert in Zeile 25 der Datei channel.c.
Wird benutzt von ChannelAdmin(), create() und rein().
| #define WIZARD_SHORTCUTS |
([ \ "P":"D-code", \ "D":"Debug", \ "O":"Intercode", \ "I":"Intermud", \ "m":"Magier", \ ])
Definiert in Zeile 43 der Datei channel.c.
Wird benutzt von ChannelAdmin() und create().
| static string* _query_localcmds | ( | ) | [static] |
| int ChannelAdmin | ( | string | args | ) |
Definiert in Zeile 401 der Datei channel.c.
Benutzt _unparsed_args(), break_string(), c, CHANNELCMDS, CHMASTER, DEFAULT_SHORTCUTS, E_ACCESS_DENIED, IS_ARCH, IS_LEARNER, m_delete(), More(), notify_fail(), old_explode(), P_CHANNEL_SHORT, P_CHANNELS, P_LEVEL, P_STD_CHANNEL, P_SWAP_CHANNELS, QueryProp(), RegisterChannels(), RemoveChannels(), SetProp(), shortcut, WIZARD_SHORTCUTS und x.
00402 { 00403 string n, descr, sh, cn; 00404 mixed pa, tmp; 00405 args = _unparsed_args(); 00406 notify_fail("Benutzung: ebene <Abkuerzung>=<Ebene>\n" 00407 " ebene <Abkuerzung>=\n" 00408 " ebene abkuerzungen [standard]\n" 00409 " ebene standard <Ebene>\n" 00410 " ebene an|ein|aus\n" 00411 +(QueryProp(P_LEVEL) >= 5 ? 00412 " ebene neu <Name> <Bezeichnung>\n" 00413 " ebene beschreibung <Name> <Beschreibung>\n" : "") 00414 +(IS_ARCH(this_object()) ? 00415 " ebene kill <Name>\n" 00416 " ebene clear <Name>\n": "")); 00417 if(!args || !strlen(args)) return 0; 00418 if(sscanf(args, "kill %s", n) && IS_ARCH(this_object())) 00419 { 00420 if(!(cn = CHMASTER->find(n, this_object()))) cn = n; 00421 switch(CHMASTER->remove(cn, this_object())) 00422 { 00423 case E_ACCESS_DENIED: 00424 notify_fail("Die Ebene '"+cn+"' lies sich nicht entfernen!\n"); 00425 return 0; 00426 } 00427 write("Du entfernst die Ebene '"+cn+"'.\n"); 00428 return 1; 00429 } 00430 if(sscanf(args, "clear %s", n) && IS_ARCH(this_object())) 00431 { 00432 if(!(cn = CHMASTER->find(n, this_object()))) cn = n; 00433 switch(CHMASTER->clear_history(cn, this_object())) 00434 { 00435 case E_ACCESS_DENIED: 00436 notify_fail("Der Verlauf zur Ebene '"+cn+"' lies sich nicht entfernen!\n"); 00437 return 0; 00438 } 00439 write("Du entfernst den Verlauf zur Ebene '"+cn+"'.\n"); 00440 return 1; 00441 } 00442 if(sscanf(args, "neu %s %s", n, descr) == 2) 00443 { 00444 mixed x; 00445 if(QueryProp(P_LEVEL) < 5) 00446 return (notify_fail("Neue Ebenen zu erstellen ist dir verwehrt.\n"), 0); 00447 if(!sizeof(regexp(({ n }), "^" CHANNELCMDS CHANNELCMDS "*"))) 00448 return (notify_fail("Der Name '"+n+"' ist nicht konform!\n"), 0); 00449 switch(x = CHMASTER->new(n, this_object(), descr)) 00450 { 00451 case E_ACCESS_DENIED: 00452 notify_fail("Diese Ebene darfst du nicht erschaffen!\n"); break; 00453 default: 00454 write("Du erschaffst die Ebene '"+n+"'.\n"); 00455 SetProp(P_CHANNELS, QueryProp(P_CHANNELS) + ({ lower_case(n) })); 00456 return 1; 00457 } 00458 } 00459 if(sscanf(args, "beschreibung %s %s", n, descr) == 2) 00460 { 00461 mixed ch; 00462 cn = CHMASTER->find(n, this_object()); 00463 if(!cn || pointerp(cn)) 00464 return (notify_fail("Die Ebene '"+n+"' existiert nicht oder die Angabe " 00465 "war nicht eindeutig.\n"), 0); 00466 ch = CHMASTER->list(this_object()); 00467 if(ch[lower_case(cn)][I_MASTER] != this_object()) 00468 return (notify_fail("Du bist nicht berechtigt die Beschreibung der Ebene" 00469 " '"+cn+"' zu aendern.\n"), 0); 00470 ch[lower_case(cn)][I_INFO] = descr; 00471 write("Die Ebene '"+cn+"' hat ab sofort die Beschreibung:\n"+descr+"\n"); 00472 return 1; 00473 } 00474 if(sscanf(args, "%s=%s", sh, n) == 2 && strlen(n)) 00475 { 00476 mapping sc; 00477 if(pointerp(tmp = CHMASTER->find(n, this_object())) || !tmp) 00478 return (notify_fail("Benutzung: ebene <Abkuerzung>=<Ebene>\n" 00479 +(pointerp(tmp) ? implode(tmp, ", ") + "\n" : 00480 "Ebene '"+n+"' nicht gefunden!\n")), 0); 00481 sc = QueryProp(P_CHANNEL_SHORT); 00482 if(!sc) sc = ([]); 00483 sc[sh] = tmp; 00484 SetProp(P_CHANNEL_SHORT, sc); 00485 shortcut = QueryProp(P_CHANNEL_SHORT); 00486 write("'"+sh+"' wird jetzt als Abkuerzung fuer '"+tmp+"' anerkannt.\n"); 00487 return 1; 00488 } 00489 if(sscanf(args, "%s=", sh)) 00490 { 00491 SetProp(P_CHANNEL_SHORT, m_delete(QueryProp(P_CHANNEL_SHORT) || ([]), sh)); 00492 shortcut = QueryProp(P_CHANNEL_SHORT); 00493 write("Du loeschst die Abkuerzung '"+sh+"'.\n"); 00494 return 1; 00495 } 00496 if(args == "an" || args == "ein") 00497 { 00498 mixed excl; 00499 if(pointerp(QueryProp(P_SWAP_CHANNELS))) 00500 SetProp(P_CHANNELS, QueryProp(P_SWAP_CHANNELS)); 00501 else 00502 SetProp(P_CHANNELS, m_indices(CHMASTER->list(this_object()))); 00503 excl = RegisterChannels(); 00504 write("Du schaltest folgende Ebenen ein:\n" 00505 +break_string(implode(QueryProp(P_CHANNELS) - excl, ", "), 78)); 00506 SetProp(P_SWAP_CHANNELS, 0); 00507 return 1; 00508 } 00509 if(args == "aus") 00510 { 00511 SetProp(P_SWAP_CHANNELS, QueryProp(P_CHANNELS)); 00512 RemoveChannels(); 00513 SetProp(P_CHANNELS, ({})); 00514 write("Du stellst die Ebenen ab.\n"); 00515 return 1; 00516 } 00517 pa = old_explode(args, " "); 00518 if(!strstr("abkuerzungen", pa[0])) 00519 { 00520 string txt; txt = ""; 00521 if(sizeof(pa) > 1 && !strstr("standard", pa[1])) 00522 { 00523 write("Die Standard Abkuerzungen werden gesetzt.\n"); 00524 SetProp(P_CHANNEL_SHORT, DEFAULT_SHORTCUTS 00525 + (IS_LEARNER(this_object()) ? WIZARD_SHORTCUTS : ([]))); 00526 } 00527 walk_mapping(QueryProp(P_CHANNEL_SHORT), 00528 lambda(({'i/*'*/, 'c, 'r}), 00529 ({#'+=, 'r/*'*/, 00530 ({#'sprintf/*'*/, "%5.5s = %s\n", 'i, 'c})})), 00531 &txt); 00532 txt = sprintf("Folgende Abkuerzungen sind definiert:\n%-78#s\n", 00533 implode(sort_array(old_explode(txt, "\n"), #'>/*'*/), "\n")); 00534 More(txt); 00535 return 1; 00536 } 00537 if(!strstr("standard", pa[0])) 00538 if(sizeof(pa) < 2) 00539 return (notify_fail("Benutzung: ebene standard <Ebene>\n" 00540 +(QueryProp(P_STD_CHANNEL) 00541 ? "Momentan ist '"+QueryProp(P_STD_CHANNEL) 00542 +"' eingestellt.\n" 00543 : "Es ist keine Standardebene eingestellt.\n")),0); 00544 else 00545 if(pointerp(tmp = CHMASTER->find(pa[1], this_object()))) 00546 return (notify_fail("Das war keine eindeutige Angabe! " 00547 "Folgende Ebenen passen:\n" 00548 +break_string(implode(tmp, ", "), 78)), 0); 00549 else 00550 if(!tmp) return (notify_fail("Ebene '"+pa[1]+"' nicht gefunden!\n"),0); 00551 else 00552 { 00553 write("'"+tmp+"' ist jetzt die Standardebene.\n"); 00554 SetProp(P_STD_CHANNEL, tmp); 00555 return 1; 00556 } 00557 return(0); 00558 }

| string ChannelMessage | ( | mixed * | msg, | |
| int | nonint | |||
| ) |
Definiert in Zeile 154 der Datei channel.c.
00155 { 00156 string channel_message; 00157 string channel=msg[0]; 00158 object sender=msg[1]; 00159 string message=msg[2]; 00160 int msg_type = msg[3]; 00161 00162 if ( previous_object() != find_object(CHMASTER) && 00163 previous_object() != ME ) 00164 return 0; 00165 string sender_name = getName(sender, msg_type == MSG_GEMOTE ? WESSEN : WER); 00166 int prepend_indent_flag=QueryProp(P_MESSAGE_PREPEND) ? BS_PREPEND_INDENT : 0; 00167 switch(msg_type) { 00168 case MSG_EMPTY: 00169 channel_message= message+"\n"; 00170 break; 00171 case MSG_GEMOTE: 00172 case MSG_EMOTE: 00173 channel_message = break_string(sender_name + " "+ message+"]", 00174 78, sprintf("[%s:", channel), 00175 BS_INDENT_ONCE|prepend_indent_flag); 00176 break; 00177 case MSG_SAY: 00178 default: 00179 string presay=sprintf("[%s:%s] ", channel, sender_name); 00180 channel_message = break_string(message, max(78,strlen(presay)+10), 00181 presay, prepend_indent_flag); 00182 break; 00183 } 00184 if(nonint) 00185 return channel_message; 00186 Message(channel_message, MSGFLAG_CHANNEL, 0, channel, sender); 00187 return 0; 00188 }
| int ChannelParser | ( | string | args | ) |
Definiert in Zeile 222 der Datei channel.c.
Benutzt _unparsed_args(), break_string(), c, CHANNELCMDS, CHMASTER, E_ACCESS_DENIED, E_ALREADY_JOINED, E_NOT_MEMBER, err, getChannel(), getName(), hist, I_MEMBER, list, More(), MSG_EMOTE, MSG_GEMOTE, MSG_SAY, notify_fail(), P_CHANNELS, P_STD_CHANNEL, QueryProp(), SetProp() und WER.
00223 { 00224 mixed ch, cmd, tmp; 00225 int pos, type, err; 00226 string txt; 00227 cmd = query_verb(); 00228 args = _unparsed_args(); 00229 notify_fail("Benutzung: -<Ebene>[ ]['|:|;]<Text>\n" 00230 " -<Ebene>[+|-|?|!|*]\n" 00231 " -?\n"); 00232 if(!cmd && !args) return 0; 00233 if(!args) args = ""; 00234 cmd = cmd[1..]; 00235 if(sizeof(cmd = regexplode(cmd, 00236 "^" CHANNELCMDS "*" 00237 "([+-]|\\!|\\?|\\*)*")) > 1) 00238 { 00239 //z.B. cmd= ({"","allgemein",":testet"}) 00240 if(strlen(cmd[1]) > 1 && 00241 strstr("+-?!*", cmd[1][<1..<1]) > -1) 00242 tmp = cmd[1][0..<2]; 00243 else 00244 tmp = cmd[1]; 00245 if(cmd[1] != "?" && cmd[1] != "!") 00246 if(pointerp(ch = getChannel(tmp))) 00247 { 00248 notify_fail("Diese Angabe war nicht eindeutig! " 00249 "Folgende Ebenen passen:\n" 00250 +implode(ch, ", ")+"\n"); 00251 return 0; 00252 } 00253 else if(!ch) return (notify_fail("Die Ebene '"+tmp 00254 +"' gibt es nicht!\n"), 0); 00255 //DEBUG(sprintf("ChanCmd: %O\n",cmd)); 00256 if (strlen(cmd[1])) { 00257 switch(cmd[1][<1]) { 00258 case '+': 00259 switch(CHMASTER->join(ch, this_object())) 00260 { 00261 case E_ACCESS_DENIED: 00262 notify_fail("Du darfst an die Ebene '"+ch+"' nicht heran.\n"); 00263 return 0; 00264 case E_ALREADY_JOINED: 00265 notify_fail("Du hast diese Ebene schon betreten!\n"); 00266 return 0; 00267 default: break; 00268 } 00269 write("Du betrittst die Ebene '"+ch+"'.\n"); 00270 if(member(QueryProp(P_CHANNELS), ch = lower_case(ch)) == -1) 00271 SetProp(P_CHANNELS, QueryProp(P_CHANNELS) + ({ ch })); 00272 return 1; 00273 case '-': 00274 switch(CHMASTER->leave(ch, this_object())) 00275 { 00276 case E_ACCESS_DENIED: 00277 write("Du kannst die Ebene '"+ch+"' nicht verlassen.\n"); 00278 break; 00279 case E_NOT_MEMBER: 00280 write("Wie willst Du eine Ebene verlassen, welche Du nicht " 00281 "betreten hast?\n"); 00282 break; 00283 default: 00284 write("Du verlaesst die Ebene '"+ch+"'.\n"); 00285 SetProp(P_CHANNELS, QueryProp(P_CHANNELS) - ({ lower_case(ch), ch })); 00286 break; 00287 } 00288 return 1; 00289 case '!': 00290 case '?': 00291 { 00292 mapping l; 00293 if(mappingp(l = CHMASTER->list(this_object()))) 00294 if(stringp(ch) && strlen(ch) && pointerp(l[ch = lower_case(ch)])) 00295 { 00296 int c; object o; string n; string *m; 00297 m=sort_array(map(l[ch][I_MEMBER],#'getName/*'*/, WER),#'>/*'*/); 00298 m-=({"<MasteR>"}); 00299 write(l[ch][I_NAME]+", "+funcall(l[ch][I_INFO])+".\n"); 00300 write("Du siehst "+((c = sizeof(m)) > 0 00301 ? (c == 1 ? "ein Gesicht" : c+" Gesichter") 00302 : "niemanden")+" auf der Ebene '" 00303 +l[ch][I_NAME]+"':\n"); 00304 write(break_string(implode(m,", "), 78)); 00305 write((l[ch][I_MASTER] ? 00306 getName(l[ch][I_MASTER]) : getName(l[ch][I_ACCESS], WER)) 00307 +" hat das Sagen auf dieser Ebene.\n"); 00308 } 00309 else 00310 { 00311 mixed list; list = ({}); 00312 if(cmd[1][<1] == '!') 00313 l -= mkmapping(m_indices(l) - QueryProp(P_CHANNELS)); 00314 walk_mapping(l, #'createList/*'*/, QueryProp(P_CHANNELS), &list); 00315 list = sort_array(list, #'>/*'*/); 00316 txt = sprintf("%-12.12' 's [A] %|12' 's (%-3' 's) %-42.42s\n", 00317 "Name", "Eigner", "Sp", "Beschreibung") 00318 + "-------------------------------------------------------" 00319 + "-----------------------\n" 00320 + implode(list, ""); 00321 More(txt); 00322 } 00323 return 1; 00324 } 00325 case '*': 00326 { 00327 mixed hist; int amount; 00328 if(!pointerp(hist = CHMASTER->history(ch, this_object())) 00329 || !sizeof(hist)) 00330 { 00331 write("Es ist keine Geschichte fuer '"+ch+"' verfuegbar.\n"); 00332 return 1; 00333 } 00334 00335 //(Zesstra) cmd hat offenbar immer 3 Elemente... 00336 //bei -all* ({"","all*",""}) 00337 //bei -all*10 ({"","all*,"10"}) 00338 //also ist bei -all* amount immer == 0 und es funktioniert eher zufaellig. 00339 /*if(sizeof(cmd) > 2) 00340 amount = to_int(cmd[2]); 00341 else 00342 amount=sizeof(hist);*/ 00343 amount=to_int(cmd[2]); 00344 if (amount <= 0 || amount >= sizeof(hist)) 00345 amount=sizeof(hist); 00346 00347 txt = "Folgendes ist auf '"+ch+"' passiert:\n" 00348 + implode(map(hist[<amount..], #'ChannelMessage/*'*/, 1), ""); 00349 More(txt); 00350 return 1; 00351 } 00352 default: 00353 break; 00354 } 00355 } 00356 } 00357 if(strlen(cmd = implode(cmd[2..], ""))) 00358 args = cmd + (strlen(args) ? " " : "") + args; 00359 00360 if(!strlen(args)) return 0; 00361 00362 //Wenn cmd leer ist: MSG_SAY 00363 if (!strlen(cmd)) type=MSG_SAY; 00364 else { 00365 switch(cmd[0]) 00366 { 00367 case ':' : 00368 type = MSG_EMOTE; 00369 args = args[1..]; 00370 break; 00371 case ';' : 00372 type = MSG_GEMOTE; 00373 args = args[1..]; 00374 break; 00375 case '\'': 00376 args = args[1..]; 00377 default : type = MSG_SAY; break; 00378 } 00379 } 00380 if(!ch || !strlen(ch)) ch = QueryProp(P_STD_CHANNEL); 00381 if((err = CHMASTER->send(ch, this_object(), args, type)) < 0) 00382 if(!(err = CHMASTER->join(ch, this_object()))) 00383 { 00384 if(member(QueryProp(P_CHANNELS), ch = lower_case(ch)) == -1) 00385 SetProp(P_CHANNELS, QueryProp(P_CHANNELS) + ({ ch })); 00386 err = CHMASTER->send(ch, this_object(), args, type); 00387 } 00388 00389 switch(err) 00390 { 00391 case E_ACCESS_DENIED: 00392 notify_fail("Auf der Ebene '"+ch+"' darfst Du nichts sagen.\n"); 00393 return 0; 00394 case E_NOT_MEMBER: 00395 notify_fail("Du hast die Ebene '"+ch+"' nicht betreten!\n"); 00396 return 0; 00397 } 00398 return 1; 00399 }

| void create | ( | ) |
Definiert in Zeile 56 der Datei channel.c.
Benutzt DEFAULT_CHANNELS, DEFAULT_SHORTCUTS, F_MODE, IS_LEARNER, P_CHANNEL_SHORT, P_CHANNELS, P_STD_CHANNEL, P_SWAP_CHANNELS, SAVE, Set() und WIZARD_SHORTCUTS.
00057 { 00058 Set(P_CHANNELS, SAVE, F_MODE); 00059 Set(P_CHANNELS, DEFAULT_CHANNELS); 00060 Set(P_SWAP_CHANNELS, SAVE, F_MODE); 00061 Set(P_STD_CHANNEL, "Allgemein"); 00062 Set(P_STD_CHANNEL, SAVE, F_MODE); 00063 Set(P_CHANNEL_SHORT, SAVE, F_MODE); 00064 Set(P_CHANNEL_SHORT, DEFAULT_SHORTCUTS 00065 + (IS_LEARNER(this_object()) ? WIZARD_SHORTCUTS : ([]))); 00066 }

| private void createList | ( | string | n, | |
| mixed | a, | |||
| mixed | m, | |||
| mixed | l | |||
| ) |
Definiert in Zeile 190 der Datei channel.c.
00191 { 00192 int pos; string sh, *mem; 00193 if((pos = member(map(m_values(shortcut), #'lower_case/*'*/), n)) != -1) 00194 sh = m_indices(shortcut)[pos]; 00195 else sh = ""; 00196 mem=map(a[I_MEMBER],#'getName/*'*/, WER); 00197 mem-=({"<MasteR>"}); 00198 l += ({ sprintf("%-12.12'.'s %c[%-1.1s] %|12.12' 's (%-|3' 'd) %-42.42s\n", 00199 a[I_NAME], (member(m, n) != -1 ? '*' : ' '), sh, 00200 a[I_MASTER] ? 00201 getName(a[I_MASTER]) : getName(a[I_ACCESS]), 00202 sizeof(mem), 00203 (closurep(a[I_INFO]) && objectp(query_closure_object(a[I_INFO]))) ? 00204 funcall(a[I_INFO]) || "- Keine Beschreibung -" : 00205 (stringp(a[I_INFO]) ? a[I_INFO] : "- Keine Beschreibung -") 00206 ) }); 00207 }
| private mixed getChannel | ( | string | ch | ) |
Definiert in Zeile 209 der Datei channel.c.
Benutzt CHMASTER, P_STD_CHANNEL, QueryProp() und shortcut.
Wird benutzt von ChannelParser().
00210 { 00211 mixed ff; 00212 if(!strlen(ch)) ch = QueryProp(P_STD_CHANNEL); 00213 if(shortcut && shortcut[ch]) ch = shortcut[ch]; 00214 return CHMASTER->find(ch, this_object()); 00215 }


| varargs private string getName | ( | mixed | x, | |
| int | fall | |||
| ) |
Definiert in Zeile 112 der Datei channel.c.
Wird benutzt von ChannelParser().
00112 { 00113 00114 mixed o = closurep(x) ? query_closure_object(x) : x; 00115 if(stringp(o) && strlen(o) && (x = find_object(o))) 00116 o = x; 00117 00118 // Objekte 00119 if (objectp(o)) { 00120 if (object_name(o) == CHMASTER) return "<MasteR>"; 00121 // Magier sehen unsichtbare nicht nur als "Jemand" 00122 if (o->QueryProp(P_INVIS) && IS_LEARNING(this_object())) 00123 return "("+capitalize(getuid(o))+")"; 00124 // Froesche mit Namen versorgen. 00125 if (o->QueryProp(P_FROG)) 00126 return "Frosch "+capitalize(getuid(o)); 00127 // Default (Unsichtbare als "Jemand" (s. Name())) 00128 return o->Name(fall, 2)||"<Unbekannt>"; 00129 } 00130 // Strings 00131 else if (stringp(o) && strlen(o)) { 00132 if (o[0] == '/') { 00133 // unsichtbare Objekte... 00134 int p = strstr(o, "$"); 00135 if (p != -1) { 00136 // Magier im Magiermodus kriegen den Realnamen, andere nicht. 00137 if (IS_LEARNING(this_object())) 00138 return o[1..p-1]; 00139 else 00140 return o[p+1..]; 00141 } 00142 else 00143 // doch nicht unsichtbar 00144 return (fall == WESSEN ? o+"s" : o); 00145 } 00146 else 00147 // nicht unsichtbar 00148 return (fall == WESSEN ? o+"s" : o); 00149 } 00150 // Fall-through 00151 return "<Unbekannt>"; 00152 }

| mixed RegisterChannels | ( | ) |
Definiert in Zeile 76 der Datei channel.c.
Benutzt c_status, CHMASTER, err, P_CHANNEL_SHORT, P_CHANNELS, QueryProp(), SetProp() und shortcut.
Wird benutzt von ChannelAdmin().
00077 { 00078 mixed err; 00079 if(extern_call() && 00080 previous_object() != find_object(CHMASTER)) return; 00081 c_status = 0; 00082 shortcut = QueryProp(P_CHANNEL_SHORT); 00083 SetProp(P_CHANNELS, map(QueryProp(P_CHANNELS) || ({}), 00084 #'lower_case)); 00085 err = filter(QueryProp(P_CHANNELS), 00086 symbol_function("join", CHMASTER), 00087 this_object()); 00088 if(QueryProp(P_LEVEL) < 5) return err; 00089 while(sizeof(err)) { 00090 CHMASTER->new(err[0], this_object()); 00091 err[0..0] = ({}); 00092 } 00093 return err; 00094 }


| mixed RemoveChannels | ( | ) |
Definiert in Zeile 96 der Datei channel.c.
Wird benutzt von ChannelAdmin(), NetDead() und quit().
00097 { 00098 closure cl; 00099 mixed err=({}); 00100 if(extern_call() && 00101 previous_object() != find_object(CHMASTER)) return; 00102 if(!c_status) c_status = 1; 00103 else return ({}); 00104 cl=symbol_function("leave", CHMASTER); 00105 if (closurep(cl)) { 00106 err = filter(QueryProp(P_CHANNELS), cl, this_object()); 00107 SetProp(P_CHANNELS, QueryProp(P_CHANNELS) - err); 00108 } 00109 return err; 00110 }

private int c_status [static] |
Definiert in Zeile 54 der Datei channel.c.
Wird benutzt von RegisterChannels().
private mapping shortcut [static] |
Definiert in Zeile 53 der Datei channel.c.
Wird benutzt von ChannelAdmin(), getChannel() und RegisterChannels().
1.6.3