diff --git a/apps/openmw-mp/Networking.cpp b/apps/openmw-mp/Networking.cpp index ed5506820..67c63865f 100644 --- a/apps/openmw-mp/Networking.cpp +++ b/apps/openmw-mp/Networking.cpp @@ -47,7 +47,6 @@ Networking::~Networking() void Networking::Update(RakNet::Packet *packet) { - Player *player = Players::GetPlayer(packet->guid); RakNet::BitStream bsIn(&packet->data[1], packet->length, false); @@ -73,7 +72,6 @@ void Networking::Update(RakNet::Packet *packet) if (packet->data[0] == ID_HANDSHAKE) { - DEBUG_PRINTF("ID_HANDSHAKE\n"); string passw = "SuperPassword"; myPacket->Read(player); @@ -448,31 +446,37 @@ int Networking::MainLoop() switch (packet->data[0]) { case ID_REMOTE_DISCONNECTION_NOTIFICATION: - printf("Another client has disconnected.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has disconnected", + packet->systemAddress.ToString()); break; case ID_REMOTE_CONNECTION_LOST: - printf("Another client has lost connection.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has lost connection", + packet->systemAddress.ToString()); break; case ID_REMOTE_NEW_INCOMING_CONNECTION: - printf("Another client has connected.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has connected", + packet->systemAddress.ToString()); break; case ID_CONNECTION_REQUEST_ACCEPTED: // client to server { - printf("Our connection request has been accepted.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "Our connection request has been accepted"); break; } case ID_NEW_INCOMING_CONNECTION: - printf("A connection is incoming.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "A connection is incoming from %s", + packet->systemAddress.ToString()); break; case ID_NO_FREE_INCOMING_CONNECTIONS: - printf("The server is full.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "%s", "The server is full"); break; case ID_DISCONNECTION_NOTIFICATION: - printf("A client has disconnected.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has disconnected", + packet->systemAddress.ToString()); DisconnectPlayer(packet->guid); break; case ID_CONNECTION_LOST: - printf("A client has lost connection.\n"); + LOG_MESSAGE_SIMPLE(Log::LOG_WARN, "Client at %s has lost connection", + packet->systemAddress.ToString()); DisconnectPlayer(packet->guid); break; default: diff --git a/components/openmw-mp/Packets/PlayerPacket.cpp b/components/openmw-mp/Packets/PlayerPacket.cpp index 823be9ab7..bebac49b6 100644 --- a/components/openmw-mp/Packets/PlayerPacket.cpp +++ b/components/openmw-mp/Packets/PlayerPacket.cpp @@ -49,10 +49,10 @@ void PlayerPacket::Read(BasePlayer *player) Packet(bsRead, player, false); } -void PlayerPacket::RequestData(RakNet::RakNetGUID player) +void PlayerPacket::RequestData(RakNet::RakNetGUID guid) { bsSend->ResetWritePointer(); bsSend->Write(packetID); bsSend->Write(player); - peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, player, false); + peer->Send(bsSend, HIGH_PRIORITY, RELIABLE_ORDERED, 0, guid, false); }