timer.c messagehandler.c channel.c Mumble.pb-c.c voicetarget.c
OBJS:=$(patsubst %.c, %.o, $(SRCS))
-#CFLAGS:=$(CFLAGS) -I. -I/data/export/proj/openssl/include/ -Wall -g -DDEBUG
+CFLAGS:=$(CFLAGS) -I. -I/data/export/proj/openssl/include/ -Wall -g -DDEBUG
#LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl -lconfig
CFLAGS:=$(CFLAGS) -I. -Wall -g
LDFLAGS:=$(LDFLAGS) -lcrypto -lssl -lconfig
-/* 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.
-/* 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.
-/* 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.
if (Timer_isElapsed(&c->lastActivity, 1000000LL * INACTICITY_TIMEOUT)) {
/* No activity from client - assume it is lost and close. */
- Log_info("Session ID %d timeout - closing", c->sessionId);
+ Log_info("Timeout, closing session %d - %s@%s:%d",
+ c->sessionId,
+ c->playerName,
+ inet_ntoa(c->remote_tcp.sin_addr),
+ ntohs(c->remote_tcp.sin_port));
Client_free(c);
}
}
struct dlist *itr, *save;
message_t *sendmsg;
- Log_info("Disconnect client ID %d addr %s port %d", client->sessionId,
+ Log_info("Disconnect session %d - %s@%s:%d",
+ client->sessionId,
+ client->playerName,
inet_ntoa(client->remote_tcp.sin_addr),
ntohs(client->remote_tcp.sin_port));
/* Hmm. This is where we end up when the client closes its connection.
* Kind of strange...
*/
- Log_info("Connection closed by peer");
+ Log_info("Connection closed by peer. Session %d - %s@%s:%d",
+ client->sessionId,
+ client->playerName,
+ inet_ntoa(client->remote_tcp.sin_addr),
+ ntohs(client->remote_tcp.sin_port));
}
else {
Log_warn("SSL error: %d - Closing connection.", SSL_get_error(client->ssl, rc));
Timer_restart(&client->cryptState.tLastRequest);
sendmsg = Msg_create(CryptSetup);
- Log_info("Requesting voice channel crypt resync");
+ Log_info("Requesting voice channel crypt resync. Session %d - %s@%s:%d",
+ client->sessionId,
+ client->playerName,
+ inet_ntoa(client->remote_tcp.sin_addr),
+ ntohs(client->remote_tcp.sin_port));
+
Client_send_message(client, sendmsg);
}
}
if (itr->remote_tcp.sin_addr.s_addr == from.sin_addr.s_addr) {
if (checkDecrypt(itr, encrypted, buffer, len)) {
itr->key = key;
- Log_info("New UDP connection from %s port %d sessionId %d", inet_ntoa(from.sin_addr), ntohs(from.sin_port), itr->sessionId);
+ Log_info("New UDP connection from session %d - %s@%s:%d",
+ itr->sessionId,
+ itr->playerName,
+ inet_ntoa(from.sin_addr),
+ ntohs(from.sin_port));
memcpy(&itr->remote_udp, &from, sizeof(struct sockaddr_in));
break;
}
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
msg->payload.reject->type = type;
msg->payload.reject->has_type = true;
Client_send_message(client, msg);
+
+ Log_info("Server reject reason: %s. Disconnecting session %d - %s@%s:%d",
+ reason,
+ client->sessionId,
+ client->playerName,
+ inet_ntoa(client->remote_tcp.sin_addr),
+ ntohs(client->remote_tcp.sin_port));
+
}
static void sendPermissionDenied(client_t *client, const char *reason)
sendmsg->payload.userState->has_channel_id = true;
sendmsg->payload.userState->channel_id = ((channel_t *)client_itr->channel)->id;
- /* XXX - check if self_* is correct */
+ /* Only self_mute/deaf supported */
if (client_itr->deaf) {
sendmsg->payload.userState->has_self_deaf = true;
sendmsg->payload.userState->self_deaf = true;
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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()
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) {
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);
}
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* 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.
-/* Copyright (C) 2009, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-2009, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2010, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-2010, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.
-/* Copyright (C) 2009, Martin Johansson <martin@fatbob.nu>
- Copyright (C) 2005-2009, Thorvald Natvig <thorvald@natvig.com>
+/* Copyright (C) 2009-2010, Martin Johansson <martin@fatbob.nu>
+ Copyright (C) 2005-2010, Thorvald Natvig <thorvald@natvig.com>
All rights reserved.