]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Commit bugs are finally all fixed now :)
authorBrian Bosak <webadm@elcnet.servehttp.com>
Mon, 12 Aug 2013 22:27:36 +0000 (17:27 -0500)
committerBrian Bosak <webadm@elcnet.servehttp.com>
Mon, 12 Aug 2013 22:27:36 +0000 (17:27 -0500)
console.c
lhnet.c
lhnet.h

index 6fd92ea02873165988c8c4a1ec4ba338ed9f75f4..983786d12a119611e3cfe76af3f748cedd3ff3a2 100644 (file)
--- a/console.c
+++ b/console.c
@@ -606,10 +606,8 @@ static void Con_MessageMode_f (void)
        chat_mode = 0; // "say"
        if(Cmd_Argc() > 1)
        {
-
                dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args());
                chat_bufferlen = strlen(chat_buffer);
-
        }
 }
 
@@ -2090,17 +2088,6 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer
                                dpsnprintf(desc, sizeof(desc), "BSP2");
                        }
                        else if (!memcmp(buf, "2PSB", 4))
-                       {
-                               lumpofs = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES);
-                               lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
-                       }
-                       else if (!memcmp(buf, "BSP2", 4))
-                       {
-                               lumpofs = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES);
-                               lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
-                               dpsnprintf(desc, sizeof(desc), "BSP2");
-                       }
-                       else if (!memcmp(buf, "2PSB", 4))
                        {
                                lumpofs = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES);
                                lumplen = BuffLittleLong(buf + 4 + 8 * LUMP_ENTITIES + 4);
