~sapidlib-dev/sapidlib/lockdown_d

« back to all changes in this revision

Viewing changes to lib/std/area/rooms/conference_room.c

  • Committer: Cody A.W. Somerville
  • Date: 2007-07-24 07:32:49 UTC
  • Revision ID: cody-somerville@veracity-20070724073249-wbn5w201qgare74b
Improved logging facilities

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
3
3
 * Tacitus @ LPUniMudlib
4
4
 * 24-July-07
5
 
 * Provided conference/meeting functionality
 
5
 * Provides conference/meeting functionality
6
6
 *
7
7
 */
8
8
 
63
63
                write("Notice: You release control of the floor as chairman.\n");
64
64
                tell_room(this_object(), this_player()->query_cap_name() + " has stepped down as chairman of the floor.\n", 
65
65
                                ({ this_player() }));
 
66
                appendLog(" --> " + this_player()->query_cap_name() + " has stepped down as chairman of the floor.");
66
67
                chairman = 0;
67
68
                return 1;
68
69
        }
73
74
        write("Notice: You are now the chairman of this conference room.\n");
74
75
        tell_room(this_object(), this_player()->query_cap_name() + " is now the chairman of this conference room.\n",
75
76
                        ({ this_player() }));
 
77
        appendLog(" --> " + this_player()->query_cap_name() + " is now the chairman of this conference room.");
76
78
        chairman = this_player();
77
79
        return 1;
78
80
}
94
96
        {
95
97
                case "open" :
96
98
                {
 
99
                        if(floor_mode == FLOOR_OPEN) return notify_fail("Error: The floor is already open.\n");
 
100
 
97
101
                        floor_mode = FLOOR_OPEN;
98
102
                        tell_room(this_object(), "Notice: The floor is now open.\n");
99
103
                        floor_promoted = ([]);
 
104
                        appendLog(" ---> Floor opened.");
100
105
                        return 1;
101
106
                }
102
107
 
103
108
                case "close" :
104
109
                {
 
110
                        if(floor_mode == FLOOR_RESTRICTED) return notify_fail("Error: The floor is already closed.\n");
 
111
 
105
112
                        floor_mode = FLOOR_RESTRICTED;
106
113
                        tell_room(this_object(), "Notice: The floor is no longer open.\n");
 
114
                        appendLog(" ---> Floor closed.");
107
115
                        return 1;
108
116
                }
109
117
 
152
160
                logging = LOGGING_ENABLED;
153
161
                logfile = logpath;
154
162
                tell_room(this_object(), "Notice: Logging is enabled and available at: " + logpath + "\n");
 
163
                appendLog("\n\t  *** CONFERENCE LOGGING STARTED ***");
155
164
                return 1;
156
165
        }
157
166
 
164
173
        if(logpath == "disable")
165
174
        {
166
175
                tell_room(this_object(), "Notice: Logging has been disabled by " + this_player()->query_cap_name() + "\n");
 
176
                appendLog("\n\t  *** CONFERENCE LOGGING TERMINATED ***");
167
177
                logging = LOGGING_DISABLED;
168
178
                return 1;
169
179
        }
170
180
 
171
181
        else
172
182
        {
173
 
                logfile = logpath;
 
183
                string oldlog = logfile;
 
184
 
174
185
                tell_room(this_object(), "Notice: Conference will now be logged to " + logfile + "\n");
 
186
                appendLog("\n\t *** CONFERENCE LOGFILE REASSIGNMENT (new log: " + logpath + " ) ***");
 
187
                logfile = logpath;
 
188
                appendLog("\n\t  *** CONFERENCE LOGGING STARTED (old log: " + oldlog + " ) ***");
175
189
                return 1;
176
190
        }
177
191
}
181
195
        if(logging != LOGGING_ENABLED) return;
182
196
 
183
197
        if(arg[<2..] != "\n") arg += "\n";
184
 
        if(!write_file(logfile, ctime(time()) + " :: " + arg))
 
198
        if(!write_file(logfile, ctime(time()) + " # " + arg))
185
199
                if(objectp(chairman))
186
200
                        tell_object(chairman, "Warning: Unable to write to specified logfile.\n");
187
201
}