Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Code/BandTest/BandTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static int Ping_Host(unsigned long host_ip, unsigned long my_ip, int times, int
static float Average_Ping(int num_pings, unsigned long *ping_times, bool ignore_low_high);
static float Lowest_Ping(int num_pings, unsigned long *ping_times);
static int Get_Path_To_Server(unsigned long *path, unsigned long my_ip, unsigned long server_ip);
static void Ping_Profile(SOCKADDR_IN *router_addr, unsigned long my_ip);
static void Ping_Profile(struct sockaddr_in *router_addr, unsigned long my_ip);

static bool Set_Registry_Int(const char *name, int value);
static int Get_Registry_Int(const char *name, int def_value);
Expand Down Expand Up @@ -1072,7 +1072,7 @@ unsigned long Upstream_Detect(unsigned long server_ip, unsigned long my_ip, int



void Ping_Profile(SOCKADDR_IN *router_addr, unsigned long my_ip)
void Ping_Profile(struct sockaddr_in *router_addr, unsigned long my_ip)
{
float ping_averages[1000];
unsigned long ping_times[100];
Expand Down
2 changes: 1 addition & 1 deletion Code/Commando/bioevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cBioEvent::Act(void)
// Record his IP address for diagnostic purposes
//
WWASSERT(cNetwork::Get_Server_Rhost(SenderId) != NULL);
SOCKADDR_IN & address = cNetwork::Get_Server_Rhost(SenderId)->Get_Address();
struct sockaddr_in & address = cNetwork::Get_Server_Rhost(SenderId)->Get_Address();
p_player->Set_Ip_Address(address.sin_addr.s_addr);

//
Expand Down
2 changes: 1 addition & 1 deletion Code/Commando/gamedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ void cGameData::Rebalance_Team_Sides(void)
void cGameData::Set_Ip_And_Port(void)
{
/*
SOCKADDR_IN local_address;
struct sockaddr_in local_address;
bool retcode = cNetUtil::Get_Local_Address(&local_address);
WWASSERT(retcode == true);

Expand Down
4 changes: 2 additions & 2 deletions Code/Commando/lanchat.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define LANCHAT_H

#include "win.h"
#include <winsock.h>
#include "network-typedefs.h"

#include "chatshre.h"

Expand Down Expand Up @@ -72,7 +72,7 @@ class cLanChat
void Process_Position_Broadcast(cPacket & packet);

SOCKET Socket;
SOCKADDR_IN LocalAddress;
struct sockaddr_in LocalAddress;
DWORD LastPositionBroadcastTimeMs;
int PositionBroadcastNumber;
ChatLocationEnum CurrentLocation;
Expand Down
4 changes: 2 additions & 2 deletions Code/Commando/natsock.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include "assert.h"
#include "vector.h"

#include <winsock.h>
#include "network-typedefs.h"

#ifndef DebugString
#include "wwdebug.h"
Expand Down Expand Up @@ -231,4 +231,4 @@ class SocketHandlerClass
};


#endif //NATSOCK_H
#endif //NATSOCK_H
4 changes: 2 additions & 2 deletions Code/Commando/natter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ bool WOLNATInterfaceClass::Send_Game_Format_Packet_To(IPAddressClass *address, c

#if (0)
WWDEBUG_SAY(("WOLNATInterface - sendto %s\n", address->As_String()));
int result = sendto(socket_handler->Get_Socket(), full_packet.Get_Data(), full_packet.Get_Compressed_Size_Bytes(), 0, (LPSOCKADDR) &sock_address, sizeof(SOCKADDR_IN));
int result = sendto(socket_handler->Get_Socket(), full_packet.Get_Data(), full_packet.Get_Compressed_Size_Bytes(), 0, (LPSOCKADDR) &sock_address, sizeof(struct sockaddr_in));
if (result == SOCKET_ERROR){
if (LAST_ERROR != WSAEWOULDBLOCK) {
WWDEBUG_SAY(("WOLNATInterface - sendto returned error code %d\n", LAST_ERROR));
Expand Down Expand Up @@ -1379,7 +1379,7 @@ void WOLNATInterfaceClass::Service_Receive_Queue(SocketHandlerClass *socket)
unsigned short port;
int bytes = PacketManager.Get_Packet(socket->Get_Socket(), (unsigned char *)full_packet.Get_Data(), full_packet.Get_Max_Size(), ip_address, port);
if (bytes > 0) {
sockaddr_in *addr_ptr = (LPSOCKADDR_IN) &full_packet.Get_From_Address_Wrapper()->FromAddress;
sockaddr_in *addr_ptr = (struct sockaddr_in*) &full_packet.Get_From_Address_Wrapper()->FromAddress;
memcpy(&addr_ptr->sin_addr.s_addr, ip_address, 4);
addr_ptr->sin_port = port;
}
Expand Down
2 changes: 1 addition & 1 deletion Code/Commando/nicenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "nicenum.h"

#include <winsock.h>
#include "network-typedefs.h"
#include <stdio.h>

#include "wwdebug.h"
Expand Down
2 changes: 1 addition & 1 deletion Code/Commando/pkthandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void cNetwork::Server_Packet_Handler(cPacket & packet, int rhost_id)
if (object != NULL)
{
#ifdef WWDEBUG
//sockaddr_in *actual_from_addr_ptr = (LPSOCKADDR_IN) &packet.Get_From_Address_Wrapper()->FromAddress;
//sockaddr_in *actual_from_addr_ptr = (struct sockaddr_in*) &packet.Get_From_Address_Wrapper()->FromAddress;
//sockaddr_in rhost_addr = PServerConnection->Get_Remote_Host(rhost_id)->Get_Address();
#endif //WWDEBUG

Expand Down
4 changes: 2 additions & 2 deletions Code/SControl/servercontrolsocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "assert.h"
#include "vector.h"

#include <winsock.h>
#include "network-typedefs.h"

#ifndef DebugString
#include "wwdebug.h"
Expand Down Expand Up @@ -209,4 +209,4 @@ class ServerControlSocketClass
};


#endif //SERVERCONTROLSOCKET_H
#endif //SERVERCONTROLSOCKET_H
2 changes: 1 addition & 1 deletion Code/Tests/Bandy/bandy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

#include <winsock.h>
#include <winsock2.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
6 changes: 3 additions & 3 deletions Code/Tests/LocalHost/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#include <stdio.h>
#include <conio.h>
#include <winsock.h>
#include <winsock2.h>
#include <assert.h>

//---------------------------------------------------------------------------
Expand All @@ -53,7 +53,7 @@ void main(void)
int rc_ioctl = ::ioctlsocket(sock, FIONBIO, &is_nonblocking);
assert(rc_ioctl == 0);

SOCKADDR_IN local_address;
struct sockaddr_in local_address;
local_address.sin_family = AF_INET;
local_address.sin_addr.s_addr = ::inet_addr("127.0.0.1"); // localhost
local_address.sin_port = ::htons(5555); // arbitrary
Expand Down Expand Up @@ -92,7 +92,7 @@ void main(void)
{
char recv_data[200];
::memset(recv_data, 0, sizeof(recv_data));
SOCKADDR_IN from_address;
struct sockaddr_in from_address;
int from_len = sizeof(from_address);
rc_recv = ::recvfrom(sock, recv_data, sizeof(recv_data), 0,
(LPSOCKADDR) &from_address, &from_len);
Expand Down
4 changes: 2 additions & 2 deletions Code/Tools/RenRem/RenRem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* Functions: *
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */

#include <winsock.h>
#include "network-typedefs.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -287,4 +287,4 @@ int main(int argc, char **argv)

WSACleanup();
return(0);
}
}
2 changes: 1 addition & 1 deletion Code/Tools/RenegadeGR/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#include <string.h>
#include <sys/types.h>
#include <winsock.h>
#include <winsock2.h>
#include "field.h"


Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/RenegadeGR/packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <winsock.h>
#include <winsock2.h>

#include "packet.h"

Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/RenegadeGR/tcpmgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#ifdef _WINDOWS
#include <windows.h>
#include <winsock.h>
#include <winsock2.h>
#include <io.h>

#else //UNIX
Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/RenegadeGR/wtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ wtime Neal Kettler
#include <sys/time.h>
#else
#include <sys/timeb.h>
#include <winsock.h>
#include <winsock2.h>
#endif

#include <time.h>
Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/wlib/wtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ wtime Neal Kettler
#include <sys/time.h>
#else
#include <sys/timeb.h>
#include <winsock.h>
#include <winsock2.h>
#endif

#include <time.h>
Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/wlib/xtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function :-)
#include <sys/time.h>
#else
#include <sys/timeb.h>
#include <winsock.h>
#include <winsock2.h>
#endif

#include <time.h>
Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/wnet/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TCP Neal Kettler neal@westwood.com

#ifdef _WINDOWS

#include <winsock.h>
#include <winsock2.h>
#include <io.h>
#define close _close
#define read _read
Expand Down
2 changes: 1 addition & 1 deletion Code/Tools/wnet/udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <string.h>

#ifdef _WINDOWS
#include <winsock.h>
#include <winsock2.h>
#include <io.h>
#define close _close
#define read _read
Expand Down
2 changes: 1 addition & 1 deletion Code/WWOnline/GameResField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

// Get rid of the nameless struct/union warning
#pragma warning(disable: 4201)
#include <winsock.h>
#include <winsock2.h>
#pragma warning(default: 4201)

namespace WWOnline {
Expand Down
2 changes: 1 addition & 1 deletion Code/WWOnline/GameResPacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "GameResPacket.h"
#include <assert.h>
#include <string.h>
#include <winsock.h>
#include "network-typedefs.h"
#include <algorithm>

namespace WWOnline {
Expand Down
1 change: 1 addition & 0 deletions Code/wwnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set(WWNET_SRC
singlepl.h
wwpacket.cpp
wwpacket.h
network-typedefs.h
)

# Targets to build.
Expand Down
Loading