Updated for the new version of SpaceToss
This commit is contained in:
parent
24e164dfc8
commit
8a72d0da3e
@ -13,8 +13,10 @@ ______________________________________________________________________
|
|||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
+ Added support for SpaceToss areafile. WARNING: there's no known way
|
+ Added support for SpaceToss areafile. WARNING: there's no known way
|
||||||
to obtain primary AKA for echo areas from tosser config so you'll
|
to obtain primary AKA for echo areas from tosser config ver 1.10 so
|
||||||
need to define them manually. Main AKA will be used by default.
|
you'll need to define them manually. Main AKA will be used by
|
||||||
|
default. On newer versions (with UseAKA support) you should not
|
||||||
|
expirience this problem.
|
||||||
|
|
||||||
- Thanks to Pavel Tsekov few more memory leaks was eliminated.
|
- Thanks to Pavel Tsekov few more memory leaks was eliminated.
|
||||||
|
|
||||||
|
@ -79,7 +79,9 @@
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
static bool __vcurhidden = false;
|
static bool __vcurhidden = false;
|
||||||
|
#if defined(__UNIX__) || defined(__USE_NCURSES__)
|
||||||
static unsigned long gvid_boxcvtc(char);
|
static unsigned long gvid_boxcvtc(char);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(__USE_NCURSES__)
|
#if !defined(__USE_NCURSES__)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// $Id$
|
// $Id$
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
// Read areas from SpaceToss 1.10
|
// Read areas from SpaceToss 1.10 and higher
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@ -31,6 +31,8 @@
|
|||||||
#undef GCFG_NOSPCT
|
#undef GCFG_NOSPCT
|
||||||
#include <gedacfg.h>
|
#include <gedacfg.h>
|
||||||
|
|
||||||
|
static Path SpaceTossAreafile;
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
@ -38,12 +40,17 @@ void gareafile::ParseSpaceArea(const char *type_path, AreaCfg &aa) {
|
|||||||
|
|
||||||
if(strnieql(type_path, "msg", 3))
|
if(strnieql(type_path, "msg", 3))
|
||||||
aa.msgbase = fidomsgtype;
|
aa.msgbase = fidomsgtype;
|
||||||
else if(strnieql(type_path, "hud", 3))
|
else if(strnieql(type_path, "hud", 3)) {
|
||||||
aa.msgbase = GMB_HUDSON;
|
aa.msgbase = GMB_HUDSON;
|
||||||
|
aa.board = atoi(type_path+3);
|
||||||
|
return;
|
||||||
|
}
|
||||||
else if(strnieql(type_path, "jam", 3))
|
else if(strnieql(type_path, "jam", 3))
|
||||||
aa.msgbase = GMB_JAM;
|
aa.msgbase = GMB_JAM;
|
||||||
else if(strnieql(type_path, "sqh", 3))
|
else if(strnieql(type_path, "sqh", 3))
|
||||||
aa.msgbase = GMB_SQUISH;
|
aa.msgbase = GMB_SQUISH;
|
||||||
|
else if(strnieql(type_path, "smb", 3))
|
||||||
|
aa.msgbase = GMB_SMB;
|
||||||
else {
|
else {
|
||||||
aa.msgbase = 0;
|
aa.msgbase = 0;
|
||||||
return;
|
return;
|
||||||
@ -62,6 +69,8 @@ void gareafile::ReadSpaceAr(const char* file) {
|
|||||||
const word CRC_PATH = 0x0212;
|
const word CRC_PATH = 0x0212;
|
||||||
const word CRC_FLAGS = 0xF81A;
|
const word CRC_FLAGS = 0xF81A;
|
||||||
const word CRC_GROUP = 0x1C9B;
|
const word CRC_GROUP = 0x1C9B;
|
||||||
|
const word CRC_TYPE = 0x59E2;
|
||||||
|
const word CRC_USEAKA = 0x2F7D;
|
||||||
const word CRC_ENDAREA = 0x3E9F;
|
const word CRC_ENDAREA = 0x3E9F;
|
||||||
|
|
||||||
FILE* fp = fsopen(file, "rb", sharemode);
|
FILE* fp = fsopen(file, "rb", sharemode);
|
||||||
@ -95,12 +104,40 @@ void gareafile::ReadSpaceAr(const char* file) {
|
|||||||
case CRC_PATH:
|
case CRC_PATH:
|
||||||
ParseSpaceArea(val, aa);
|
ParseSpaceArea(val, aa);
|
||||||
break;
|
break;
|
||||||
|
case CRC_USEAKA:
|
||||||
|
aa.aka.set(val);
|
||||||
|
break;
|
||||||
case CRC_FLAGS:
|
case CRC_FLAGS:
|
||||||
if(strpbrk(val,"Ll")) {
|
if(strpbrk(val,"Ll")) {
|
||||||
aa.type = GMB_LOCAL;
|
aa.type = GMB_LOCAL;
|
||||||
aa.attr = attribslocal;
|
aa.attr = attribslocal;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CRC_TYPE: {
|
||||||
|
const word CRC_ECHO = 0xC2D1;
|
||||||
|
const word CRC_NET = 0xEC5E;
|
||||||
|
const word CRC_LOCAL = 0x4CD5;
|
||||||
|
const word CRC_DUPE = 0x9B1D;
|
||||||
|
const word CRC_BAD = 0x29C2;
|
||||||
|
|
||||||
|
switch(getkeyvalcrc(&key, &val)) {
|
||||||
|
case CRC_ECHO:
|
||||||
|
aa.type = GMB_ECHO;
|
||||||
|
aa.attr = attribsecho;
|
||||||
|
break;
|
||||||
|
case CRC_NET:
|
||||||
|
aa.type = GMB_NET;
|
||||||
|
aa.attr = attribsnet;
|
||||||
|
break;
|
||||||
|
case CRC_LOCAL:
|
||||||
|
case CRC_DUPE:
|
||||||
|
case CRC_BAD:
|
||||||
|
aa.type = GMB_LOCAL;
|
||||||
|
aa.attr = attribslocal;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CRC_GROUP:
|
case CRC_GROUP:
|
||||||
aa.groupid = toupper(*val);
|
aa.groupid = toupper(*val);
|
||||||
break;
|
break;
|
||||||
@ -189,6 +226,9 @@ void gareafile::ReadSpaceCtl(const char* file) {
|
|||||||
const word CRC_NETMAIL = 0xE42E;
|
const word CRC_NETMAIL = 0xE42E;
|
||||||
const word CRC_BADMAIL = 0xE697;
|
const word CRC_BADMAIL = 0xE697;
|
||||||
const word CRC_DUPEMAIL = 0xB38B;
|
const word CRC_DUPEMAIL = 0xB38B;
|
||||||
|
const word CRC_HUDSONPATH = 0x52A7;
|
||||||
|
const word CRC_EXPORTLISTS = 0xB709;
|
||||||
|
const word CRC_AREAFILE = 0xB487;
|
||||||
|
|
||||||
FILE* fp = fsopen(file, "rb", sharemode);
|
FILE* fp = fsopen(file, "rb", sharemode);
|
||||||
if(fp) {
|
if(fp) {
|
||||||
@ -231,6 +271,15 @@ void gareafile::ReadSpaceCtl(const char* file) {
|
|||||||
aa.type = GMB_LOCAL;
|
aa.type = GMB_LOCAL;
|
||||||
aa.attr = attribslocal;
|
aa.attr = attribslocal;
|
||||||
break;
|
break;
|
||||||
|
case CRC_HUDSONPATH:
|
||||||
|
CfgHudsonpath(val);
|
||||||
|
break;
|
||||||
|
case CRC_EXPORTLISTS:
|
||||||
|
CfgJampath(val);
|
||||||
|
break;
|
||||||
|
case CRC_AREAFILE:
|
||||||
|
strxcpy(SpaceTossAreafile, val, sizeof(SpaceTossAreafile));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(aa.type != 0xFF) {
|
if(aa.type != 0xFF) {
|
||||||
@ -274,11 +323,13 @@ void gareafile::ReadSpaceToss(char* tag) {
|
|||||||
|
|
||||||
CfgSquishuserpath(path);
|
CfgSquishuserpath(path);
|
||||||
|
|
||||||
|
strcpy(SpaceTossAreafile, "spctoss.ar");
|
||||||
|
|
||||||
MakePathname(file, path, "spctoss.ctl");
|
MakePathname(file, path, "spctoss.ctl");
|
||||||
ReadSpaceCtl(file);
|
ReadSpaceCtl(file);
|
||||||
MakePathname(file, path, "spctoss.ntm");
|
MakePathname(file, path, "spctoss.ntm");
|
||||||
ReadSpaceNtm(file);
|
ReadSpaceNtm(file);
|
||||||
MakePathname(file, path, "spctoss.ar");
|
MakePathname(file, path, SpaceTossAreafile);
|
||||||
ReadSpaceAr(file);
|
ReadSpaceAr(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user