Make logging more uniform. Fix copyright year
[umurmur.git] / src / server.c
index ff20f81795b968adbca5b80cf7aa1335b310b74a..05bcba572667643a1aa9124bdfe3d573b9a946a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2010, Martin Johansson <martin@fatbob.nu>
+/* Copyright (C) 2009-2010, Martin Johansson <martin@fatbob.nu>
    Copyright (C) 2005-2010, Thorvald Natvig <thorvald@natvig.com>
 
    All rights reserved.
 #include "conf.h"
 #include "log.h"
 #include "timer.h"
+#include "version.h"
 
 #define LISTEN_SOCK 0
 #define TCP_SOCK 0
 #define UDP_SOCK 1
 
-int udpsock; /* XXX restructure! */
+/* globals */
+int udpsock; 
 bool_t shutdown_server;
 
 void Server_run()
@@ -109,7 +111,8 @@ void Server_run()
        
        Timer_init(&janitorTimer);
        
-       Log_info("uMurmur voicechat server started -- http://code.google.com/p/umurmur/");
+       Log_info("uMurmur version %s protocol version %d.%d.%d -- http://code.google.com/p/umurmur/",
+                        UMURMUR_VERSION, PROTVER_MAJOR, PROTVER_MINOR, PROTVER_PATCH);
 
        /* Main server loop */
        while (!shutdown_server) {
@@ -146,8 +149,8 @@ void Server_run()
                        tcpfd = accept(pollfds[LISTEN_SOCK].fd, (struct sockaddr*)&remote, &addrlen);
                        fcntl(tcpfd, F_SETFL, O_NONBLOCK);
                        setsockopt(tcpfd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
-                       Log_info("Connection from %s port %d\n", inet_ntoa(remote.sin_addr),
-                                        ntohs(remote.sin_port));
+                       Log_debug("Connection from %s port %d\n", inet_ntoa(remote.sin_addr),
+                                         ntohs(remote.sin_port));
                        Client_add(tcpfd, &remote);
                }