sendmap with map config files, script contexts (~sandbox)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1471 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2007-12-22 23:39:30 +00:00
parent c3a95a3879
commit 7fa0a75765
12 changed files with 202 additions and 93 deletions
+6 -2
View File
@@ -638,18 +638,22 @@ void receivefile(uchar *data, int len)
getstring(text, p);
conoutf("received map \"%s\" from server, reloading..", &text);
int mapsize = getint(p);
if(p.remaining() < mapsize)
int cfgsize = getint(p);
int size = mapsize + cfgsize;
if(p.remaining() < size)
{
p.forceoverread();
break;
}
if(securemapcheck(text))
{
p.len += mapsize;
p.len += size;
break;
}
writemap(path(text), mapsize, &p.buf[p.len]);
p.len += mapsize;
writecfg(path(text), cfgsize, &p.buf[p.len]);
p.len += cfgsize;
changemapserv(text, gamemode);
break;
}