private void Process(Client client, ClientCommandSpawn msg) { if (msg.tech == TechType.Cyclops || msg.tech == TechType.Exosuit || msg.tech == TechType.Seamoth) { var vehicle = state.history.vehicles.GetOrAddNew(msg.objectGuid); vehicle.position = msg.spawnPosition; vehicle.rotation = msg.spawnRotation; vehicle.spawn = msg; } else { state.history.building.Add(msg); } SendToAll(client.peer, msg); }
public static void SendSpawn(GameObject gameObject, TechType tech) { if (gameObject == null || tech == TechType.None || Multiplayer.main.blocked) { return; } var res = new ClientCommandSpawn(); res.objectGuid = GuidHelper.Get(gameObject); res.tech = tech; res.spawnPosition = gameObject.transform.position; res.spawnRotation = gameObject.transform.rotation; res.children = GuidHelper.GetChildGuids(gameObject); Multiplayer.main.Send(res); }
private void Process(ClientCommandSpawn msg) { using (new MessageBlocker()) { Logic.Commands.SpawnPrefab(msg.objectGuid, msg.children, msg.tech, msg.spawnPosition, msg.spawnRotation); } }