*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1343 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-10-10 06:13:20 +00:00
parent 3c2da8973a
commit 35a96d83d3
5 changed files with 11 additions and 5 deletions
+1 -1
View File
@@ -432,7 +432,7 @@ void sendmap(char *mapname)
else mapname = getclientmap();
if(securemapcheck(mapname)) return;
int mapsize;
uchar *mapdata = readmap(mapname, &mapsize);
uchar *mapdata = readmap(path(mapname), &mapsize);
if(!mapdata) return;
ENetPacket *packet = enet_packet_create(NULL, MAXTRANS + mapsize, ENET_PACKET_FLAG_RELIABLE);
ucharbuf p(packet->data, packet->dataLength);
+1 -1
View File
@@ -445,7 +445,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
p.len += mapsize;
break;
}
writemap(text, mapsize, &p.buf[p.len]);
writemap(path(text), mapsize, &p.buf[p.len]);
p.len += mapsize;
changemapserv(text, gamemode);
break;
+1 -1
View File
@@ -479,7 +479,7 @@ COMMAND(updatefrommaster, ARG_NONE);
void writeservercfg()
{
FILE *f = openfile("config/servers.cfg", "w");
FILE *f = openfile(path("config/servers.cfg", true), "w");
if(!f) return;
fprintf(f, "// servers connected to are added here automatically\n\n");
loopvrev(servers) fprintf(f, "addserver %s %d\n", servers[i].name, servers[i].port);
+7 -1
View File
@@ -14,8 +14,14 @@
string homedir = "";
vector<char *> packagedirs;
char *path(char *s)
char *path(char *s, bool copy)
{
if(copy)
{
static string tmp;
s_strcpy(tmp, s);
s = tmp;
}
for(char *t = s; (t = strpbrk(t, "/\\")); *t++ = PATHDIV);
for(char *prevdir = NULL, *curdir = s;;)
{
+1 -1
View File
@@ -466,7 +466,7 @@ inline char *newstring(const char *s, size_t l) { return s_strncpy(newstring(l),
inline char *newstring(const char *s) { return newstring(s, strlen(s)); }
inline char *newstringbuf(const char *s) { return newstring(s, _MAXDEFSTR-1); }
extern char *path(char *s);
extern char *path(char *s, bool copy = false);
extern const char *parentdir(const char *directory);
extern bool fileexists(const char *path, const char *mode);
extern bool createdir(const char *path);