diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ea46e7c65..3af3bdf44 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -38,6 +38,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "osd.h" #include "osdfuncs.h" #include "osdcmds.h" +#include "scriptfile.h" //#include "crc32.h" @@ -7461,6 +7462,82 @@ void comlinehelp(char **argv) wm_msgbox(apptitle,s); } +enum { + T_EOF = -2, + T_ERROR = -1, + T_INTERFACE = 0, + T_MODE, + T_ALLOW +}; + +signed int rancid_players = 0; +char rancid_ips[MAXPLAYERS][16]; + +typedef struct { char *text; int tokenid; } tokenlist; +static tokenlist basetokens[] = + { + { "interface", T_INTERFACE }, + { "mode", T_MODE }, + { "allow", T_ALLOW }, + }; + +static int getatoken(scriptfile *sf, tokenlist *tl, int ntokens) +{ + char *tok; + int i; + + if (!sf) return T_ERROR; + tok = scriptfile_gettoken(sf); + if (!tok) return T_EOF; + + for(i=0;iltextptr; + switch (tokn) { + case T_INTERFACE: + case T_ALLOW: + { + char *ip; + if (scriptfile_getstring(script,&ip)) break; + Bstrcpy(rancid_ips[rancid_players++],ip); + } + break; + case T_EOF: + return(0); + default: + break; + } + } + return 0; +} + +int loadrancidnet(char *fn) +{ + scriptfile *script; + + script = scriptfile_fromfile(fn); + if (!script) return -1; + + parserancidnet(script); + + scriptfile_close(script); + scriptfile_clearsymbols(); + + return 0; +} + void checkcommandline(int argc,char **argv) { short i, j; @@ -7495,6 +7572,20 @@ void checkcommandline(int argc,char **argv) c = argv[i]; if (((*c == '/') || (*c == '-')) && (!firstnet)) { + if (!Bstrcasecmp(c+1,"rmnet")) { + if (argc > i+1) { + CommandName = argv[i+1]; + i++; + } + if(CommandName) { + loadrancidnet(CommandName); + for(j=0;jaim_mode) - myhoriz += syn->horz/2; + myhoriz += syn->horz>>1; else { if( myhoriz > 95 && myhoriz < 105) myhoriz = 100; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 4dffeee85..f987ae7a2 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2833,6 +2833,7 @@ void getinput(short snum) else horiz = (info.dz+lastinfo.dz)/(314-128); lastinfo.dz = (lastinfo.dz+info.dz) % (314-128); + if(horiz <= 0) horiz++; info.dz = 0; } else { lastinfo.dz = info.dz % (1<<6); @@ -4388,7 +4389,7 @@ HORIZONLY: } if(p->aim_mode) - p->horiz += sync[snum].horz/2; + p->horiz += sync[snum].horz>>1; else { if( p->horiz > 95 && p->horiz < 105) p->horiz = 100; diff --git a/polymer/eduke32/source/wrapper.c b/polymer/eduke32/source/wrapper.c new file mode 100755 index 000000000..5f3f2c479 --- /dev/null +++ b/polymer/eduke32/source/wrapper.c @@ -0,0 +1,60 @@ +// this is a wrapper to launch EDuke32 properly from Dukester X +// gcc -o duke3d_w32.exe wrapper.c + +#include +#include + +#define ISWS(x) ((x == ' ') || (x == '\t') || (x == '\r') || (x == '\n')) + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) +{ + int i,j; + LPTSTR szCmdLine; + + char CmdLine[1024]; + char sCmdLine[1024]; + char szFileName[255]; + + FILE * fp=fopen("wrapper.log","w"); + STARTUPINFO si; + PROCESS_INFORMATION pi; + + for(i=0;i