ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.219 by elmex, Thu Jun 7 19:03:25 2007 UTC vs.
Revision 1.220 by root, Sat Jun 9 22:54:03 2007 UTC

79static f_plug_api gethook = cfapi_get_hooks; 79static f_plug_api gethook = cfapi_get_hooks;
80static f_plug_api object_insert = cfapi_object_insert; 80static f_plug_api object_insert = cfapi_object_insert;
81 81
82static PerlInterpreter *perl; 82static PerlInterpreter *perl;
83 83
84double runtime; 84tstamp NOW, runtime;
85 85
86global gbl_ev; 86global gbl_ev;
87static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map; 87static AV *cb_global, *cb_attachable, *cb_object, *cb_player, *cb_client, *cb_type, *cb_map;
88static SV *sv_runtime, *sv_next_tick; 88static SV *sv_runtime, *sv_next_tick;
89 89
1031 1031
1032struct EventAPI *watcher_base::GEventAPI; 1032struct EventAPI *watcher_base::GEventAPI;
1033struct CoroAPI *coroapi::GCoroAPI; 1033struct CoroAPI *coroapi::GCoroAPI;
1034 1034
1035int coroapi::cede_counter; 1035int coroapi::cede_counter;
1036double (*coroapi::time)();
1037double coroapi::next_cede; 1036tstamp coroapi::next_cede;
1038 1037
1039void coroapi::do_cede_to_tick () 1038void coroapi::do_cede_to_tick ()
1040{ 1039{
1041 cede_counter = 0; 1040 cede_counter = 0;
1042 1041
1173 1172
1174 _connect_to_perl (); 1173 _connect_to_perl ();
1175 1174
1176 newCONSTSUB (stash_cf, "VERSION", newSVpv (VERSION, sizeof (VERSION) - 1)); 1175 newCONSTSUB (stash_cf, "VERSION", newSVpv (VERSION, sizeof (VERSION) - 1));
1177 1176
1178 { 1177 //{
1179 require_pv ("Time::HiRes"); 1178 // require_pv ("Time::HiRes");
1180 1179 //
1181 SV **svp = hv_fetch (PL_modglobal, "Time::NVtime", 12, 0); 1180 // SV **svp = hv_fetch (PL_modglobal, "Time::NVtime", 12, 0);
1182 if (!svp) croak ("Time::HiRes is required"); 1181 // if (!svp) croak ("Time::HiRes is required");
1183 if (!SvIOK(*svp)) croak ("Time::NVtime isn’t a function pointer"); 1182 // if (!SvIOK(*svp)) croak ("Time::NVtime isn’t a function pointer");
1184 coroapi::time = INT2PTR (double(*)(), SvIV(*svp)); 1183 // coroapi::time = INT2PTR (double(*)(), SvIV(*svp));
1185 } 1184 //}
1186 1185
1187 static const struct { 1186 static const struct {
1188 const char *name; 1187 const char *name;
1189 IV iv; 1188 IV iv;
1190 } *civ, const_iv[] = { 1189 } *civ, const_iv[] = {
1540 CODE: 1539 CODE:
1541 coroapi::cede_to_tick (); 1540 coroapi::cede_to_tick ();
1542 1541
1543void server_tick () 1542void server_tick ()
1544 CODE: 1543 CODE:
1544 NOW = now ();
1545 runtime = SvNVx (sv_runtime); 1545 runtime = SvNVx (sv_runtime);
1546 server_tick (); 1546 server_tick ();
1547 1547
1548void 1548void
1549log_backtrace (utf8_string msg) 1549log_backtrace (utf8_string msg)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines