for (i = 0;i < 3;i++)
MSG_WriteFloat (&buf, cl.viewangles[i]);
}
- else if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES4)
+ else if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
{
for (i=0 ; i<3 ; i++)
MSG_WritePreciseAngle (&buf, cl.viewangles[i]);
if (ent >= MAX_EDICTS)
Host_Error ("CL_ParseStartSoundPacket: ent = %i", ent);
- for (i = 0;i < 3;i++)
- pos[i] = MSG_ReadCoord ();
+ MSG_ReadVector(pos);
S_StartSound (ent, channel, cl.sound_precache[sound_num], pos, volume/255.0, attenuation);
}
// hack for unmarked Nehahra movie demos which had a custom protocol
if (i == PROTOCOL_QUAKE && cls.demoplayback && demo_nehahra.integer)
i = PROTOCOL_NEHAHRAMOVIE;
- if (i != PROTOCOL_QUAKE && i != PROTOCOL_DARKPLACES1 && i != PROTOCOL_DARKPLACES2 && i != PROTOCOL_DARKPLACES3 && i != PROTOCOL_DARKPLACES4 && i != PROTOCOL_NEHAHRAMOVIE)
+ if (i != PROTOCOL_QUAKE && i != PROTOCOL_DARKPLACES1 && i != PROTOCOL_DARKPLACES2 && i != PROTOCOL_DARKPLACES3 && i != PROTOCOL_DARKPLACES4 && i != PROTOCOL_DARKPLACES5 && i != PROTOCOL_NEHAHRAMOVIE)
{
- Host_Error("CL_ParseServerInfo: Server is protocol %i, not %i (Quake), %i (DP1), %i (DP2), %i (DP3), %i (DP4), or %i (Nehahra movie)", i, PROTOCOL_QUAKE, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_NEHAHRAMOVIE);
+ Host_Error("CL_ParseServerInfo: Server is protocol %i, not %i (Quake), %i (DP1), %i (DP2), %i (DP3), %i (DP4), %i (DP5), or %i (Nehahra movie)", i, PROTOCOL_QUAKE, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_NEHAHRAMOVIE);
return;
}
cl.protocol = i;
cl.idealpitch = 0;
VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
- for (i=0 ; i<3 ; i++)
+ if (cl.protocol == PROTOCOL_DARKPLACES5)
{
- if (bits & (SU_PUNCH1<<i) )
+ for (i = 0;i < 3;i++)
{
- if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+ if (bits & (SU_PUNCH1<<i) )
cl.punchangle[i] = MSG_ReadPreciseAngle();
else
- cl.punchangle[i] = MSG_ReadChar();
+ cl.punchangle[i] = 0;
+ if (bits & (SU_PUNCHVEC1<<i))
+ cl.punchvector[i] = MSG_ReadFloat();
+ else
+ cl.punchvector[i] = 0;
+ if (bits & (SU_VELOCITY1<<i) )
+ cl.mvelocity[0][i] = MSG_ReadFloat();
+ else
+ cl.mvelocity[0][i] = 0;
+ }
+ }
+ else
+ {
+ for (i = 0;i < 3;i++)
+ {
+ if (bits & (SU_PUNCH1<<i) )
+ {
+ if (cl.protocol == PROTOCOL_DARKPLACES1 || cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
+ cl.punchangle[i] = MSG_ReadPreciseAngle();
+ else
+ cl.punchangle[i] = MSG_ReadChar();
+ }
+ else
+ cl.punchangle[i] = 0;
+ if (bits & (SU_PUNCHVEC1<<i))
+ cl.punchvector[i] = MSG_ReadCoord();
+ else
+ cl.punchvector[i] = 0;
+ if (bits & (SU_VELOCITY1<<i) )
+ cl.mvelocity[0][i] = MSG_ReadChar()*16;
+ else
+ cl.mvelocity[0][i] = 0;
}
- else
- cl.punchangle[i] = 0;
- if (bits & (SU_PUNCHVEC1<<i))
- cl.punchvector[i] = MSG_ReadCoord();
- else
- cl.punchvector[i] = 0;
- if (bits & (SU_VELOCITY1<<i) )
- cl.mvelocity[0][i] = MSG_ReadChar()*16;
- else
- cl.mvelocity[0][i] = 0;
}
i = MSG_ReadLong ();
break;
case TE_LAVASPLASH:
- pos[0] = MSG_ReadCoord();
- pos[1] = MSG_ReadCoord();
- pos[2] = MSG_ReadCoord();
+ MSG_ReadVector(pos);
CL_LavaSplash(pos);
break;
case TE_TELEPORT:
- pos[0] = MSG_ReadCoord();
- pos[1] = MSG_ReadCoord();
- pos[2] = MSG_ReadCoord();
+ MSG_ReadVector(pos);
Matrix4x4_CreateTranslate(&tempmatrix, pos[0], pos[1], pos[2]);
CL_AllocDlight(NULL, &tempmatrix, 500, 1.0f, 1.0f, 1.0f, 1500, 99.0f, 0, 0, true, 1);
// CL_TeleportSplash(pos);
// hack for unmarked Nehahra movie demos which had a custom protocol
if (i == PROTOCOL_QUAKE && cls.demoplayback && demo_nehahra.integer)
i = PROTOCOL_NEHAHRAMOVIE;
- if (i != PROTOCOL_QUAKE && i != PROTOCOL_DARKPLACES1 && i != PROTOCOL_DARKPLACES2 && i != PROTOCOL_DARKPLACES3 && i != PROTOCOL_DARKPLACES4 && i != PROTOCOL_NEHAHRAMOVIE)
- Host_Error("CL_ParseServerMessage: Server is protocol %i, not %i (Quake), %i (DP1), %i (DP2), %i (DP3), %i (DP4), or %i (Nehahra movie)", i, PROTOCOL_QUAKE, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_NEHAHRAMOVIE);
+ if (i != PROTOCOL_QUAKE && i != PROTOCOL_DARKPLACES1 && i != PROTOCOL_DARKPLACES2 && i != PROTOCOL_DARKPLACES3 && i != PROTOCOL_DARKPLACES4 && i != PROTOCOL_DARKPLACES5 && i != PROTOCOL_NEHAHRAMOVIE)
+ Host_Error("CL_ParseServerMessage: Server is protocol %i, not %i (Quake), %i (DP1), %i (DP2), %i (DP3), %i (DP4), %i (DP5), or %i (Nehahra movie)", i, PROTOCOL_QUAKE, PROTOCOL_DARKPLACES1, PROTOCOL_DARKPLACES2, PROTOCOL_DARKPLACES3, PROTOCOL_DARKPLACES4, PROTOCOL_DARKPLACES5, PROTOCOL_NEHAHRAMOVIE);
cl.protocol = i;
break;
vec3_t org, dir;
int i, count, msgcount, color;
- for (i=0 ; i<3 ; i++)
- org[i] = MSG_ReadCoord ();
+ MSG_ReadVector(org);
for (i=0 ; i<3 ; i++)
dir[i] = MSG_ReadChar () * (1.0/16);
msgcount = MSG_ReadByte ();
return l;
}
-// used by server (always latest PROTOCOL_DARKPLACES)
-float MSG_ReadDPCoord (void)
-{
- return (signed short) MSG_ReadLittleShort();
-}
-
// used by client
float MSG_ReadCoord (void)
{
- if (cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4)
+ if (cl.protocol == PROTOCOL_DARKPLACES2 || cl.protocol == PROTOCOL_DARKPLACES3 || cl.protocol == PROTOCOL_DARKPLACES4 || cl.protocol == PROTOCOL_DARKPLACES5)
return (signed short) MSG_ReadLittleShort();
else if (cl.protocol == PROTOCOL_DARKPLACES1)
return MSG_ReadLittleFloat();
float MSG_ReadCoord (void);
-float MSG_ReadDPCoord (void);
-
#define MSG_ReadAngle() (MSG_ReadByte() * (360.0f / 256.0f))
#define MSG_ReadPreciseAngle() (MSG_ReadShort() * (360.0f / 65536.0f))
-#define MSG_ReadVector(v) {(v)[0] = MSG_ReadCoord();(v)[1] = MSG_ReadCoord();(v)[2] = MSG_ReadCoord();}
+#define MSG_ReadVector(v) ((v)[0] = MSG_ReadCoord(), (v)[1] = MSG_ReadCoord(), (v)[2] = MSG_ReadCoord())
//============================================================================
MSG_WriteShort(msg, org[1]);
if (bits & E_ORIGIN3)
MSG_WriteShort(msg, org[2]);
+ if (bits & E_ANGLE1)
+ MSG_WriteAngle(msg, ent->angles[0]);
+ if (bits & E_ANGLE2)
+ MSG_WriteAngle(msg, ent->angles[1]);
+ if (bits & E_ANGLE3)
+ MSG_WriteAngle(msg, ent->angles[2]);
}
else
{
MSG_WriteFloat(msg, org[1]);
if (bits & E_ORIGIN3)
MSG_WriteFloat(msg, org[2]);
+ if (bits & E_ANGLE1)
+ MSG_WritePreciseAngle(msg, ent->angles[0]);
+ if (bits & E_ANGLE2)
+ MSG_WritePreciseAngle(msg, ent->angles[1]);
+ if (bits & E_ANGLE3)
+ MSG_WritePreciseAngle(msg, ent->angles[2]);
}
- if (bits & E_ANGLE1)
- MSG_WriteAngle(msg, ent->angles[0]);
- if (bits & E_ANGLE2)
- MSG_WriteAngle(msg, ent->angles[1]);
- if (bits & E_ANGLE3)
- MSG_WriteAngle(msg, ent->angles[2]);
if (bits & E_MODEL1)
MSG_WriteByte(msg, ent->modelindex & 0xFF);
if (bits & E_MODEL2)
e->origin[2] = MSG_ReadFloat();
}
}
- if (bits & E_ANGLE1)
- e->angles[0] = MSG_ReadAngle();
- if (bits & E_ANGLE2)
- e->angles[1] = MSG_ReadAngle();
- if (bits & E_ANGLE3)
- e->angles[2] = MSG_ReadAngle();
+ if (cl.protocol == PROTOCOL_DARKPLACES5 && !(e->flags & RENDER_LOWPRECISION))
+ {
+ if (bits & E_ANGLE1)
+ e->angles[0] = MSG_ReadPreciseAngle();
+ if (bits & E_ANGLE2)
+ e->angles[1] = MSG_ReadPreciseAngle();
+ if (bits & E_ANGLE3)
+ e->angles[2] = MSG_ReadPreciseAngle();
+ }
+ else
+ {
+ if (bits & E_ANGLE1)
+ e->angles[0] = MSG_ReadAngle();
+ if (bits & E_ANGLE2)
+ e->angles[1] = MSG_ReadAngle();
+ if (bits & E_ANGLE3)
+ e->angles[2] = MSG_ReadAngle();
+ }
if (bits & E_MODEL1)
e->modelindex = (e->modelindex & 0xFF00) | (unsigned int) MSG_ReadByte();
if (bits & E_MODEL2)
// so here I jump to 3500
#define PROTOCOL_DARKPLACES3 3500
#define PROTOCOL_DARKPLACES4 3501
+#define PROTOCOL_DARKPLACES5 3502
// model effects
#define EF_ROCKET 1 // leave a trail
MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo);
- MSG_WriteLong (&client->message, PROTOCOL_DARKPLACES4);
+ MSG_WriteLong (&client->message, PROTOCOL_DARKPLACES5);
MSG_WriteByte (&client->message, svs.maxclients);
if (!coop.integer && deathmatch.integer)
if (bits & (SU_PUNCH1<<i))
MSG_WritePreciseAngle(msg, ent->v->punchangle[i]); // PROTOCOL_DARKPLACES
if (bits & (SU_PUNCHVEC1<<i)) // PROTOCOL_DARKPLACES
- MSG_WriteDPCoord(msg, punchvector[i]); // PROTOCOL_DARKPLACES
+ MSG_WriteFloat(msg, punchvector[i]); // PROTOCOL_DARKPLACES
if (bits & (SU_VELOCITY1<<i))
- MSG_WriteChar (msg, ent->v->velocity[i]/16);
+ MSG_WriteFloat(msg, ent->v->velocity[i]);
}
// [always sent] if (bits & SU_ITEMS)
-n darkplaces: segfault reading memory in windows when starting a new server from menu (yummyluv)
-n darkplaces: server is starting before the "port" cvar is set by commandline and scripts? (yummyluv)
-n darkplaces: typing ip in join game menu should show 'trying' and 'no response' after a while, or 'no network' if networking is not initialized (yummyluv)
+0 darkplaces: fix view blends, they're not working
d darkplaces: fixed SV_TouchAreaGrid to not crash if SV_IncreaseEdicts is called during a touch function, by making a list of edicts to touch and then running through the list afterward (KGB|romi)
d darkplaces: moved R_ShadowVolumeLighting to r_shadow.c
d darkplaces: added RENDER_LIGHT flag to entity_render_t to make rtlighting optional per entity
d darkplaces: cleaned up rtlight handling, merging most code between world rtlights and dlights
d darkplaces: safety checked lightmap access in Mod_Q1BSP_RecursiveLightPoint as one map Sajt uses was crashing (Sajt)
-0 darkplaces: upgrade network protocol to send precise angles, and make EF_LOWPRECISION downgrade both origin and angles (Urre)
+-n darkplaces: upgrade network protocol to send precise angles, and make EF_LOWPRECISION downgrade both origin and angles (Urre, Wazat for Battlemech, FrikaC, mashakos, RenegadeC, Sajt)
0 darkplaces: figure out why cubemap upload scaling crashes (Urre)
0 darkplaces: make screenshots save to screenshots/fniggium%04i.tga in GAME_FNIGGIUM (Sajt)
0 darkplaces: make screenshots save to screenshots directory (Sajt)
0 sv_user.qc: figure out why looking up/down slows movement and fix it (Vermeulen)
1 darkplaces: add DP_CLIENTCAMERA extension (.entity clientcamera; sets which entity the client views from) (Wazat for Battlemech, SeienAbunae)
1 darkplaces: add DP_EF_CLIENTLOCKANGLES extension (prevents client from turning view, takes angles from entity) (Wazat for Battlemech, SeienAbunae)
-1 darkplaces: add DP_EF_PRECISEANGLES extension (sends short angles instead of byte) (Wazat for Battlemech, FrikaC, mashakos, RenegadeC, Sajt)
+f darkplaces: add DP_EF_PRECISEANGLES extension (sends short angles instead of byte), failed because network protocol was upgraded by default (Wazat for Battlemech, FrikaC, mashakos, RenegadeC, Sajt)
1 darkplaces: add DP_QC_ENDFRAME extension/documentation and post it on wiki (tell Uffe, SeienAbunae)
1 darkplaces: add DP_SV_READCLIENTINPUT extension (.vector clientinput; works like .movement but for mouse or any other similar controllers) (Wazat for Battlemech, FrikaC, SeienAbunae)
1 darkplaces: add EndGame function (called on server shutdown or level change) (SeienAbunae, Nexuiz)
armor = MSG_ReadByte ();
blood = MSG_ReadByte ();
- for (i=0 ; i<3 ; i++)
- from[i] = MSG_ReadCoord ();
+ MSG_ReadVector(from);
count = blood*0.5 + armor*0.5;
if (count < 10)