From b9ac38a361cac129fff7c28af584e84af1968799 Mon Sep 17 00:00:00 2001
From: "psyc://psyced.org/~lynX" <@>
Date: Mon, 1 Mar 2010 17:46:42 +0100
Subject: [PATCH] no textdb proliferation necessary
---
world/drivers/ldmud/master/accept.c | 12 ++++++------
world/net/library/htbasics.c | 7 ++++---
world/net/place/archetype.gen | 12 +++++++++---
world/net/place/threads.c | 20 +++++++++++++-------
4 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/world/drivers/ldmud/master/accept.c b/world/drivers/ldmud/master/accept.c
index 880c8ff..b5c849c 100644
--- a/world/drivers/ldmud/master/accept.c
+++ b/world/drivers/ldmud/master/accept.c
@@ -384,12 +384,6 @@ object compile_object(string file) {
return rob;
}
# endif
- if (sscanf(file, "%s/text.c", path) && path != "") {
- rob = clone_object(NET_PATH "text");
- rob -> sPath(path);
- D2(if (rob) PP(("DB CLONED: %O becomes %s/text\n", rob, path));)
- return rob;
- }
if (sscanf(file, "place/%s.c", name) && name != "") {
#ifdef SANDBOX
string t;
@@ -450,6 +444,12 @@ object compile_object(string file) {
rob, name, path));)
return rob;
}
+ if (sscanf(file, "%s/text.c", path) && path != "") {
+ rob = clone_object(NET_PATH "text");
+ rob -> sPath(path);
+ D2(if (rob) PP(("DB CLONED: %O becomes %s/text\n", rob, path));)
+ return rob;
+ }
# ifdef JABBER_PATH
if (abbrev("S:xmpp:", file)) {
rob = clone_object(JABBER_PATH "gateway");
diff --git a/world/net/library/htbasics.c b/world/net/library/htbasics.c
index 7d92f33..3186093 100644
--- a/world/net/library/htbasics.c
+++ b/world/net/library/htbasics.c
@@ -4,15 +4,16 @@
// html-escaping of generic strings -lynx
// to make sure they won't trigger
-// html commands
+// html commands. this should become an inline macro, maybe use
+// regreplace if that is faster, or even better, be implemented in C
+// together with an auto hyperlink and a linebreak conversion option.
//
-varargs string htquote(string s, int newlines) {
+varargs string htquote(string s) {
ASSERT("htquote", stringp(s), s)
s = replace(s, "&", "&");
// s = replace(s, "\"", """); //"
s = replace(s, "<", "<");
s = replace(s, ">", ">");
- if (newlines) s = replace(s, "\n", "
\n");
return s;
}
diff --git a/world/net/place/archetype.gen b/world/net/place/archetype.gen
index 4bb4935..8151ced 100644
--- a/world/net/place/archetype.gen
+++ b/world/net/place/archetype.gen
@@ -216,13 +216,17 @@ int qSaveImmediately() {
#endif
}
+#ifdef _limit_amount_history_persistent
int qHistoryPersistentLimit() {
return _limit_amount_history_persistent;
}
+#endif
+#ifdef _limit_amount_history_export
int qHistoryExportLimit() {
return _limit_amount_history_export;
}
+#endif
// to be overloaded by place.gen
qNewsfeed() { return 0; }
@@ -281,7 +285,7 @@ msgView(source, mc, data, vars, showingLog) {
s = psyctext( T(mc, ""), vars, data, source );
if (strlen(s) < 7) return;
s = s[..<2];
-// htquote ist nicht so gründlich wie für javascript notwendig
+// htquote doesn't do the job as necessary for javascript
s = regreplace(s, "\&", "\\\&", 1);
s = regreplace(s, "<", "\\\<", 1);
s = regreplace(s, ">", "\\\>", 1);
@@ -468,7 +472,8 @@ showTopic(rcpt, verbose, mc) {
htget(prot, query, headers, qs, data, noprocess) {
//P3((">> archetype.gen:htget(%O, %O, %O, %O, %O, %O)\n", prot, query, headers, qs, data, noprocess))
# ifdef PLACE_SCRATCHPAD
- sTextPath(query["layout"] || MYNICK, query["lang"], "html");
+ // we *could* allow each place to define its own textdb.. but why?
+ sTextPath(query["layout"] /* || MYNICK */, query["lang"], "html");
if (!noprocess && (!qs || query["scratchpad"])) {
string rand, buf, len;
// microscopic wiki functionality .. cheap imitation of tobi's save.pike
@@ -607,8 +612,9 @@ htget(prot, query, headers, qs, data, noprocess) {
break;
#endif
default:
- sTextPath(query["layout"] || MYNICK, query["lang"], "html");
+ sTextPath(query["layout"], query["lang"], "html");
htok(prot);
+ // we could output a css something here..
// w("_HTML_head");
write("\n\n