]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
migrated cls.message and client->message buffers into netconn_t struct
[xonotic/darkplaces.git] / cl_parse.c
index aa58c5146e7de84b301fdce5be5fb628b0c09f5f..f1cc56c180425ed834666f95543d68d788682521 100644 (file)
@@ -268,50 +268,57 @@ An svc_signonnum has been received, perform a client side setup
 */
 static void CL_SignonReply (void)
 {
-       //char  str[8192];
-
-Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
+       Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
 
        switch (cls.signon)
        {
        case 1:
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, "prespawn");
+               if (cls.netcon)
+               {
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, "prespawn");
+               }
                break;
 
        case 2:
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("name \"%s\"", cl_name.string));
+               if (cls.netcon)
+               {
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, va("name \"%s\"", cl_name.string));
 
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("color %i %i", cl_color.integer >> 4, cl_color.integer & 15));
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, va("color %i %i", cl_color.integer >> 4, cl_color.integer & 15));
 
-               if (cl_pmodel.integer)
-               {
-                       MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("pmodel %i", cl_pmodel.integer));
-               }
-               if (*cl_playermodel.string)
-               {
-                       MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("playermodel %s", cl_playermodel.string));
-               }
-               if (*cl_playerskin.string)
-               {
-                       MSG_WriteByte (&cls.message, clc_stringcmd);
-                       MSG_WriteString (&cls.message, va("playerskin %s", cl_playerskin.string));
-               }
+                       if (cl_pmodel.integer)
+                       {
+                               MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                               MSG_WriteString (&cls.netcon->message, va("pmodel %i", cl_pmodel.integer));
+                       }
+                       if (*cl_playermodel.string)
+                       {
+                               MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                               MSG_WriteString (&cls.netcon->message, va("playermodel %s", cl_playermodel.string));
+                       }
+                       if (*cl_playerskin.string)
+                       {
+                               MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                               MSG_WriteString (&cls.netcon->message, va("playerskin %s", cl_playerskin.string));
+                       }
 
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, va("rate %i", cl_rate.integer));
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, va("rate %i", cl_rate.integer));
 
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, "spawn");
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, "spawn");
+               }
                break;
 
        case 3:
-               MSG_WriteByte (&cls.message, clc_stringcmd);
-               MSG_WriteString (&cls.message, "begin");
+               if (cls.netcon)
+               {
+                       MSG_WriteByte (&cls.netcon->message, clc_stringcmd);
+                       MSG_WriteString (&cls.netcon->message, "begin");
+               }
                break;
 
        case 4: