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 SpriteBatch _spriteBatch;
public GameState gameState { get; private set; }
public MultiPlayerStatus multiPlayerStatus { get; private set; }
public MultiPlayerStatus multiPlayerStatus { get; private set; } = MultiPlayerStatus.SinglePlayer;
IDrawableObject MenuGUI;
IDrawableObject OptionsGUI;
IDrawableObject LoginGUI;

View file

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