- Edited item densities to make more sense
- Characters spawned through the console are synced with clients
This commit is contained in:
@@ -588,6 +588,9 @@ namespace Barotrauma.Networking
|
||||
case (byte)PacketTypes.NewItem:
|
||||
Item.Spawner.ReadNetworkData(inc);
|
||||
break;
|
||||
case (byte)PacketTypes.NewCharacter:
|
||||
ReadCharacterSpawnMessage(inc);
|
||||
break;
|
||||
case (byte)PacketTypes.RemoveItem:
|
||||
Item.Remover.ReadNetworkData(inc);
|
||||
break;
|
||||
@@ -767,6 +770,18 @@ namespace Barotrauma.Networking
|
||||
GameMain.NetworkMember = null;
|
||||
}
|
||||
|
||||
public void ReadCharacterSpawnMessage(NetIncomingMessage message)
|
||||
{
|
||||
string configPath = message.ReadString();
|
||||
|
||||
ushort id = message.ReadUInt16();
|
||||
|
||||
Vector2 position = new Vector2(message.ReadFloat(), message.ReadFloat());
|
||||
|
||||
var character = Character.Create(configPath, position);
|
||||
if (character != null) character.ID = id;
|
||||
}
|
||||
|
||||
public void RequestFile(string file, FileTransferMessageType fileType)
|
||||
{
|
||||
if (fileStreamReceiver!=null)
|
||||
|
||||
Reference in New Issue
Block a user