You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(180) |
Apr
(20) |
May
|
Jun
(91) |
Jul
(78) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
---|
From: Peep P. <so...@us...> - 2004-03-21 13:12:48
|
Update of /cvsroot/agd/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25264 Modified Files: ChangeLog NEWS TODO Log Message: New operators - ** and **=. Index: NEWS =================================================================== RCS file: /cvsroot/agd/server/NEWS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- NEWS 21 Mar 2004 08:56:42 -0000 1.5 +++ NEWS 21 Mar 2004 13:02:37 -0000 1.6 @@ -1,4 +1,5 @@ New things in this version (0.0.2-3) that you might find useful: + * New operators: **, **= * New dfuns: query_ip, query_hostname (use with caution, may block for quite a while), asctime. time() was changed to return seconds since Epoch. Index: TODO =================================================================== RCS file: /cvsroot/agd/server/TODO,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TODO 21 Mar 2004 12:24:59 -0000 1.10 +++ TODO 21 Mar 2004 13:02:37 -0000 1.11 @@ -9,12 +9,13 @@ - Statistics and profiling ! better conf file handling (see src/log.c) - change 'errorlog' to 'debuglog'? - - scripting: + - lpc: - inheritance - better error recovery for lpc.y ! arrays (T_ARRAY) ! for(), foreach(), switch() ! all of the operators (/doc/lpc/operators) + - ',' - this takes some serious grammar-hacking - mixed type ! string ranges (str[0..1,2..3]) * m.. Index: ChangeLog =================================================================== RCS file: /cvsroot/agd/server/ChangeLog,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ChangeLog 21 Mar 2004 12:24:59 -0000 1.11 +++ ChangeLog 21 Mar 2004 13:02:37 -0000 1.12 @@ -1,6 +1,7 @@ 0.0.2-3: ---------------------------------------------------------------------------- 2004-03-21 + * new operators: ** (power), **= (x = x ** y) * debuglevel can now be set with option "-d=x", where x is a number. * fixed net_send(), was a stupid bug - always sent to this_player. * added type2str() |
From: Peep P. <so...@us...> - 2004-03-21 13:12:48
|
Update of /cvsroot/agd/server/doc/lpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25264/doc/lpc Modified Files: operators Log Message: New operators - ** and **=. Index: operators =================================================================== RCS file: /cvsroot/agd/server/doc/lpc/operators,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- operators 20 Mar 2004 19:14:46 -0000 1.4 +++ operators 21 Mar 2004 13:02:37 -0000 1.5 @@ -10,6 +10,7 @@ /= binary self-division * *= binary self-multiplication * %= binary self-modulo * + **= binary self-power * comparison: == binary equal * (F_EQ) @@ -42,7 +43,7 @@ / binary division *(F_DIV) * binary multiplication *(F_MUL) % binary modulo * (F_MOD) - ** binary power + ** binary power * binary: & |
From: Peep P. <so...@us...> - 2004-03-21 12:35:35
|
Update of /cvsroot/agd/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18758 Modified Files: ChangeLog TODO Log Message: Debuglevel can be set with option -d=x. Index: TODO =================================================================== RCS file: /cvsroot/agd/server/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TODO 21 Mar 2004 10:37:02 -0000 1.9 +++ TODO 21 Mar 2004 12:24:59 -0000 1.10 @@ -79,7 +79,6 @@ compare_args(): 0 should be any valid type (shout("a", 0) should be ok) - or maybe use NULL or nil - if we crash while running apply(master::crash), then we should rerun with debugging on - - set debuglevel with "agd -d=5" - define DEBUG and set CFLAGS to -g with "./configure --enable-debug" - IPv6 support? - realloc wrapper Index: ChangeLog =================================================================== RCS file: /cvsroot/agd/server/ChangeLog,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ChangeLog 21 Mar 2004 10:37:02 -0000 1.10 +++ ChangeLog 21 Mar 2004 12:24:59 -0000 1.11 @@ -1,6 +1,7 @@ 0.0.2-3: ---------------------------------------------------------------------------- 2004-03-21 + * debuglevel can now be set with option "-d=x", where x is a number. * fixed net_send(), was a stupid bug - always sent to this_player. * added type2str() * fixed the functionality of time() - works as expected. |
From: Peep P. <so...@us...> - 2004-03-21 12:35:30
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18758/src Modified Files: main.c Log Message: Debuglevel can be set with option -d=x. Index: main.c =================================================================== RCS file: /cvsroot/agd/server/src/main.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- main.c 21 Mar 2004 08:51:05 -0000 1.13 +++ main.c 21 Mar 2004 12:24:59 -0000 1.14 @@ -19,6 +19,8 @@ */ #include "config.h" +#include "compile_options.h" + #include <stdio.h> #include <time.h> #include <signal.h> @@ -98,12 +100,15 @@ #endif } +#define JUMPTONEXT() if(argv[i][j+1] == '=') { i++; if(i < argc) goto next_i; else return; } + void parse_args(int argc, char **argv) { int i, j; int confs_provided = 0; for(i=1;i<argc;i++) { +next_i: if(argv[i][0] == '-') { int len = strlen(argv[i]); for(j=1;j<len;j++) { @@ -118,11 +123,17 @@ break; case 'd': #ifdef DEBUG - conf.debuglevel++; + if(argv[i][j+1] == '=') { + conf.debuglevel = atoi(argv[i]+j+2); + JUMPTONEXT() + } else { + conf.debuglevel++; + } #else - if(!conf.debuglevel) { + if(conf.debuglevel >= 0) { printf("-d only works if the driver is compiled with debugging on.\n"); conf.debuglevel = -1; + JUMPTONEXT() } #endif break; |
From: Peep P. <so...@us...> - 2004-03-21 12:35:09
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18692 Modified Files: log.c Log Message: Fixed crasher. Index: log.c =================================================================== RCS file: /cvsroot/agd/server/src/log.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- log.c 21 Mar 2004 10:35:53 -0000 1.5 +++ log.c 21 Mar 2004 12:24:36 -0000 1.6 @@ -1,5 +1,7 @@ -#include "std.h" +#include <stdio.h> +#include "sys.h" #include <stdarg.h> +#include <time.h> /* To prevent flooding the user with error messages. */ static int suppress_nofd, /* If we have a file descriptor. */ @@ -54,7 +56,7 @@ #endif #endif -#define WRITELOG(x) fprintf(x, "%s [%s] %s", ctime(time(NULL)), prefix, str) +#define WRITELOG(x) time(&t); fprintf(x, "%s [%s] %s", ctime(&t), prefix, str) /* this currently writes the errors into a generic error log, maybe we should write them into separate files */ @@ -63,6 +65,7 @@ { char str[512]; va_list va; + time_t t; va_start(va, fmt); vsprintf(str, fmt, va); @@ -70,8 +73,9 @@ str[strlen(str)+1] = '\0'; - if(/*!strcmp(prefix, "crash") ||*/ conf.debuglevel > 1) + if(/*!strcmp(prefix, "crash") ||*/ conf.debuglevel > 1) { WRITELOG(stderr); + } if(!logfile && !check_logfile()) return; |
From: Peep P. <so...@us...> - 2004-03-21 11:12:08
|
Update of /cvsroot/agd/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31761 Modified Files: AUTHORS Log Message: I don't think so... that's not it\! Where is it? <commence chiptune> ...ahh, here it is. Nectarine\! Index: AUTHORS =================================================================== RCS file: /cvsroot/agd/server/AUTHORS,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AUTHORS 21 Mar 2004 08:56:42 -0000 1.2 +++ AUTHORS 21 Mar 2004 11:01:58 -0000 1.3 @@ -8,3 +8,4 @@ Lawless and elver <ker...@ho...>, for inspiration and suggestions X-G and roots, for portability testing SourceForge.net, for hosting most everything for the project. + Nectarine Demoscene Radio (http://scenemusic.net) for hours and hours of music to keep me coding :) |
From: Peep P. <so...@us...> - 2004-03-21 10:47:10
|
Update of /cvsroot/agd/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27838 Modified Files: BUGS ChangeLog TODO Log Message: Updates. Index: TODO =================================================================== RCS file: /cvsroot/agd/server/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TODO 21 Mar 2004 08:56:42 -0000 1.8 +++ TODO 21 Mar 2004 10:37:02 -0000 1.9 @@ -22,22 +22,6 @@ * m..n * !n Need an intelligent parser for this. - Examples of compilation: - s[0..1] - F_BEGIN 0 - F_END 1 - F_RANGE 1 - s[0..1,3..4] - F_BEGIN 0 - F_END 1 - F_BEGIN 3 - F_BEGIN 4 - F_RANGE 2 - s[0..1,2..4] - F_BEGIN 0 - F_END 4 - F_RANGE 1 - s[!1, 2, 5] ! continue; and break; - allow to define locals inside statements @@ -92,10 +76,11 @@ - make maintainer-clean should also remove src/dfparse.output and src/lang.output - compile-time eval for < > <= >= == != ! - lang.y: - fun_call compare_args result >0 error (lang.y:1216) should show datatypes as strings, not ints compare_args(): 0 should be any valid type (shout("a", 0) should be ok) - or maybe use NULL or nil - if we crash while running apply(master::crash), then we should rerun with debugging on - set debuglevel with "agd -d=5" - define DEBUG and set CFLAGS to -g with "./configure --enable-debug" - IPv6 support? + - realloc wrapper + - make maintainer-clean shouldn't delete src/dfparse.h and src/lang.h Index: BUGS =================================================================== RCS file: /cvsroot/agd/server/BUGS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- BUGS 21 Mar 2004 08:56:42 -0000 1.5 +++ BUGS 21 Mar 2004 10:37:02 -0000 1.6 @@ -32,6 +32,5 @@ string s; s = s + "abc"; will result in "0abc" - - this_ob and this_player are not set correctly - continue from here.. Index: ChangeLog =================================================================== RCS file: /cvsroot/agd/server/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ChangeLog 21 Mar 2004 08:56:42 -0000 1.9 +++ ChangeLog 21 Mar 2004 10:37:02 -0000 1.10 @@ -1,6 +1,8 @@ 0.0.2-3: ---------------------------------------------------------------------------- 2004-03-21 + * fixed net_send(), was a stupid bug - always sent to this_player. + * added type2str() * fixed the functionality of time() - works as expected. time() now returns seconds since the Epoch, asctime() returns its argument as a string. |
From: Peep P. <so...@us...> - 2004-03-21 10:46:53
|
Update of /cvsroot/agd/server/lib/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27808/lib/sys Modified Files: master.c Log Message: Added a message for SIGINT (2). Index: master.c =================================================================== RCS file: /cvsroot/agd/server/lib/sys/master.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- master.c 21 Mar 2004 08:53:55 -0000 1.10 +++ master.c 21 Mar 2004 10:36:44 -0000 1.11 @@ -4,6 +4,8 @@ if(signal == 11) { shout("Driver shutting down - " "segmentation fault!\n", (object)0); + } else if(signal == 2) { + shout("Driver crashing - interrupted!\n", (object)0); } else if(signal) { shout("Crashing on signal " + signal + "!\n", (object)0); |
From: Peep P. <so...@us...> - 2004-03-21 10:46:37
|
Update of /cvsroot/agd/server/lib/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27751/lib/sys Modified Files: player.c Log Message: Added report_obs for debugging. Index: player.c =================================================================== RCS file: /cvsroot/agd/server/lib/sys/player.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- player.c 21 Mar 2004 08:53:33 -0000 1.9 +++ player.c 21 Mar 2004 10:36:28 -0000 1.10 @@ -87,6 +87,8 @@ int t = time(); write("The current time is: " + asctime(t) + ".\n"); + } else if(cmd == "/report") { + report_obs(); } else if(cmd == "/.") { if(last_cmd) { input(last_cmd); |
From: Peep P. <so...@us...> - 2004-03-21 10:46:37
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27751/src Modified Files: dfdecl.in Log Message: Added report_obs for debugging. Index: dfdecl.in =================================================================== RCS file: /cvsroot/agd/server/src/dfdecl.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- dfdecl.in 21 Mar 2004 08:52:54 -0000 1.7 +++ dfdecl.in 21 Mar 2004 10:36:28 -0000 1.8 @@ -49,3 +49,5 @@ void exec(object) string file_name(object) +# Debugging. +void report_obs() |
From: Peep P. <so...@us...> - 2004-03-21 10:45:59
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27597 Modified Files: log.c lang.y interpret.c dfuns.c Log Message: Reformatting. Index: dfuns.c =================================================================== RCS file: /cvsroot/agd/server/src/dfuns.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- dfuns.c 21 Mar 2004 08:52:29 -0000 1.14 +++ dfuns.c 21 Mar 2004 10:35:53 -0000 1.15 @@ -72,39 +72,46 @@ list_t *p; for(p = &all_objects; p; p = p->next) { - if(p->data != exclude) - tell_object(p->data, s); + object_t *ob = p->data; + if(ob != exclude) { + tell_object(ob, s); + } } } -void df_write(void) { +void df_write(void) +{ int ret; ret = do_write(fp->u.s); pop_stack(); push_int(ret); } -void df_input_to(void) { +void df_input_to(void) +{ this_player->input_to = fp->u.s; this_player->input_to_called = 0; pop_stack(); push_void(); } -char *get_ip(object_t *ob) { +char *get_ip(object_t *ob) +{ if(!ob->iaob) return NULL; return inet_ntoa(ob->iaob->conn.addr.sin_addr); } -void df_query_ip(void) { +void df_query_ip(void) +{ char *s; s = get_ip(fp->u.ob); pop_stack(); push_string(s, ST_STATIC); } -void df_query_hostname(void) { +void df_query_hostname(void) +{ char *s; struct hostent *he; @@ -121,11 +128,13 @@ push_string(s, ST_STATIC); } -void df_time(void) { +void df_time(void) +{ push_int(time(NULL)); } -void df_asctime(void) { +void df_asctime(void) +{ time_t t; char *s; @@ -136,17 +145,20 @@ push_string(s, ST_STATIC); } -void df_shout(void) { +void df_shout(void) +{ shout(fp[0].u.s, fp[1].u.ob); pop_stack(); pop_stack(); push_void(); } -void df_platform(void) { +void df_platform(void) +{ push_string(PLATFORM, ST_STATIC); } -void df_version(void) { +void df_version(void) +{ push_string(PACKAGE_VERSION, ST_STATIC); } @@ -157,60 +169,60 @@ push_void(); } -void df_find_object(void) { +void df_find_object(void) +{ object_t *ret; ret = find_object(fp->u.s); pop_stack(); push_object(ret); } -void df_load_object(void) { +void df_load_object(void) +{ object_t *ret; ret = load_object(fp->u.s); pop_stack(); push_object(ret); } -void df_this_object(void) { +void df_this_object(void) +{ push_object(this_ob); } -void df_previous_object(void) { +void df_previous_object(void) +{ push_object(previous_ob); } -void df_clone_object(void) { +void df_clone_object(void) +{ object_t *ret; -/* variable_t *saved_fp;*/ push_control_stack(); -/* saved_fp = fp; - fp++;*/ ret = clone_object(/*saved_*/fp->u.s); - /* clone_object() might, or might not call create() and therefore decrease fp. - * We have to decrement manually if needed. */ -/* if(fp > saved_fp) { - fp--; - }*/ pop_control_stack(1); pop_stack(); push_object(ret); } -void df_interactivep(void) { +void df_interactivep(void) +{ int ret = interactivep(fp->u.ob); pop_stack(); push_int(ret); } -void df_tell_object(void) { +void df_tell_object(void) +{ tell_object(fp[0].u.ob, fp[1].u.s); pop_stack(); pop_stack(); push_void(); } -void df_exec(void) { +void df_exec(void) +{ object_t *ob = fp->u.ob; player_t *p; if(!ob) @@ -226,7 +238,8 @@ push_void(); } -void df_file_name(void) { +void df_file_name(void) +{ char *ret; if(fp->u.ob && fp->u.ob->name) ret = fp->u.ob->name; @@ -236,7 +249,8 @@ push_string(ret, ST_STATIC); } -void df_uptime(void) { +void df_uptime(void) +{ time_t t; time(&t); push_int(t - startup_time); @@ -294,3 +308,7 @@ push_string(s, ST_MALLOC); } +void df_report_obs(void) +{ + report_obs(); +} Index: interpret.c =================================================================== RCS file: /cvsroot/agd/server/src/interpret.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- interpret.c 21 Mar 2004 09:00:03 -0000 1.14 +++ interpret.c 21 Mar 2004 10:35:53 -0000 1.15 @@ -246,18 +246,6 @@ this_player = /*this_ob->iaob*/ csp->this_player; } -/* Is this necessary? */ -void remove_lvalues(void) { - int i; - for(i=0;i<csp->num_arg;i++) { - if(fp[i].type == T_LVALUE) { - variable_t v = *fp[i].u.v; - do_assign(&fp[i], &v); - } - } -} - - /* Used by F_JMP and F_JMPF to check if they jumped too far. */ #define CHECK_OVERRUN() if((int *) cp >= (int *) code->data + code->length) {\ debug("interpret", "Ran over end of array: returning\n"); return; } @@ -266,6 +254,9 @@ tmp = --sp; if(tmp->type == T_LVALUE) tmp = tmp->u.v;\ arg[tmpi] = tmp->u.i; tmpi++; free_value(sp); } +#define SETUP_CALL_FRAME() tmpi = *++cp; cp++; push_control_stack(); \ + csp->num_arg = *cp; fp = sp - csp->num_arg + void eval_instruction(void) { variable_t *tmp; @@ -443,23 +434,12 @@ push_int(arg[1] <= arg[0] ? 1 : 0); break; case F_CALL_LFUN: - tmpi = *++cp; - /* tmpi is the index of the fun */ - cp++; - push_control_stack(); - csp->num_arg = *cp; - fp = sp - csp->num_arg; - remove_lvalues(); + SETUP_CALL_FRAME(); call_function(this_ob, tmpi); goto again; break; case F_CALL_DFUN: - tmpi = *++cp; - cp++; - push_control_stack(); - csp->num_arg = *cp; - fp = sp - csp->num_arg; - remove_lvalues(); + SETUP_CALL_FRAME(); dfptr[tmpi](); pop_control_stack(0); break; @@ -520,12 +500,16 @@ #endif /* We return to the control level where we entered - we have finished. */ if(csp == saved_csp) { +#ifdef DEBUG debug("interpret", "csp (%d) == saved_csp (%d); returning\n", csp - &control_stack[0], saved_csp - &control_stack[0]); +#endif return; } /* Abnormal termination - need to pop unnecessary stuff off the stack. */ if(this_ob->flags & O_DESTRUCTED) { +#ifdef DEBUG debug("interpret", "this_ob destructed; returning\n"); +#endif /* Should we pop to the bottom? */ pop_control_stack(1); pop_locals(); Index: log.c =================================================================== RCS file: /cvsroot/agd/server/src/log.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- log.c 12 Mar 2004 08:40:10 -0000 1.4 +++ log.c 21 Mar 2004 10:35:53 -0000 1.5 @@ -44,6 +44,7 @@ return 1; } +#if 0 /* If we are compiling the dfparse binary, dfuns.o is not linked and thus we don't get do_time(). */ #ifdef _DFUNS_H @@ -51,6 +52,9 @@ #else #define WRITELOG(x) fprintf(x, "[%s] %s", prefix, str) #endif +#endif + +#define WRITELOG(x) fprintf(x, "%s [%s] %s", ctime(time(NULL)), prefix, str) /* this currently writes the errors into a generic error log, maybe we should write them into separate files */ @@ -66,7 +70,7 @@ str[strlen(str)+1] = '\0'; - if(!strcmp(prefix, "crash") || conf.debuglevel > 1) + if(/*!strcmp(prefix, "crash") ||*/ conf.debuglevel > 1) WRITELOG(stderr); if(!logfile && !check_logfile()) Index: lang.y =================================================================== RCS file: /cvsroot/agd/server/src/lang.y,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- lang.y 20 Mar 2004 20:26:52 -0000 1.9 +++ lang.y 21 Mar 2004 10:35:53 -0000 1.10 @@ -409,20 +409,20 @@ array_push(&$$, (void *) F_RETURN); } | if - { + { init_array(&$$); array_concat(&$$, &$1); - } + } | do_while - { + { init_array(&$$); array_concat(&$$, &$1); - } + } | while - { + { init_array(&$$); array_concat(&$$, &$1); - } + } | expr ';' { init_array(&$$); @@ -438,7 +438,7 @@ { init_array(&$$); } -; + ; statements: /* empty */ @@ -451,7 +451,7 @@ array_concat(&$$, &$1); array_concat(&$$, &$2); } -; + ; arguments: L_DATA_TYPE @@ -616,7 +616,10 @@ } } else if($3.type == T_STRING) { array_push(&$$.arr, (void *) F_PUSH_STRING); - array_push(&$$.arr, strcat($1.arr.data[1], $3.arr.data[1])); + s = xmalloc(strlen($1.arr.data[1]) + strlen($3.arr.data[1]) + 1); + strcpy(s, $1.arr.data[1]); + s = strcat(s, $3.arr.data[1]); + array_push(&$$.arr, s); } else { char buf[256], *buf2; s = $1.arr.data[1]; @@ -1186,7 +1189,9 @@ string_con2 | string_con1 L_PLUS string_con1 { - $$ = strcat($1, $3); + $$ = xmalloc(strlen($1) + strlen($3) + 1); + $$ = strcpy($$, $1); + $$ = strcat($$, $3); } ;*/ @@ -1197,7 +1202,7 @@ } | string_con2 L_STRING { - $$ = malloc(strlen($1) + strlen($2) + 1); + $$ = xmalloc(strlen($1) + strlen($2) + 1); strcpy($$, $1); $$ = strcat($$, $2); } @@ -1271,29 +1276,25 @@ L_DO statement L_WHILE '(' expr ')' { init_array(&$$); -/* if($2.length) {*/ - array_push(&$$, (void *) F_JMP); - array_push(&$$, (void *) ($5.arr.length + 3)); - array_concat(&$$, &$5.arr); - array_push(&$$, (void *) F_JMPF); - array_push(&$$, (void *) ($2.length + 3)); - array_concat(&$$, &$2); - array_push(&$$, (void *) F_JMP); - array_push(&$$, (void *) -($2.length + $5.arr.length + 3)); -/* }*/ + array_push(&$$, (void *) F_JMP); + array_push(&$$, (void *) ($5.arr.length + 3)); + array_concat(&$$, &$5.arr); + array_push(&$$, (void *) F_JMPF); + array_push(&$$, (void *) ($2.length + 3)); + array_concat(&$$, &$2); + array_push(&$$, (void *) F_JMP); + array_push(&$$, (void *) -($2.length + $5.arr.length + 3)); } while: L_WHILE '(' expr ')' statement { init_array(&$$); -/* if($5.length) {*/ - array_concat(&$$, &$3.arr); - array_push(&$$, (void *) F_JMPF); - array_push(&$$, (void *) ($5.length + 3)); - array_concat(&$$, &$5); - array_push(&$$, (void *) F_JMP); - array_push(&$$, (void *) -($5.length + $3.arr.length + 3)); -/* }*/ + array_concat(&$$, &$3.arr); + array_push(&$$, (void *) F_JMPF); + array_push(&$$, (void *) ($5.length + 3)); + array_concat(&$$, &$5); + array_push(&$$, (void *) F_JMP); + array_push(&$$, (void *) -($5.length + $3.arr.length + 3)); } ; @@ -1329,8 +1330,9 @@ /* went okay */ break; default: /* > 0 */ - sprintf(buf, "Argument %d type mismatch for %s - expected %d, got %d", - i, $1->name, $1->args->data[i], tempargs.data[i]); + sprintf(buf, "Argument %d type mismatch for %s - expected %s, got %s", + i, $1->name, type2str($1->args->data[i]), + type2str(tempargs.data[i])); comp_error(buf); break; } |
From: Peep P. <so...@us...> - 2004-03-21 10:45:08
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27482 Modified Files: net.c Log Message: Fixed a bug with net_send() - always sent to this_player. Index: net.c =================================================================== RCS file: /cvsroot/agd/server/src/net.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- net.c 21 Mar 2004 08:51:05 -0000 1.9 +++ net.c 21 Mar 2004 10:35:02 -0000 1.10 @@ -115,7 +115,7 @@ crash(0, "master::connect() is not working", 3); if(!login_ob->u.ob) { - printf("Warning: master::connect() didn't return an object.\n"); + fprintf(stderr, "Warning: master::connect() didn't return an object.\n"); do_write("Oops, glitch in world fabric - you didn't get an object.\n"); xfree(player_ob); net_disconnect(p); @@ -163,7 +163,7 @@ void net_send(char *buf, int siz, player_t *p) { - send(this_player->conn.socket, buf, siz, 0); + send(p->conn.socket, buf, siz, 0); } void net_read(player_t *p) |
From: Peep P. <so...@us...> - 2004-03-21 10:44:54
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27392 Modified Files: object.c sys.c sys.h Log Message: Cleanups. Index: sys.h =================================================================== RCS file: /cvsroot/agd/server/src/sys.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sys.h 16 Mar 2004 14:14:26 -0000 1.5 +++ sys.h 21 Mar 2004 10:34:47 -0000 1.6 @@ -26,10 +26,6 @@ extern config_t conf; -#if 0 -char *get_working_dir(void); -int dir_exists(char *name, int verbose); -#endif int legal_path(char *fn); char *stringdup(char *s); Index: object.c =================================================================== RCS file: /cvsroot/agd/server/src/object.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- object.c 21 Mar 2004 08:50:45 -0000 1.10 +++ object.c 21 Mar 2004 10:34:47 -0000 1.11 @@ -166,14 +166,11 @@ new_ob->name = xmalloc(strlen(base_ob->name) + 10); sprintf(new_ob->name, "%s#%d", base_ob->name, base_ob->ref); - /*new_ob->prog = type_xmalloc(program_t); - new_ob->prog->fun_table = *copy_array(&base_ob->prog->fun_table, NULL); - new_ob->prog->functions = *copy_array(&base_ob->prog->functions, (void*(*)(void *)) copy_fun);*/ new_ob->prog = base_ob->prog; ref_prog(new_ob->prog); /* Memory leak? */ - new_ob/*->prog*/->variables = *copy_array(&base_ob/*->prog*/->variables, (void*(*)(void*)) copy_var); + new_ob->variables = *copy_array(&base_ob->variables, (void*(*)(void*)) copy_var); apply(new_ob, "create", NULL); list_push(&all_objects, new_ob); @@ -187,20 +184,6 @@ return ob && ob->iaob; } -/* WTF? */ -#if 0 -object_t *this_object(void) -{ - return this_ob; -} - - -object_t *previous_object(void) -{ - return previous_ob; -} -#endif - void tell_object(object_t *ob, char *s) { player_t *p; @@ -212,14 +195,6 @@ } -/* Poiiintleeesss... */ -char *file_name(object_t *ob) -{ - if(ob) - return ob->name; - return NULL; -} - #ifdef DEBUG void report_obs(void) { Index: sys.c =================================================================== RCS file: /cvsroot/agd/server/src/sys.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- sys.c 16 Mar 2004 14:14:04 -0000 1.9 +++ sys.c 21 Mar 2004 10:34:47 -0000 1.10 @@ -151,6 +151,7 @@ return p; } +#ifdef DEBUG void xfree(void *p) { mstats.free++; @@ -162,6 +163,9 @@ free(p); } +#else +#define xfree(p) free(p) +#endif int legal_path(char *fn) { |
From: Peep P. <so...@us...> - 2004-03-21 10:44:22
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27312 Modified Files: vars.h vars.c Log Message: Added type2str. Index: vars.c =================================================================== RCS file: /cvsroot/agd/server/src/vars.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- vars.c 21 Mar 2004 08:50:29 -0000 1.8 +++ vars.c 21 Mar 2004 10:34:15 -0000 1.9 @@ -233,3 +233,18 @@ } } +/* lang.y uses this. */ +char *type2str(variable_t *v) +{ + switch(v->type) { + case T_INT: + return "int"; + case T_STRING: + return "string"; + case T_OBJECT: + return "object"; + default: + return "unknown"; + } +} + Index: vars.h =================================================================== RCS file: /cvsroot/agd/server/src/vars.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- vars.h 12 Mar 2004 08:40:10 -0000 1.4 +++ vars.h 21 Mar 2004 10:34:15 -0000 1.5 @@ -12,4 +12,6 @@ void assign_var(variable_t *dest, variable_t *src); void assign_var_value(variable_t *var, void *val); +char *type2str(variable_t *v); + #endif |
From: Peep P. <so...@us...> - 2004-03-21 09:55:57
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19443 Removed Files: dflex.h Log Message: Deleted. --- dflex.h DELETED --- |
From: Peep P. <so...@us...> - 2004-03-21 09:11:02
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12397 Modified Files: lang.h dfparse.h Log Message: Update. Index: lang.h =================================================================== RCS file: /cvsroot/agd/server/src/lang.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lang.h 12 Mar 2004 16:05:05 -0000 1.2 +++ lang.h 21 Mar 2004 09:00:57 -0000 1.3 @@ -45,25 +45,30 @@ L_OPEN_FUNP = 271, L_CLOSE_FUNP = 272, L_ASSIGN = 273, - L_AND = 274, - L_OR = 275, - L_GE = 276, - L_LE = 277, - L_GT = 278, - L_LT = 279, - L_NE = 280, - L_EQ = 281, - L_MINUS = 282, - L_PLUS = 283, - L_MOD = 284, - L_DIV = 285, - L_MUL = 286, - L_DEREF = 287, - L_DEC = 288, - L_INC = 289, - L_NOT = 290, - L_NEG = 291, - L_TYPECAST = 292 + L_ME = 274, + L_PE = 275, + L_DE = 276, + L_MOE = 277, + L_MUE = 278, + L_AND = 279, + L_OR = 280, + L_NE = 281, + L_EQ = 282, + L_MINUS = 283, + L_PLUS = 284, + L_GE = 285, + L_LE = 286, + L_GT = 287, + L_LT = 288, + L_MOD = 289, + L_DIV = 290, + L_MUL = 291, + L_DEREF = 292, + L_DEC = 293, + L_INC = 294, + L_NOT = 295, + L_NEG = 296, + L_TYPECAST = 297 }; #endif #define L_RETURN 258 @@ -82,31 +87,36 @@ #define L_OPEN_FUNP 271 #define L_CLOSE_FUNP 272 #define L_ASSIGN 273 -#define L_AND 274 -#define L_OR 275 -#define L_GE 276 -#define L_LE 277 -#define L_GT 278 -#define L_LT 279 -#define L_NE 280 -#define L_EQ 281 -#define L_MINUS 282 -#define L_PLUS 283 -#define L_MOD 284 -#define L_DIV 285 -#define L_MUL 286 -#define L_DEREF 287 -#define L_DEC 288 -#define L_INC 289 -#define L_NOT 290 -#define L_NEG 291 -#define L_TYPECAST 292 +#define L_ME 274 +#define L_PE 275 +#define L_DE 276 +#define L_MOE 277 +#define L_MUE 278 +#define L_AND 279 +#define L_OR 280 +#define L_NE 281 +#define L_EQ 282 +#define L_MINUS 283 +#define L_PLUS 284 +#define L_GE 285 +#define L_LE 286 +#define L_GT 287 +#define L_LT 288 +#define L_MOD 289 +#define L_DIV 290 +#define L_MUL 291 +#define L_DEREF 292 +#define L_DEC 293 +#define L_INC 294 +#define L_NOT 295 +#define L_NEG 296 +#define L_TYPECAST 297 #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 24 "lang.y" +#line 28 "lang.y" typedef union YYSTYPE { char *str; int i; @@ -117,7 +127,7 @@ def_id_t *id; } YYSTYPE; /* Line 1240 of yacc.c. */ -#line 121 "lang.h" +#line 131 "lang.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 Index: dfparse.h =================================================================== RCS file: /cvsroot/agd/server/src/dfparse.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- dfparse.h 16 Mar 2004 14:11:26 -0000 1.2 +++ dfparse.h 21 Mar 2004 09:00:57 -0000 1.3 @@ -40,7 +40,7 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 55 "dfparse.y" +#line 56 "dfparse.y" typedef union YYSTYPE { char *s; int i; |
From: Peep P. <so...@us...> - 2004-03-21 09:10:09
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12242 Modified Files: interpret.c Log Message: Fixed compilation. Index: interpret.c =================================================================== RCS file: /cvsroot/agd/server/src/interpret.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- interpret.c 21 Mar 2004 08:56:52 -0000 1.13 +++ interpret.c 21 Mar 2004 09:00:03 -0000 1.14 @@ -246,7 +246,7 @@ this_player = /*this_ob->iaob*/ csp->this_player; } -/* +/* Is this necessary? */ void remove_lvalues(void) { int i; for(i=0;i<csp->num_arg;i++) { @@ -256,7 +256,7 @@ } } } -*/ + /* Used by F_JMP and F_JMPF to check if they jumped too far. */ #define CHECK_OVERRUN() if((int *) cp >= (int *) code->data + code->length) {\ |
From: Peep P. <so...@us...> - 2004-03-21 09:07:17
|
Update of /cvsroot/agd/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11697 Modified Files: AUTHORS BUGS ChangeLog Ideas NEWS TODO configure configure.ac Log Message: Updates for 0.0.2-3. Index: configure.ac =================================================================== RCS file: /cvsroot/agd/server/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 16 Mar 2004 20:17:32 -0000 1.4 +++ configure.ac 21 Mar 2004 08:56:42 -0000 1.5 @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT(AGD, 0.0.2-2, [so...@es...]) +AC_INIT(AGD, 0.0.2-3, [so...@es...]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR(src/dfparse.y) AM_CONFIG_HEADER(src/config.h) Index: configure =================================================================== RCS file: /cvsroot/agd/server/configure,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure 16 Mar 2004 20:17:32 -0000 1.4 +++ configure 21 Mar 2004 08:56:42 -0000 1.5 @@ -1,7 +1,7 @@ #! /bin/sh # From configure.ac revision 0.06. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for AGD 0.0.2-2. +# Generated by GNU Autoconf 2.59 for AGD 0.0.2-3. # # Report bugs to <so...@es...>. # @@ -270,8 +270,8 @@ # Identity of this package. PACKAGE_NAME='AGD' PACKAGE_TARNAME='agd' -PACKAGE_VERSION='0.0.2-2' -PACKAGE_STRING='AGD 0.0.2-2' +PACKAGE_VERSION='0.0.2-3' +PACKAGE_STRING='AGD 0.0.2-3' PACKAGE_BUGREPORT='so...@es...' ac_unique_file="src/dfparse.y" @@ -782,7 +782,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures AGD 0.0.2-2 to adapt to many kinds of systems. +\`configure' configures AGD 0.0.2-3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -844,7 +844,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of AGD 0.0.2-2:";; + short | recursive ) echo "Configuration of AGD 0.0.2-3:";; esac cat <<\_ACEOF @@ -964,7 +964,7 @@ test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -AGD configure 0.0.2-2 +AGD configure 0.0.2-3 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -978,7 +978,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by AGD $as_me 0.0.2-2, which was +It was created by AGD $as_me 0.0.2-3, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1589,7 +1589,7 @@ # Define the identity of the package. PACKAGE='agd' - VERSION='0.0.2-2' + VERSION='0.0.2-3' cat >>confdefs.h <<_ACEOF @@ -6278,7 +6278,7 @@ } >&5 cat >&5 <<_CSEOF -This file was extended by AGD $as_me 0.0.2-2, which was +This file was extended by AGD $as_me 0.0.2-3, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6341,7 +6341,7 @@ cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -AGD config.status 0.0.2-2 +AGD config.status 0.0.2-3 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Index: ChangeLog =================================================================== RCS file: /cvsroot/agd/server/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ChangeLog 20 Mar 2004 20:27:54 -0000 1.8 +++ ChangeLog 21 Mar 2004 08:56:42 -0000 1.9 @@ -1,3 +1,15 @@ +0.0.2-3: +---------------------------------------------------------------------------- +2004-03-21 + * fixed the functionality of time() - works as expected. + time() now returns seconds since the Epoch, asctime() returns + its argument as a string. + * dfuns: query_ip(), query_hostname() + * k, m, K, M (the latter two suggested by elver) integer constants + 1k = 1000 + 1m = 1000000 + 1K = 1024 + 1M = 1024 * 1024 = 1048576 0.0.2-2: ---------------------------------------------------------------------------- 2004-03-20 Index: NEWS =================================================================== RCS file: /cvsroot/agd/server/NEWS,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- NEWS 20 Mar 2004 19:18:42 -0000 1.4 +++ NEWS 21 Mar 2004 08:56:42 -0000 1.5 @@ -1,4 +1,11 @@ -New things in this version (0.0.2-2) that you might find useful: +New things in this version (0.0.2-3) that you might find useful: + * New dfuns: query_ip, query_hostname (use with caution, may block for quite a while), + asctime. + time() was changed to return seconds since Epoch. + * k, m, K and M integer constants + 1k = 1000, 1m = 1000000, 1K = 1024, 1M = 1048576 (1024*1024) + +Features in 0.0.2-2: * String ranges and character constants (you can now do things like s[1] = 'a') * Dfuns: random, strlen, capitalize, lower_case * Removed dfun asctime(). This can and should be done with LPC, and there's an example Index: AUTHORS =================================================================== RCS file: /cvsroot/agd/server/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AUTHORS 12 Mar 2004 08:32:10 -0000 1.1 +++ AUTHORS 21 Mar 2004 08:56:42 -0000 1.2 @@ -5,6 +5,6 @@ * the original graphics editor, some of the older client code Thanks to: - Lawless and elver, for inspiration and suggestions + Lawless and elver <ker...@ho...>, for inspiration and suggestions X-G and roots, for portability testing SourceForge.net, for hosting most everything for the project. Index: TODO =================================================================== RCS file: /cvsroot/agd/server/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TODO 20 Mar 2004 19:14:11 -0000 1.7 +++ TODO 21 Mar 2004 08:56:42 -0000 1.8 @@ -1,7 +1,8 @@ Not necessarily in order of importance. Stuff with '!' is first-priority. - - new define_name system (DONE) + - the famous host lookup daemon, so gethostbyaddr() won't block + - new define_name system, again. - if a variable is shadowed inside a block, then it needs to be assigned a new index - argument variants (both d- and lfuns) - a real malloc wrapper @@ -16,6 +17,28 @@ ! all of the operators (/doc/lpc/operators) - mixed type ! string ranges (str[0..1,2..3]) + * m.. + * ..n + * m..n + * !n + Need an intelligent parser for this. + Examples of compilation: + s[0..1] + F_BEGIN 0 + F_END 1 + F_RANGE 1 + s[0..1,3..4] + F_BEGIN 0 + F_END 1 + F_BEGIN 3 + F_BEGIN 4 + F_RANGE 2 + s[0..1,2..4] + F_BEGIN 0 + F_END 4 + F_RANGE 1 + s[!1, 2, 5] + ! continue; and break; - allow to define locals inside statements like: create() { write("\n"); int i; i = 1; int j; j = 2; } @@ -29,15 +52,22 @@ - predefined names: #define __AGD__ 1 #define __VERSION__ PACKAGE_VERSION + Also possible: + #define __AGD_MAJOR__ 0 + #define __AGD_MINOR__ 0 + #define __AGD_SUBMINOR__ 2 + #define __AGD_PATCHLEVEL__ 3 + But these are quite pointless at this time. #define __ARCH__ PLATFORM - #define __HOST__ system hostname, from somewhere. + #define __HOST__ the return value of gethostname() + #define __AUTHORS__ ? :) - character encoding inside strings: - decimal: \nnn - octal: \0onnn - hexadecimal: \0xnn - binary: \0bnnnnnnnn - dfuns: - query_ip() and query_hostname() for players. + - strftime() - mudlib: /update command - better logging system @@ -68,3 +98,4 @@ - if we crash while running apply(master::crash), then we should rerun with debugging on - set debuglevel with "agd -d=5" - define DEBUG and set CFLAGS to -g with "./configure --enable-debug" + - IPv6 support? Index: Ideas =================================================================== RCS file: /cvsroot/agd/server/Ideas,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Ideas 20 Mar 2004 19:13:57 -0000 1.4 +++ Ideas 21 Mar 2004 08:56:42 -0000 1.5 @@ -3,12 +3,8 @@ * if(x == 1 || == 2 && != 3) * Argument type grouping int foo(int i, j, k, string s1, s2, s3, object ob1, ob2); - * k integer constants: - 100k equals to 100000 - 1k equals to 1000 etc. - * the same for K, M (suggested by elver) - K (or maybe Kb / KB) = 1024 - M = 1024 * 1024 + * null constants: + 0, nil or NULL? * unlimited <statement> For example: unlimited { Index: BUGS =================================================================== RCS file: /cvsroot/agd/server/BUGS,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BUGS 18 Mar 2004 20:51:16 -0000 1.4 +++ BUGS 21 Mar 2004 08:56:42 -0000 1.5 @@ -32,5 +32,6 @@ string s; s = s + "abc"; will result in "0abc" + - this_ob and this_player are not set correctly - continue from here.. |
From: Peep P. <so...@us...> - 2004-03-21 09:06:59
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11697/src Modified Files: arch.h interpret.c lpc_incl.h Log Message: Updates for 0.0.2-3. Index: interpret.c =================================================================== RCS file: /cvsroot/agd/server/src/interpret.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- interpret.c 18 Mar 2004 20:47:08 -0000 1.12 +++ interpret.c 21 Mar 2004 08:56:52 -0000 1.13 @@ -29,6 +29,7 @@ int *cp; array_t *code; object_t *this_ob, *previous_ob; + player_t *this_player; int num_arg; } control_stack_t; @@ -214,8 +215,10 @@ void push_control_stack(void) { - csp->previous_ob = previous_ob; +/* csp->previous_ob = previous_ob;*/ csp->this_ob = this_ob; + if(this_ob) + csp->this_player = this_ob->iaob; csp->fp = fp; csp->sp = sp; csp->cp = cp; @@ -237,12 +240,13 @@ cp = csp->cp; code = csp->code; - previous_ob = csp->previous_ob; +/* previous_ob = csp->previous_ob;*/ this_ob = csp->this_ob; if(this_ob && this_ob->iaob) - this_player = this_ob->iaob; + this_player = /*this_ob->iaob*/ csp->this_player; } +/* void remove_lvalues(void) { int i; for(i=0;i<csp->num_arg;i++) { @@ -252,6 +256,7 @@ } } } +*/ /* Used by F_JMP and F_JMPF to check if they jumped too far. */ #define CHECK_OVERRUN() if((int *) cp >= (int *) code->data + code->length) {\ @@ -564,7 +569,7 @@ #ifdef DEBUG debug("interpret", "call_function %d on %s\n", index, ob->name); #endif - previous_ob = this_ob; +/* previous_ob = this_ob;*/ this_ob = ob; if(this_ob->iaob) this_player = this_ob->iaob; Index: arch.h =================================================================== RCS file: /cvsroot/agd/server/src/arch.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- arch.h 12 Mar 2004 08:40:10 -0000 1.5 +++ arch.h 21 Mar 2004 08:56:42 -0000 1.6 @@ -1,6 +1,6 @@ #ifndef _ARCH_H #define _ARCH_H -/* OpenBSD, QNX, OpenVMS/VAX, Cygwin? */ +/* OpenBSD, QNX, OpenVMS/VAX, Cygwin, OS/2? */ /* Operating system checks */ #ifdef __linux Index: lpc_incl.h =================================================================== RCS file: /cvsroot/agd/server/src/lpc_incl.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lpc_incl.h 1 Feb 2004 13:12:30 -0000 1.4 +++ lpc_incl.h 21 Mar 2004 08:56:52 -0000 1.5 @@ -11,7 +11,7 @@ #include "dfuns.h" #include "vars.h" -extern object_t *master; +/*extern object_t *master;*/ extern list_t all_objects; extern player_t *this_player; extern object_t *this_ob, *previous_ob; |
From: Peep P. <so...@us...> - 2004-03-21 09:04:16
|
Update of /cvsroot/agd/server/lib/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11279 Modified Files: login.c Log Message: Uses the new time functions and query_ip Index: login.c =================================================================== RCS file: /cvsroot/agd/server/lib/sys/login.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- login.c 18 Mar 2004 20:49:57 -0000 1.4 +++ login.c 21 Mar 2004 08:54:12 -0000 1.5 @@ -4,12 +4,16 @@ } void logon() { + write("Welcome! You are connecting from " + + /* query_hostname(this_object()) + " (" + */ + query_ip(this_object()) +/* ")"*/".\n"); write("\nEnter your name: "); input_to("logon2"); } void new_player(string name) { object ob; + string t; ob = clone_object("/sys/player"); if(!ob) { @@ -19,9 +23,10 @@ } ob->set_name(name); - shout(time() + ": " + name + " has joined the game\n", this_object()); - write(time() + ": You have joined the game. Use '/help' for " - "a list of commands.\n"); + t = asctime(time()); + shout(t + ": " + name + " has joined the game\n", this_object()); + write(t + ": You have joined the game.\n"); + write("Use '/help' to get a list of commands.\n"); exec(ob); destruct(this_object()); } |
From: Peep P. <so...@us...> - 2004-03-21 09:04:00
|
Update of /cvsroot/agd/server/lib/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11159 Modified Files: master.c Log Message: Adds site and mailing list addresses to the version banner. Index: master.c =================================================================== RCS file: /cvsroot/agd/server/lib/sys/master.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- master.c 20 Mar 2004 19:15:07 -0000 1.9 +++ master.c 21 Mar 2004 08:53:55 -0000 1.10 @@ -29,5 +29,6 @@ | _ | __| \\\n\ | | | | -- |\n\ |___|___|_______|_____/\n\ - \t\tv" + version() + " / " + platform() + "\n"; + \tv" + version() + " / " + platform() + "\n" + + "\thttp://agd.sf.net\n\tag...@li...\n"; } |
From: Peep P. <so...@us...> - 2004-03-21 09:03:41
|
Update of /cvsroot/agd/server/lib/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11122 Modified Files: player.c Log Message: Fixes whitespace in ctime(), uses the new time dfuns. Index: player.c =================================================================== RCS file: /cvsroot/agd/server/lib/sys/player.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- player.c 20 Mar 2004 19:15:21 -0000 1.8 +++ player.c 21 Mar 2004 08:53:33 -0000 1.9 @@ -1,4 +1,5 @@ string _name, last_cmd; +int num_input; void create() { input_to("input"); @@ -18,6 +19,7 @@ write("\t/uptime: Shows for how long the driver has been running.\n"); write("\t/version: Shows AGD version information.\n"); write("\t/quit: Quits the game.\n"); + write("\t/time: Shows current time.\n"); write("\t/.: Repeats last command.\n"); } @@ -41,14 +43,23 @@ } ret = ""; /* :-( */ - if(days) - ret += days + " day" + days>1?"s":"" + " "; - if(hrs) - ret += hrs + " hour" + hrs>1?"s":"" + " "; - if(mins) - ret += mins + " minute" + mins>1?"s":"" + " "; + if(days) { + ret += days + " day" + days>1?"s":""; + if(hrs || mins || secs) + ret += " "; + } + if(hrs) { + ret += hrs + " hour" + hrs>1?"s":""; + if(mins || secs) + ret += " "; + } + if(mins) { + ret += mins + " minute" + mins>1?"s":""; + if(secs) + ret += " "; + } if(secs) { - ret += secs + " second" + secs>1?"s":"" + " "; + ret += secs + " second" + secs>1?"s":""; } return ret; } @@ -64,16 +75,18 @@ break; }*/ if(cmd == "/quit") { - shout(time() + ": " + capitalize(_name) + " has quit the game\n", this_object()); + shout(asctime(time()) + ": " + capitalize(_name) + " has quit the game\n", this_object()); destruct(this_object()); } else if(cmd == "/uptime") { - write("The driver has been running for " + ctime(uptime()) + "\n"); - } else if(cmd == "/print_objs") { - print_objs(); + write("AGD " + version() + " has been running for " + ctime(uptime()) + ".\n"); } else if(cmd == "/version") { "/sys/master"->write_version(); } else if(cmd == "/help") { write_help(); + } else if(cmd == "/time") { + int t = time(); + write("The current time is: " + asctime(t) + + ".\n"); } else if(cmd == "/.") { if(last_cmd) { input(last_cmd); @@ -83,16 +96,21 @@ write("Unknown command.\n"); } } else { - shout(time() + ": " + capitalize(_name) + " says: " + cmd + "\n", this_object()); - write(time() + ": You say: " + cmd + "\n"); + string t = asctime(time()); + shout(t + ": " + capitalize(_name) + " says: " + + cmd + "\n", this_object()); + write(t + ": You say: " + cmd + "\n"); } - if(cmd != "/.") + if(cmd != "/.") { last_cmd = cmd; + num_input++; + } input_to("input"); } void write_prompt() { - write(_name + /* "@" + __HOSTNAME__ + */ "$ "); + write(_name + /* "@" + __HOSTNAME__ + */ ":" + + num_input + "$ "); } void net_dead() { |
From: Peep P. <so...@us...> - 2004-03-21 09:02:58
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11036 Modified Files: dfdecl.in Log Message: Added dfuns query_ip, query_hostname, asctime, changed time(). Index: dfdecl.in =================================================================== RCS file: /cvsroot/agd/server/src/dfdecl.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dfdecl.in 18 Mar 2004 20:47:36 -0000 1.6 +++ dfdecl.in 21 Mar 2004 08:52:54 -0000 1.7 @@ -23,15 +23,16 @@ int interactivep(object) void input_to(string) int query_idle(object) +string query_ip(object) +string query_hostname(object) # misc -string time() +int time() +string asctime(int) string version() string platform() int uptime() int random(int) -# Removed. -# string asctime(int) # strings int strlen(string) @@ -48,5 +49,3 @@ void exec(object) string file_name(object) -# debugging -void print_objs(void) |
From: Peep P. <so...@us...> - 2004-03-21 09:02:35
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10923 Modified Files: dfuns.c Log Message: Added dfuns query_ip, query_hostname, asctime, changed time(). Index: dfuns.c =================================================================== RCS file: /cvsroot/agd/server/src/dfuns.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- dfuns.c 18 Mar 2004 20:47:36 -0000 1.13 +++ dfuns.c 21 Mar 2004 08:52:29 -0000 1.14 @@ -3,6 +3,7 @@ #include "dfuns.h" #include <time.h> #include <errno.h> +#include <netdb.h> /* for gethostbyaddr() */ extern time_t startup_time; /* for uptime() */ extern variable_t *fp, *sp; @@ -53,6 +54,7 @@ return len; } +#if 0 char *do_time(void) { static char buf[512]; @@ -63,6 +65,7 @@ strftime(buf, 512, "%T %d %B %Y", tm); return buf; } +#endif void shout(char *s, object_t *exclude) { @@ -88,8 +91,49 @@ push_void(); } +char *get_ip(object_t *ob) { + if(!ob->iaob) + return NULL; + return inet_ntoa(ob->iaob->conn.addr.sin_addr); +} + +void df_query_ip(void) { + char *s; + s = get_ip(fp->u.ob); + pop_stack(); + push_string(s, ST_STATIC); +} + +void df_query_hostname(void) { + char *s; + struct hostent *he; + + s = get_ip(fp->u.ob); + if(!s) + goto out; + he = gethostbyaddr(s, strlen(s), AF_INET); + if(!he) + goto out; + s = he->h_name; + +out: + pop_stack(); + push_string(s, ST_STATIC); +} + void df_time(void) { - push_string(do_time(), ST_STATIC); + push_int(time(NULL)); +} + +void df_asctime(void) { + time_t t; + char *s; + + t = fp->u.i; + s = ctime(&t); + s[strlen(s)-1] = '\0'; /* Remove the newline. */ + pop_stack(); + push_string(s, ST_STATIC); } void df_shout(void) { @@ -250,10 +294,3 @@ push_string(s, ST_MALLOC); } -/* Debugging. */ -void df_print_objs(void) -{ - print_objs(); - push_void(); -} - |
From: Peep P. <so...@us...> - 2004-03-21 09:01:40
|
Update of /cvsroot/agd/server/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10745 Modified Files: lex.l Log Message: Added k, m, K, M integer constants. Index: lex.l =================================================================== RCS file: /cvsroot/agd/server/src/lex.l,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- lex.l 20 Mar 2004 19:18:42 -0000 1.7 +++ lex.l 21 Mar 2004 08:51:36 -0000 1.8 @@ -251,6 +251,10 @@ "}]" RET(s, "])", L_CLOSE_MAPPING); ":)" RET(s, ":)", L_CLOSE_FUNP); +[0-9]+k yylval.i = atoi(yytext) * 1000; RET(d, yylval.i, L_INTEGER); +[0-9]+m yylval.i = atoi(yytext) * 1000000; RET(d, yylval.i, L_INTEGER); +[0-9]+K yylval.i = atoi(yytext) * 1024; RET(d, yylval.i, L_INTEGER); +[0-9]+M yylval.i = atoi(yytext) * 1048576; RET(d, yylval.i, L_INTEGER); [0-9]+ yylval.i = atoi(yytext); RET(d, yylval.i, L_INTEGER); return RET(s, "return", L_RETURN); if RET(s, "if", L_IF); |