Vanilla Development Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS update: Vanilla/ntserv
Date: Monday March 6, 2000 @ 20:18
Author: cameron
Update of /home/netrek/cvsroot/Vanilla/ntserv
In directory swashbuckler.fortress.real-time.com:/var/tmp/cvs-serv11578/ntserv
Modified Files:
socket.c
Log Message:
god.LOG changes
****************************************
Index: Vanilla/ntserv/socket.c
diff -u Vanilla/ntserv/socket.c:1.20 Vanilla/ntserv/socket.c:1.21
--- Vanilla/ntserv/socket.c:1.20 Wed Feb 23 21:50:13 2000
+++ Vanilla/ntserv/socket.c Mon Mar 6 20:18:11 2000
@@ -1,4 +1,4 @@
-/* $Id: socket.c,v 1.20 2000/02/24 03:50:13 xyzzy Exp $
+/* $Id: socket.c,v 1.21 2000/03/07 02:18:11 cameron Exp $
*/
/*
@@ -34,6 +34,7 @@
#include "packets.h"
#include "proto.h"
#include "ltd_stats.h"
+#include "gnorm.h"
#ifdef OOPS
#ifdef MIPSEL
@@ -1403,8 +1404,8 @@
if (target<0 || target>=MAXPLAYER || target==me->p_no) return;
player= &players[target];
if (player->p_flags & PFCLOAK) return;
- if (hypot((double) me->p_x-player->p_x,
- (double) me->p_y-player->p_y) <
+ if (hypot((double) gnorm_offset(me->p_x, player->p_x),
+ (double) gnorm_offset(me->p_y, player->p_y)) <
((double) TRACTDIST) * me->p_ship.s_tractrng) {
if (player->p_flags & PFDOCK) {
players[player->p_docked].p_port[player->p_port[0]] = VACANT;
@@ -1444,8 +1445,8 @@
if (target<0 || target>=MAXPLAYER || target==me->p_no) return;
player= &players[target];
if (player->p_flags & PFCLOAK) return;
- if (hypot((double) me->p_x-player->p_x,
- (double) me->p_y-player->p_y) <
+ if (hypot((double) gnorm_offset(me->p_x, player->p_x),
+ (double) gnorm_offset(me->p_y, player->p_y)) <
((double) TRACTDIST) * me->p_ship.s_tractrng) {
if (player->p_flags & PFDOCK) {
players[player->p_docked].p_port[player->p_port[0]] = VACANT;
@@ -2808,26 +2809,27 @@
static int check_mesgs(struct mesg_cpacket *packet)
{
- static char buf[256];
- static char addrb[10];
/*
* if 'logall' log message
* if 'loggod' log messages to god or messages preceeded by "god:" ("GOD:")
*/
if(logall| loggod){
- time_t t = time(NULL);
- char tbuf[40];
+ char tbuf[40];
+ char buf[1024];
+ char addrb[10];
+
+ time_t t = time(NULL);
struct tm *tmv = localtime(&t);
#ifdef STRFTIME
sprintf(tbuf, "%02d/%02d %d/%d", tmv->tm_hour,tmv->tm_min,
tmv->tm_mday,tmv->tm_mon);
#else
- strftime(tbuf, 39, "%R %D", tmv);
+ strftime(tbuf, 40, "%Y-%m-%d %T", tmv);
#endif
- sprintf(buf, "%s %s@%s \"%s\"", tbuf, me->p_login, me->p_monitor,
- packet->mesg);
+ sprintf(buf, "%s %s@%s %s \"%s\"", tbuf, me->p_login, me->p_longname,
+ me->p_full_hostname, packet->mesg);
if(logall){
if(!mlog) {
ERROR(1,( "ntserv: ERROR, null mlog file descriptor\n"));
@@ -2853,17 +2855,26 @@
switch (counter) {
case 1:
pmessage(me->p_no, MINDIV, addrb,
- "Noted. Thank you, %s, for your comments.",
+ "Noted. Thank you. "
+ "Send your email address for a reply?",
me->p_login);
+ pmessage(me->p_no, MINDIV, addrb,
+ "You can also send to ALL with a prefix of 'GOD:'");
break;
case 2:
pmessage(me->p_no, MINDIV, addrb,
- "Please leave your return email address too!");
+ "Say as much as you like, I'm writing it all down.");
break;
case 3:
+ pmessage(me->p_no, MINDIV, addrb,
+ "Got that down, anything else?");
+ break;
+ case 6:
+ pmessage(me->p_no, MINDIV, addrb,
+ "Woohoo, a treatise, He'll love it. See MOTD for mail addresses.");
break;
default:
- pmessage(me->p_no, MINDIV, addrb, "Your message has been logged.");
+ pmessage(me->p_no, MINDIV, addrb, "Noted.");
}
}
}