NetworkFix

This commit is contained in:
AnloGames 2023-08-17 12:50:20 +03:00
parent c87b8d9089
commit ccc6937ac9
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ namespace DangerousD.GameCore
private GraphicsDeviceManager _graphics; private GraphicsDeviceManager _graphics;
private SpriteBatch _spriteBatch; private SpriteBatch _spriteBatch;
public GameState gameState { get; private set; } public GameState gameState { get; private set; }
public MultiPlayerStatus multiPlayerStatus { get; private set; } public MultiPlayerStatus multiPlayerStatus { get; private set; } = MultiPlayerStatus.SinglePlayer;
IDrawableObject MenuGUI; IDrawableObject MenuGUI;
IDrawableObject OptionsGUI; IDrawableObject OptionsGUI;
IDrawableObject LoginGUI; IDrawableObject LoginGUI;

View file

@ -33,7 +33,7 @@ namespace DangerousD.GameCore
sound.SoundEffect.IsLooped = false; sound.SoundEffect.IsLooped = false;
sound.SoundEffect.Play(); sound.SoundEffect.Play();
PlayingSounds.Add(sound); PlayingSounds.Add(sound);
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.Host) if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
{ {
AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(Vector2.Zero, soundName)); AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(Vector2.Zero, soundName));
} }
@ -45,7 +45,7 @@ namespace DangerousD.GameCore
sound.SoundEffect.Volume = (float)sound.GetDistance(playerPos) / MaxSoundDistance; sound.SoundEffect.Volume = (float)sound.GetDistance(playerPos) / MaxSoundDistance;
sound.SoundEffect.Play(); sound.SoundEffect.Play();
PlayingSounds.Add(sound); PlayingSounds.Add(sound);
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.Host) if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
{ {
AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(soundPos, soundName)); AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(soundPos, soundName));
} }