diff --git a/source/src/client.cpp b/source/src/client.cpp index d974ca42..69a970b9 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -383,6 +383,20 @@ void gets2c() // get updates from the server // sendmap/getmap commands, should be replaced by more intuitive map downloading +cvector securemaps; + +void clearsecuremaps() { securemaps.deletecontentsa(); } +void securemap(char *map) { if(map) securemaps.add(newstring(map)); } +bool securemapcheck(char *map) +{ + loopv(securemaps) if(!strcmp(securemaps[i], map)) + { + conoutf("\f3map %s is secured, you can not send or overwrite it", map); + return true; + } + return false; +} + void sendmap(char *mapname) { if(*mapname) @@ -391,6 +405,7 @@ void sendmap(char *mapname) changemap(mapname); } mapname = getclientmap(); + if(securemapcheck(mapname)) return; int mapsize; uchar *mapdata = readmap(mapname, &mapsize); if(!mapdata) return; @@ -417,6 +432,7 @@ void sendmap(char *mapname) void getmap() { + if(securemapcheck(getclientmap())) return; ENetPacket *packet = enet_packet_create(NULL, MAXTRANS, ENET_PACKET_FLAG_RELIABLE); ucharbuf p(packet->data, packet->dataLength); putint(p, SV_RECVMAP); @@ -427,4 +443,5 @@ void getmap() COMMAND(sendmap, ARG_1STR); COMMAND(getmap, ARG_NONE); - +COMMAND(clearsecuremaps, ARG_NONE); +COMMAND(securemap, ARG_1STR); diff --git a/source/src/docs.cpp b/source/src/docs.cpp index ef0f1587..c3f2e5f1 100644 --- a/source/src/docs.cpp +++ b/source/src/docs.cpp @@ -41,6 +41,7 @@ struct docsection { char *name; vector idents; + void *menu; }; vector sections; @@ -53,8 +54,8 @@ void adddocsection(char *name) if(!name) return; docsection &s = sections.add(); s.name = newstring(name); + s.menu = addmenu(s.name, NULL, true, renderdocsection); lastsection = &s; - addmenu(s.name, NULL, true, renderdocsection); } void adddocident(char *name, char *desc) @@ -474,14 +475,20 @@ void renderdocsection(void *menu, bool init) static vector msections; msections.setsize(0); - enumerateht(docidents) + loopv(sections) { - msection &s = msections.add(); - s.name = docidents.enumc->key; - s_sprintf(s.cmd)("saycommand [/%s ]", docidents.enumc->key); + if(sections[i].menu != menu) continue; + loopvj(sections[i].idents) + { + docident &id = *sections[i].idents[j]; + msection &s = msections.add(); + s.name = id.name; + s_sprintf(s.cmd)("saycommand [/%s ]", id.name); + } + msections.sort(msectionsort); + loopv(msections) { menumanual(menu, i, msections[i].name, msections[i].cmd); } + return; } - msections.sort(msectionsort); - loopv(msections) { menumanual(menu, i, msections[i].name, msections[i].cmd); } } struct maction { string cmd; }; diff --git a/source/src/main.cpp b/source/src/main.cpp index 1f288308..7b947fda 100644 --- a/source/src/main.cpp +++ b/source/src/main.cpp @@ -232,7 +232,7 @@ int main(int argc, char **argv) VIRTW = scr_w*VIRTH/scr_h; initlog("video: misc"); - SDL_WM_SetCaption("ActionCube", NULL); + SDL_WM_SetCaption("AssaultCube", NULL); #ifndef WIN32 if(fs) #endif @@ -244,7 +244,7 @@ int main(int argc, char **argv) gl_init(scr_w, scr_h, bpp, depth, fsaa); crosshair = textureload("packages/misc/crosshairs/default.png"); - if(!crosshair) fatal("could not find core textures (hint: run ActionCube from the parent of the bin directory)"); + if(!crosshair) fatal("could not find core textures (hint: run AssaultCube from the parent of the bin directory)"); loadingscreen(); @@ -268,6 +268,7 @@ int main(int argc, char **argv) exec("config/menus.cfg"); exec("config/prefabs.cfg"); exec("config/sounds.cfg"); + exec("config/securemaps.cfg"); execfile("config/servers.cfg"); persistidents = true; diff --git a/source/src/serverms.cpp b/source/src/serverms.cpp index 5d29225b..5c6fd176 100644 --- a/source/src/serverms.cpp +++ b/source/src/serverms.cpp @@ -78,8 +78,8 @@ void updatemasterserver(int seconds) if(seconds>updmaster) // send alive signal to masterserver every hour of uptime { s_sprintfd(path)("%sregister.do?action=add", masterpath); - s_sprintfd(agent)("ActionCube Server %d", AC_VERSION); - httpgetsend(masterserver, masterbase, path, "actioncubeserver", agent); + s_sprintfd(agent)("AssaultCube Server %d", AC_VERSION); + httpgetsend(masterserver, masterbase, path, "assaultcubeserver", agent); masterrep[0] = 0; masterb.data = masterrep; masterb.dataLength = MAXTRANS-1; @@ -97,8 +97,8 @@ void checkmasterreply() uchar *retrieveservers(uchar *buf, int buflen) { s_sprintfd(path)("%sretrieve.do?item=list", masterpath); - s_sprintfd(agent)("ActionCube Client %d", AC_VERSION); - httpgetsend(masterserver, masterbase, path, "actioncubeclient", agent); + s_sprintfd(agent)("AssaultCube Client %d", AC_VERSION); + httpgetsend(masterserver, masterbase, path, "assaultcubeclient", agent); ENetBuffer eb; buf[0] = 0; eb.data = buf;