]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/filetable.c
Update copyright notice
[empserver] / src / lib / common / filetable.c
index cc802afd3f51e5d2dff8cc97b192acd8a4075493..fd9fd39e423449bde15d47c78079e36222444c2c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -34,6 +34,7 @@
 
 #include <assert.h>
 #include <stddef.h>
+#include <string.h>
 #include "commodity.h"
 #include "game.h"
 #include "land.h"
@@ -58,6 +59,7 @@ static void pln_oninit(void *);
 static void lnd_oninit(void *);
 static void nuk_oninit(void *);
 static void nat_oninit(void *);
+static void contact_oninit(void *);
 static void realm_oninit(void *);
 static void game_oninit(void *);
 static void pchr_oninit(void *);
@@ -163,6 +165,15 @@ struct empfile empfile[] = {
     {EF_NATION, "nat", "nation", "nation", nat_ca, EF_BAD,
      UNMAPPED_CACHE(struct natstr, MAXNOC, EFF_TYPED | EFF_OWNER),
      nat_oninit, NULL, NULL, NULL},
+    {EF_RELAT, "relat", NULL, "relat", relat_ca, EF_BAD,
+     UNMAPPED_CACHE(struct relatstr, MAXNOC, EFF_TYPED),
+     NULL, NULL, NULL, NULL},
+    {EF_CONTACT, "contact", NULL, "contact", contact_ca, EF_BAD,
+     UNMAPPED_CACHE(struct contactstr, MAXNOC, EFF_TYPED),
+     contact_oninit, NULL, NULL, NULL},
+    {EF_REJECT, "reject", NULL, "reject", reject_ca, EF_BAD,
+     UNMAPPED_CACHE(struct rejectstr, MAXNOC, EFF_TYPED),
+     NULL, NULL, NULL, NULL},
     {EF_LOAN, "loan", NULL, "loan", loan_ca, EF_BAD,
      UNMAPPED_CACHE(struct lonstr, -1, EFF_TYPED),
      NULL, NULL, NULL, NULL},
@@ -319,6 +330,17 @@ nat_oninit(void *ptr)
     np->nat_cnum = np->nat_uid;
 }
 
+static void
+contact_oninit(void *ptr)
+{
+    struct contactstr *cp = ptr;
+
+    if (opt_HIDDEN)
+       cp->con_contact[cp->con_uid] = 1;
+    else
+       memset(cp->con_contact, 1, sizeof(cp->con_contact));
+}
+
 static void
 realm_oninit(void *ptr)
 {