- Bumped netgame, demo and min demo version for the weapon slot changes.

- changed weapon slots to be stored per player. Information is now transmitted
  across the network so that all machines know each player's current weapon
  configuration so that it can be used by cheats or HUD display routines.


SVN r1430 (trunk)
This commit is contained in:
Christoph Oelckers 2009-02-20 22:28:48 +00:00
commit 4b723beddd
13 changed files with 218 additions and 71 deletions

View file

@ -2378,6 +2378,40 @@ void Net_DoCommand (int type, BYTE **stream, int player)
P_ConversationCommand (player, stream);
break;
case DEM_SETSLOT:
{
BYTE playernum = ReadByte(stream);
BYTE slot = ReadByte(stream);
BYTE count = ReadByte(stream);
TArray<const char *> weapons;
weapons.Resize(count);
for(int i = 0; i < count; i++)
{
weapons[i] = ReadStringConst(stream);
}
players[playernum].weapons.SetSlot(slot, weapons);
}
break;
case DEM_ADDSLOT:
{
BYTE playernum = ReadByte(stream);
BYTE slot = ReadByte(stream);
const char *weap = ReadStringConst(stream);
players[playernum].weapons.AddSlot(slot, weap);
}
break;
case DEM_ADDSLOTDEFAULT:
{
BYTE playernum = ReadByte(stream);
BYTE slot = ReadByte(stream);
const char *weap = ReadStringConst(stream);
players[playernum].weapons.AddSlotDefault(slot, weap);
}
break;
default:
I_Error ("Unknown net command: %d", type);
break;
@ -2496,6 +2530,22 @@ void Net_SkipCommand (int type, BYTE **stream)
}
break;
case DEM_SETSLOT:
{
skip = 3;
for(int numweapons = *(*stream + 2); numweapons > 0; numweapons--)
{
skip += strlen ((char *)(*stream + skip)) + 1;
}
}
break;
case DEM_ADDSLOT:
case DEM_ADDSLOTDEFAULT:
skip = strlen ((char *)(*stream + 2)) + 3;
break;
default:
return;
}