diff --git a/lhnet.c b/lhnet.c
index 28ce4fc95e2aca5892e0ebf0e5d68d8ff6755db8..fe2d6733e4571f07fd4f9a27fb05d621acf91f37 100644 (file)
--- a/lhnet.c
+++ b/lhnet.c
@@ -873,11 +873,10 @@ static int LHNETSOCKET_TryBind(lhnetsocket_t *lhnetsocket, lhnetaddress_t *addre
 {
        SOCKLEN_T namelen;
        int bindresult;
-       lhnetaddressnative_t *localaddress;
        if (!address)
                return 0;
        lhnetsocket->address = *address;
-       localaddress = (lhnetaddressnative_t *)&lhnetsocket->address;
+       lhnetaddressnative_t *localaddress = (lhnetaddressnative_t *)&lhnetsocket->address;
 #ifdef SUPPORTIPV6
        if (address->addresstype == LHNETADDRESSTYPE_INET6)
        {
@@ -901,10 +900,9 @@ static int LHNETSOCKET_TryConnect(lhnetsocket_t *lhnetsocket, lhnetaddress_t *ad
 {
        SOCKLEN_T namelen;
        int connectresult;
-       lhnetaddressnative_t *peeraddress;
        if (!address)
                return 0;
-       peeraddress = (lhnetaddressnative_t *)&lhnetsocket->address;
+       lhnetaddressnative_t *peeraddress = (lhnetaddressnative_t *)&lhnetsocket->address;
 #ifdef SUPPORTIPV6
        if (address->addresstype == LHNETADDRESSTYPE_INET6)
        {
@@ -927,11 +925,10 @@ static int LHNETSOCKET_TryConnect(lhnetsocket_t *lhnetsocket, lhnetaddress_t *ad
 lhnetsocket_t *LHNET_OpenSocket(lhnetaddress_t *address, lhnetaddress_t *peeraddress, int use_tcp, int use_blocking, int register_for_select)
 {
        lhnetsocket_t *lhnetsocket, *s;
-       int addresstype;
        if (!address && !peeraddress)
                return NULL;
 
-       addresstype = address ? address->addresstype : peeraddress->addresstype;
+       int addresstype = address ? address->addresstype : peeraddress->addresstype;
        if (peeraddress && addresstype != peeraddress->addresstype)
        {
                Con_Printf("Cannot connect different address types.\n");
@@ -1049,21 +1046,6 @@ lhnetsocket_t *LHNET_OpenSocket(lhnetaddress_t *address, lhnetaddress_t *peeradd
 #if defined(SOL_RFC1149) && defined(RFC1149_1149ONLY)
                                                        // we got reports of massive lags when this protocol was chosen as transport
                                                        // so better turn it off
-<<<<<<< HEAD
-                                                       {
-                                                               int rfc1149only = 0;
-                                                               int rfc1149enabled = 0;
-                                                               if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_1149ONLY, &rfc1149only))
-                                                                       Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_1149ONLY) returned error: %s\n", LHNETPRIVATE_StrError());
-                                                               if(setsockopt(lhnetsocket->inetsocket, SOL_RFC1149, RFC1149_ENABLED, &rfc1149enabled))
-                                                                       Con_Printf("LHNET_OpenSocket_Connectionless: warning: setsockopt(RFC1149_ENABLED) returned error: %s\n", LHNETPRIVATE_StrError());
-                                                       }
-#endif
-
-#ifdef SUPPORTIPV6
-                                                       if (address->addresstype == LHNETADDRESSTYPE_INET6)
-=======
->>>>>>> origin/divVerent/lhnet_tcp
                                                        {
                                                                int rfc1149only = 0;
                                                                int rfc1149enabled = 0;
@@ -1075,29 +1057,6 @@ lhnetsocket_t *LHNET_OpenSocket(lhnetaddress_t *address, lhnetaddress_t *peeradd
 #endif
                                                        if (LHNETSOCKET_TryBind(lhnetsocket, address) != -1)
                                                        {
-<<<<<<< HEAD
-                                                               namelen = sizeof(localaddress->addr.in);
-                                                               bindresult = bind(lhnetsocket->inetsocket, &localaddress->addr.sock, namelen);
-                                                               if (bindresult != -1)
-                                                                       getsockname(lhnetsocket->inetsocket, &localaddress->addr.sock, &namelen);
-                                                       }
-                                                       if (bindresult != -1)
-                                                       {
-                                                               int i = 1;
-                                                               // enable broadcast on this socket
-                                                               setsockopt(lhnetsocket->inetsocket, SOL_SOCKET, SO_BROADCAST, (char *)&i, sizeof(i));
-#ifdef IP_TOS
-                                                               {
-                                                                       // enable DSCP for ToS support
-                                                                       int tos = lhnet_default_dscp << 2;
-                                                                       setsockopt(lhnetsocket->inetsocket, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(tos));
-                                                               }
-#endif
-                                                               lhnetsocket->next = &lhnet_socketlist;
-                                                               lhnetsocket->prev = lhnetsocket->next->prev;
-                                                               lhnetsocket->next->prev = lhnetsocket;
-                                                               lhnetsocket->prev->next = lhnetsocket;
-=======
                                                                if (LHNETSOCKET_TryConnect(lhnetsocket, peeraddress) != -1)
                                                                {
                                                                        int i = 1;
@@ -1114,7 +1073,6 @@ lhnetsocket_t *LHNET_OpenSocket(lhnetaddress_t *address, lhnetaddress_t *peeradd
                                                                        lhnetsocket->prev = lhnetsocket->next->prev;
                                                                        lhnetsocket->next->prev = lhnetsocket;
                                                                        lhnetsocket->prev->next = lhnetsocket;
->>>>>>> origin/divVerent/lhnet_tcp
 #ifdef WIN32
                                                                        if (ioctlsocket(lhnetsocket->inetsocket, SIO_UDP_CONNRESET, &_false) == -1)
                                                                                Con_DPrintf("LHNET_OpenSocket_Connectionless: ioctlsocket SIO_UDP_CONNRESET returned error: %s\n", LHNETPRIVATE_StrError());
diff --git a/lhnet.h b/lhnet.h
index 069188ebda8a379ca800b79fa96d9707d8ce8fde..817c0e65bbd41ce143124ffdfd561ced003a456c 100644 (file)
--- a/lhnet.h
+++ b/lhnet.h
@@ -40,10 +40,6 @@ lhnetsocket_t;
 
 void LHNET_Init(void); // must be called before any other threads got spawned
 void LHNET_Shutdown(void);
-int LHNET_DefaultDSCP(int dscp); // < 0: query; >= 0: set (returns previous value)
-void LHNET_SleepUntilPacket_Microseconds(int microseconds);
-lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address);
-void LHNET_CloseSocket(lhnetsocket_t *lhnetsocket);
 int LHNET_DefaultDSCP(int dscp); // < 0: query; >= 0: set (returns previous value); NOT thread-safe but usually does not matter (lhnet_default_dscp)
 void LHNET_SleepUntilPacket_Microseconds(int microseconds); // must only be used from the main thread
 lhnetsocket_t *LHNET_OpenSocket(lhnetaddress_t *address, lhnetaddress_t *peeraddress, int use_tcp, int use_blocking, int register_for_select); // thread-safe ONLY if register_for_select is false (socketlist)