/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include <config.h>
-#include <fcntl.h>
#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include "file.h"
#include "misc.h"
#include "nat.h"
* Also wipe realms and telegrams.
*/
struct natstr *
-nat_reset(struct natstr *natp, natid cnum, enum nat_status stat)
+nat_reset(struct natstr *natp, natid cnum, char *name, char *rep,
+ enum nat_status stat)
{
struct realmstr newrealm;
char buf[1024];
ef_blank(EF_NATION, cnum, natp);
natp->nat_stat = stat;
+ strncpy(natp->nat_cnam, name, sizeof(natp->nat_cnam) - 1);
+ strncpy(natp->nat_pnam, rep, sizeof(natp->nat_pnam) - 1);
+ if (stat == STAT_GOD)
+ natp->nat_money = 123456789;
for (i = 0; i < MAXNOR; i++) {
ef_blank(EF_REALM, i + cnum * MAXNOR, &newrealm);
putrealm(&newrealm);
}
- close(creat(mailbox(buf, cnum),
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP));
+ mailbox_create(mailbox(buf, cnum));
/* FIXME natp->nat_ann = #annos */
natp->nat_level[NAT_HLEV] = start_happiness;
natp->nat_level[NAT_RLEV] = start_research;