Rev 1 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1 | Rev 18 | ||
|---|---|---|---|
| Line 1... | Line 1... | ||
| 1 | #include "pd/net.h" |
1 | #include "pd/net.h" |
| 2 | 2 | ||
| 3 | #include " |
3 | #include "brender.h" |
| 4 | #include "dr_types.h" |
4 | #include "dr_types.h" |
| 5 | #include "errors.h" |
5 | #include "errors.h" |
| 6 | #include "globvrpb.h" |
6 | #include "globvrpb.h" |
| 7 | #include "harness/config.h" |
7 | #include "harness/config.h" |
| 8 | #include "harness/hooks.h" |
8 | #include "harness/hooks.h" |
| Line 53... | Line 53... | ||
| 53 | struct sockaddr_in gLast_received_addr; |
53 | struct sockaddr_in gLast_received_addr; |
| 54 | int gSocket; |
54 | int gSocket; |
| 55 | 55 | ||
| 56 | #define MESSAGE_HEADER_STR "CW95MSG" |
56 | #define MESSAGE_HEADER_STR "CW95MSG" |
| 57 | #define JOINABLE_GAMES_CAPACITY 16 |
57 | #define JOINABLE_GAMES_CAPACITY 16 |
| - | 58 | ||
| - | 59 | DR_STATIC_ASSERT(offsetof(tNet_message, pd_stuff_so_DO_NOT_USE) == 0); |
|
| - | 60 | DR_STATIC_ASSERT(offsetof(tNet_message, magic_number) == 4); |
|
| - | 61 | DR_STATIC_ASSERT(offsetof(tNet_message, guarantee_number) == 8); |
|
| - | 62 | DR_STATIC_ASSERT(offsetof(tNet_message, sender) == 12); |
|
| - | 63 | DR_STATIC_ASSERT(offsetof(tNet_message, version) == 16); |
|
| - | 64 | DR_STATIC_ASSERT(offsetof(tNet_message, senders_time_stamp) == 20); |
|
| - | 65 | DR_STATIC_ASSERT(offsetof(tNet_message, num_contents) == 24); |
|
| - | 66 | DR_STATIC_ASSERT(offsetof(tNet_message, overall_size) == 26); |
|
| - | 67 | DR_STATIC_ASSERT(offsetof(tNet_message, contents) == 28); |
|
| 58 | 68 | ||
| 59 | // IDA: void __cdecl ClearupPDNetworkStuff() |
69 | // IDA: void __cdecl ClearupPDNetworkStuff() |
| 60 | void ClearupPDNetworkStuff(void) { |
70 | void ClearupPDNetworkStuff(void) { |
| 61 | LOG_TRACE("()"); |
71 | LOG_TRACE("()"); |
| 62 | NOT_IMPLEMENTED(); |
72 | NOT_IMPLEMENTED(); |
| Line 638... | Line 648... | ||
| 638 | int PDNetSendMessageToAddress(tNet_game_details* pDetails, tNet_message* pMessage, void* pAddress) { |
648 | int PDNetSendMessageToAddress(tNet_game_details* pDetails, tNet_message* pMessage, void* pAddress) { |
| 639 | char str[256]; |
649 | char str[256]; |
| 640 | LOG_TRACE("(%p, %p, %p)", pDetails, pMessage, pAddress); |
650 | LOG_TRACE("(%p, %p, %p)", pDetails, pMessage, pAddress); |
| 641 | 651 | ||
| 642 | NetNowIPXLocalTarget2String(str, (struct sockaddr_in*)pAddress); |
652 | NetNowIPXLocalTarget2String(str, (struct sockaddr_in*)pAddress); |
| 643 | if (pDetails->pd_net_info.addr_in.sin_port == 0) { |
- | |
| 644 | int i = 0; |
- | |
| 645 | } |
- | |
| 646 | 653 | ||
| 647 | if (sendto(gSocket, (const char*)pMessage, pMessage->overall_size, 0, (const struct sockaddr*)pAddress, sizeof(struct sockaddr)) == -1) { |
654 | if (sendto(gSocket, (const char*)pMessage, pMessage->overall_size, 0, (const struct sockaddr*)pAddress, sizeof(struct sockaddr)) == -1) { |
| 648 | dr_dprintf("PDNetSendMessageToAddress(): Error on sendto() - WSAGetLastError=%d", WSAGetLastError()); |
655 | dr_dprintf("PDNetSendMessageToAddress(): Error on sendto() - WSAGetLastError=%d", WSAGetLastError()); |
| 649 | NetDisposeMessage(pDetails, pMessage); |
656 | NetDisposeMessage(pDetails, pMessage); |
| 650 | return 1; |
657 | return 1; |