Skip to content

Commit 28f5f6f

Browse files
committed
fixed network game not starting
1 parent f015b8f commit 28f5f6f

File tree

4 files changed

+10
-25
lines changed

4 files changed

+10
-25
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ All scripts and scene files are distributed under the [MIT license](LICENSE.md).
1313

1414
Unless mentioned otherwise, all art assets (files in ``assets/graphics/`` are distributed under the [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) license.
1515

16-
* Copyright: Emilien Rotival
16+
* Copyright: Emilien Rotival

project.godot

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ Scenes="*res://src/nodes/global/Scenes.tscn"
2121
Data="*res://src/nodes/global/Data.tscn"
2222
Sfx="*res://src/nodes/global/Sfx.tscn"
2323

24-
[debug]
25-
26-
settings/stdout/print_fps=true
27-
settings/stdout/print_gpu_profile=true
28-
2924
[display]
3025

3126
window/size/viewport_width=1920

src/states/FactionSelectionState.cs

+7-13
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ public partial class FactionSelectionState : GameState
1111

1212
readonly string _mapName;
1313

14-
public FactionSelectionState(string mapName)
15-
{
16-
_mapName = mapName;
17-
}
14+
public FactionSelectionState(string mapName) => _mapName = mapName;
1815

1916
public override void Init(GameStateController gameStates)
2017
{
@@ -28,10 +25,7 @@ public class FactionSelectionStateUpdateSystem : ISystem
2825
{
2926
readonly string _mapName;
3027

31-
public FactionSelectionStateUpdateSystem(string mapName)
32-
{
33-
_mapName = mapName;
34-
}
28+
public FactionSelectionStateUpdateSystem(string mapName) => _mapName = mapName;
3529

3630
public void Run(Commands commands)
3731
{
@@ -70,10 +64,7 @@ public partial class FactionSelectionStateInitSystem : Resource, ISystem
7064

7165
FactionSelectionState _state;
7266

73-
public FactionSelectionStateInitSystem(string mapName)
74-
{
75-
_mapName = mapName;
76-
}
67+
public FactionSelectionStateInitSystem(string mapName) => _mapName = mapName;
7768

7869
public void Run(Commands commands)
7970
{
@@ -110,7 +101,9 @@ public void Run(Commands commands)
110101
_view.Connect(nameof(FactionSelectionView.GoldChanged), new Callable(this, nameof(OnGoldChanged)));
111102
_view.Connect(nameof(FactionSelectionView.ContinueButtonPressed), new Callable(this, nameof(OnContinueButtonPressed)));
112103
_view.Connect(nameof(FactionSelectionView.BackButtonPressed), new Callable(this, nameof(OnBackButtonPressed)));
113-
104+
105+
commands.AddElement(_view);
106+
114107
commands.GetElement<CurrentGameState>().State.AddChild(_view);
115108
}
116109

@@ -144,6 +137,7 @@ void OnMatchStateReceived(IMatchState state)
144137
}
145138
case NetworkOperation.PlayerReadied:
146139
{
140+
GD.Print("PlayerReadied Received");
147141
_state.PlayersReadied += 1;
148142
break;
149143
}

src/systems/unit/DeathTriggerSystem.cs

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@
33

44
public class DeathTrigger
55
{
6-
public Entity Entity { get; set; }
7-
8-
public DeathTrigger(Entity entity)
9-
{
10-
Entity = entity;
11-
}
6+
public Entity Entity { get; }
7+
public DeathTrigger(Entity entity) => Entity = entity;
128
}
139

1410
public class DeathTriggerSystem : ISystem

0 commit comments

Comments
 (0)