--- deliantra/server/include/cfperl.h 2007/06/05 13:05:02 1.77 +++ deliantra/server/include/cfperl.h 2007/06/24 04:09:29 1.80 @@ -91,11 +91,12 @@ void cfperl_emergency_save (); void cfperl_cleanup (int make_core); void cfperl_make_book (object *book, int level); +void cfperl_send_msg (client *ns, int color, const char *type, const char *msg); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// virtual server time, excluding time jumps and lag -extern double runtime; +extern tstamp runtime; // virtual server time, excluding time jumps and lag +extern tstamp NOW; // real time of current server tick enum event_klass { @@ -265,7 +266,7 @@ } template - void put_string (keyword k, const T &v) + void put_kw_string (keyword k, const T &v) { int klen = keyword_len [k]; int vlen = v ? strlen (v) + 1 : 0; @@ -285,12 +286,12 @@ void put (keyword k, const char *v = 0) { - put_string (k, v); + put_kw_string (k, v); } void put (keyword k, const shstr &v) { - put_string (k, v); + put_kw_string (k, v); } void put (keyword k, double v) @@ -347,11 +348,9 @@ fadd (keyword_str [kend], keyword_len [kend]); fadd ('\n'); } - template - void put (keyword k, const T *v) - { - put (k, v ? &v->name : (const char *)0); - } + void put (keyword k, archetype *v); + void put (keyword k, treasurelist *v); + void put (keyword k, faceinfo *v); template void put (keyword k, const refptr &v) @@ -429,8 +428,7 @@ static int nready () { return CORO_NREADY; } static int cede () { return CORO_CEDE ; } - static double (*time)(); - static double next_cede; + static tstamp next_cede; static int cede_counter; static void do_cede_every (); @@ -445,7 +443,7 @@ static bool cede_to_tick () { - if (expect_true (time () < next_cede)) + if (expect_true (now () < next_cede)) return false; do_cede_to_tick ();