Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit 01a9081

Browse files
Rename GameManager to GM
1 parent 9c382cc commit 01a9081

29 files changed

Lines changed: 88 additions & 88 deletions

Scenes/Main.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[gd_scene load_steps=14 format=2]
22

3-
[ext_resource path="res://Scripts/Scenes/Main/GameManager.cs" type="Script" id=1]
3+
[ext_resource path="res://Scripts/Scenes/Main/GM.cs" type="Script" id=1]
44
[ext_resource path="res://Scripts/Scenes/Main/MusicManager.cs" type="Script" id=2]
55
[ext_resource path="res://Scripts/Scenes/Main/Debug.cs" type="Script" id=3]
66
[ext_resource path="res://Scripts/Netcode/Common/Utils/NetworkManager.cs" type="Script" id=4]

Scripts/Msc/Commands/CommandDebug.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override void Run(string[] args)
1818

1919
if (args[0] == "a")
2020
if (NetworkManager.IsServerRunning())
21-
GameManager.Logger.LogDebug(NetworkManager.GameServer.Players.Print());
21+
GM.Logger.LogDebug(NetworkManager.GameServer.Players.Print());
2222
}
2323
}
2424
}

Scripts/Msc/Commands/CommandExit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public class CommandExit : Command
66

77
public override void Run(string[] args)
88
{
9-
GameManager.Exit();
9+
GM.Exit();
1010
}
1111
}
1212
}

Scripts/Msc/Commands/CommandHelp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ public class CommandHelp : Command
1212
.Select(Activator.CreateInstance).Cast<Command>()
1313
.Select(x => x.GetType().Name.Replace("Command", "").ToLower()).ToList();
1414

15-
public override void Run(string[] args) => GameManager.Logger.Log($"Commands:\n{CommandNames.Print()}");
15+
public override void Run(string[] args) => GM.Logger.Log($"Commands:\n{CommandNames.Print()}");
1616
}
1717
}

Scripts/Msc/UIGameConsole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private void _on_Console_text_entered(string text)
4949
if (command != null)
5050
command.Run(inputArr.Skip(1).ToArray());
5151
else
52-
GameManager.Logger.Log($"The command '{cmd}' does not exist");
52+
GM.Logger.Log($"The command '{cmd}' does not exist");
5353

5454
Console.Clear();
5555
}

Scripts/Msc/UIPopupCreateLobby.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private async void _on_Create_pressed()
9494
Port = port,
9595
Description = desc,
9696
MaxPlayerCount = ValidatedMaxPlayerCount,
97-
LobbyHost = GameManager.Options.OnlineUsername,
97+
LobbyHost = GM.Options.OnlineUsername,
9898
Public = Public.Pressed
9999
};
100100

@@ -113,7 +113,7 @@ private async void _on_Create_pressed()
113113

114114
if (attempts == 0)
115115
{
116-
GameManager.SpawnPopupMessage($"The port '{port}' must be port forwarded first");
116+
GM.SpawnPopupMessage($"The port '{port}' must be port forwarded first");
117117
NetworkManager.GameServer.Stop();
118118
dummyClient.Stop();
119119
return;
@@ -131,7 +131,7 @@ await SceneGameServersScript.ClientConnect(async () => {
131131
await NetworkManager.WaitForHostToConnectToServer();
132132
await NetworkManager.GameClient.Send(ClientPacketOpcode.Lobby, new CPacketLobby(LobbyOpcode.LobbyCreate)
133133
{
134-
Username = GameManager.Options.OnlineUsername,
134+
Username = GM.Options.OnlineUsername,
135135
LobbyName = name,
136136
LobbyDescription = desc
137137
});

Scripts/Msc/UIPopupFileDialogMods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public override void _Ready()
1515

1616
public void Open()
1717
{
18-
FileManager.CurrentDir = GameManager.ModLoader.PathMods;
18+
FileManager.CurrentDir = GM.ModLoader.PathMods;
1919
FileManager.PopupCentered();
2020
}
2121

Scripts/Netcode/Client/ENetClient.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public async void Start(string ip, ushort port)
6161
}
6262
catch (Exception e)
6363
{
64-
GameManager.Logger.LogErr(e, "Client");
64+
GM.Logger.LogErr(e, "Client");
6565
}
6666
}
6767

@@ -70,7 +70,7 @@ public async void Start(string ip, ushort port)
7070
/// </summary>
7171
public void Stop() => ENetCmds.Enqueue(new ThreadCmd<ENetOpcode>(ENetOpcode.ClientWantsToDisconnect));
7272

73-
public void Log(object obj) => GameManager.Logger.Log($"[Client]: {obj}", ConsoleColor.Yellow);
73+
public void Log(object obj) => GM.Logger.Log($"[Client]: {obj}", ConsoleColor.Yellow);
7474

7575
/// <summary>
7676
/// This is in the ENet thread, anything from the ENet thread can be used here
@@ -171,7 +171,7 @@ private Task ENetThreadWorker(string ip, ushort port)
171171
continue;
172172
}
173173

174-
GameManager.GodotCommands.Enqueue(GodotOpcode.ENetPacket, new PacketReader(packet));
174+
GM.GodotCommands.Enqueue(GodotOpcode.ENetPacket, new PacketReader(packet));
175175
break;
176176

177177
case EventType.Timeout:

Scripts/Netcode/Client/GameClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private void HandlePeerLeave(DisconnectOpcode opcode)
3333
NetworkManager.ClientConnectingToLobby = false;
3434
NetworkManager.ClientDisconnected = true;
3535
Connected = 0;
36-
GameManager.GodotCommands.Enqueue(GodotOpcode.Disconnect, opcode);
36+
GM.GodotCommands.Enqueue(GodotOpcode.Disconnect, opcode);
3737
if (CTSClientTask != null)
3838
{
3939
CTSClientTask.Cancel();

Scripts/Netcode/Client/GodotCommands.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public async Task Dequeue()
2222

2323
if (!ENetClient.HandlePacket.ContainsKey(opcode))
2424
{
25-
GameManager.Logger.LogWarning($"[Client]: Received malformed opcode: {opcode} (Ignoring)");
25+
GM.Logger.LogWarning($"[Client]: Received malformed opcode: {opcode} (Ignoring)");
2626
break;
2727
}
2828

@@ -33,7 +33,7 @@ public async Task Dequeue()
3333
}
3434
catch (System.IO.EndOfStreamException ex)
3535
{
36-
GameManager.Logger.LogWarning($"[Client]: Received malformed opcode: {opcode} {ex.Message} (Ignoring)");
36+
GM.Logger.LogWarning($"[Client]: Received malformed opcode: {opcode} {ex.Message} (Ignoring)");
3737
break;
3838
}
3939
await handlePacket.Handle();
@@ -42,7 +42,7 @@ public async Task Dequeue()
4242
break;
4343

4444
case GodotOpcode.PopupMessage:
45-
GameManager.SpawnPopupMessage((string)cmd.Data);
45+
GM.SpawnPopupMessage((string)cmd.Data);
4646
break;
4747

4848
case GodotOpcode.ChangeScene:

0 commit comments

Comments
 (0)