static void ShootDirectionChangeCallback(MySyncControllableEntity sync, ref ShootDirectionChangeMsg msg, MyNetworkClient sender) { sync.ShootDirection = msg.Direction; if (Sync.IsServer) { MySession.Static.SyncLayer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } }
public void UpdateShootDirection(Vector3 direction, int multiplayerUpdateInterval) { if (multiplayerUpdateInterval != 0 && MySandboxGame.TotalGamePlayTimeInMilliseconds - m_lastShootDirectionUpdate > multiplayerUpdateInterval) { ShootDirectionChangeMsg msg = new ShootDirectionChangeMsg(); msg.EntityId = SyncedEntityId; msg.Direction = direction; MySession.Static.SyncLayer.SendMessageToServer(ref msg); m_lastShootDirectionUpdate = MySandboxGame.TotalGamePlayTimeInMilliseconds; } ShootDirection = direction; }
static void ShootDirectionChangeCallback(MySyncControllableEntity sync, ref ShootDirectionChangeMsg msg, MyNetworkClient sender) { sync.ShootDirection = msg.Direction; }
static void ShootDirectionChangeCallback(MySyncControllableEntity sync, ref ShootDirectionChangeMsg msg, MyNetworkClient sender) { sync.ShootDirection = msg.Direction; if(Sync.IsServer) { MySession.Static.SyncLayer.SendMessageToAllButOne(ref msg, sender.SteamUserId); } }