From dcf5e4eb2d67b61998c2eca38cbc1049500404e7 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 4 Apr 2021 23:46:40 +0200 Subject: [PATCH 1/7] try fix clientside error --- ReallifeGamemode.Client/core/rage-mp/game.ts | 2 +- ReallifeGamemode.Client/inputhelper/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/core/rage-mp/game.ts b/ReallifeGamemode.Client/core/rage-mp/game.ts index 5094ba9f..62c9661a 100644 --- a/ReallifeGamemode.Client/core/rage-mp/game.ts +++ b/ReallifeGamemode.Client/core/rage-mp/game.ts @@ -11,7 +11,7 @@ export default class RageGame implements IGame { ui: IUi = new RageUi; wait(ms: number): void { - mp.game.wait(ms); + mp.game.waitAsync(ms); } disableDefaultEngineBehaviour(): void { diff --git a/ReallifeGamemode.Client/inputhelper/index.ts b/ReallifeGamemode.Client/inputhelper/index.ts index ce216572..5898bd5c 100644 --- a/ReallifeGamemode.Client/inputhelper/index.ts +++ b/ReallifeGamemode.Client/inputhelper/index.ts @@ -69,7 +69,7 @@ export default class InputHelper { private valueGetter(): Promise { return new Promise(resolve => { while (this.value === undefined) { - mp.game.wait(1); + mp.game.waitAsync(1); } resolve(this.value); }); From cb68bcaf531d06872bd043ae841640ae8ff2a285 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 4 Apr 2021 23:56:35 +0200 Subject: [PATCH 2/7] try fix error --- ReallifeGamemode.Client/Gui/blips.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index 12a415df..54bb8e21 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -7,8 +7,8 @@ export default function playerBlips() { - mp.events.add("entityStreamIn", (entity) => { - mp.game.wait(500); + mp.events.add("entityStreamIn", async (entity) => { + await mp.game.waitAsync(500); if (entity.type === "player") { var entityMp = entity; let color = parseInt(entity.getVariable("blipColor")); From 70c25598ff036804cd9419d175c1ef701ef66b87 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 5 Apr 2021 00:03:00 +0200 Subject: [PATCH 3/7] ga fix --- ReallifeGamemode.Server/Commands/FactionCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index bac65955..724fc33e 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -51,7 +51,7 @@ namespace ReallifeGamemode.Server.Commands ChatService.NotAuthorized(player); return; } - if (f.Name == "Ballas" || f.Name == "Grove" || user.IsAdmin(AdminLevel.ADMIN)) + if (f?.Name == "Ballas" || f?.Name == "Grove" || user.IsAdmin(AdminLevel.ADMIN)) { message = Regex.Replace(message, "(~[a-zA-Z]~)|(!{(.*)})", ""); From 7b130c6e15b7d5c1111d6ce4ae11c03223e3afd1 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 5 Apr 2021 00:06:52 +0200 Subject: [PATCH 4/7] ga fix --- ReallifeGamemode.Server/Commands/FactionCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Server/Commands/FactionCommands.cs b/ReallifeGamemode.Server/Commands/FactionCommands.cs index 724fc33e..a41601a1 100644 --- a/ReallifeGamemode.Server/Commands/FactionCommands.cs +++ b/ReallifeGamemode.Server/Commands/FactionCommands.cs @@ -57,7 +57,7 @@ namespace ReallifeGamemode.Server.Commands string rank = string.Empty; - if(f.Name == "Ballas" || f.Name == "Grove") + if(f?.Name == "Ballas" || f?.Name == "Grove") { rank = player.GetUser().GetFactionRank().RankName; } From 37555aacd35af892c64885cdc9096fe316400b37 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 5 Apr 2021 00:16:06 +0200 Subject: [PATCH 5/7] blips und nametag color --- ReallifeGamemode.Client/Gui/blips.ts | 2 +- .../core/rage-mp/entities.ts | 1 - .../Commands/AdminCommands.cs | 22 +++++++++---------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ReallifeGamemode.Client/Gui/blips.ts b/ReallifeGamemode.Client/Gui/blips.ts index 54bb8e21..18b5c524 100644 --- a/ReallifeGamemode.Client/Gui/blips.ts +++ b/ReallifeGamemode.Client/Gui/blips.ts @@ -27,7 +27,7 @@ export default function playerBlips() { mp.events.add("entityStreamOut", (entity) => { if (entity.type === "player") { - entity.blip = null; + //entity.blip = null; } }); diff --git a/ReallifeGamemode.Client/core/rage-mp/entities.ts b/ReallifeGamemode.Client/core/rage-mp/entities.ts index 61e522d8..df59090c 100644 --- a/ReallifeGamemode.Client/core/rage-mp/entities.ts +++ b/ReallifeGamemode.Client/core/rage-mp/entities.ts @@ -73,7 +73,6 @@ class RagePlayer extends RageEntity implements IPlayer { get nametagColor(): number { var color = this.player.getVariable("nameTagColor"); - game.ui.sendChatMessage(`player = ${this.player.name} - color = ${color}`); if (!color) return 0; return color; diff --git a/ReallifeGamemode.Server/Commands/AdminCommands.cs b/ReallifeGamemode.Server/Commands/AdminCommands.cs index c11dcb65..ac533405 100644 --- a/ReallifeGamemode.Server/Commands/AdminCommands.cs +++ b/ReallifeGamemode.Server/Commands/AdminCommands.cs @@ -1493,30 +1493,30 @@ namespace ReallifeGamemode.Server.Commands { case null: target.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", 0); + target.SetSharedData("nameTagColor", 0); break; case 0: - player.SetSharedData("nameTagColor", 0); + target.SetSharedData("nameTagColor", 0); break; case 8: - player.SetSharedData("nameTagColor", 8); + target.SetSharedData("nameTagColor", 8); break; case 7: - player.SetSharedData("nameTagColor", 7); + target.SetSharedData("nameTagColor", 7); break; case 4: - player.SetSharedData("nameTagColor", 4); + target.SetSharedData("nameTagColor", 4); break; case 9: - player.SetSharedData("nameTagColor", 9); + target.SetSharedData("nameTagColor", 9); break; } target.TriggerEvent("jailTime", 0); - if (targetUser.FactionId != null) player.SetSharedData("nameTagColor", targetUser.FactionId); + if (targetUser.FactionId != null) target.SetSharedData("nameTagColor", targetUser.FactionId); targetUser.Wanteds = 0; dbContext.SaveChanges(); } @@ -2452,7 +2452,7 @@ namespace ReallifeGamemode.Server.Commands { case null: target.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", 0); + target.SetSharedData("nameTagColor", 0); break; case 0: @@ -2475,7 +2475,7 @@ namespace ReallifeGamemode.Server.Commands break; } - if (u.FactionId != null) player.SetSharedData("nameTagColor", u.FactionId); + if (u.FactionId != null) target.SetSharedData("nameTagColor", u.FactionId); dbContext.SaveChanges(); } } @@ -2522,7 +2522,7 @@ namespace ReallifeGamemode.Server.Commands { case null: target.SetSharedData("blipColor", 0); - player.SetSharedData("nameTagColor", 0); + target.SetSharedData("nameTagColor", 0); break; case 8: @@ -2540,7 +2540,7 @@ namespace ReallifeGamemode.Server.Commands target.SetSharedData("blipColor", 25); break; } - if (u.FactionId != null) player.SetSharedData("nameTagColor", u.FactionId); + if (u.FactionId != null) target.SetSharedData("nameTagColor", u.FactionId); dbContext.SaveChanges(); } } From 9809085678bcdf2495ce517baff4dc549f66d8e9 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 5 Apr 2021 00:32:00 +0200 Subject: [PATCH 6/7] disable db logs --- ReallifeGamemode.Server.Core/Commands/Command.cs | 2 +- ReallifeGamemode.Server.Core/Main.cs | 2 +- ReallifeGamemode.Server.Core/Script.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Server.Core/Commands/Command.cs b/ReallifeGamemode.Server.Core/Commands/Command.cs index 92966605..ecb91b54 100644 --- a/ReallifeGamemode.Server.Core/Commands/Command.cs +++ b/ReallifeGamemode.Server.Core/Commands/Command.cs @@ -23,6 +23,6 @@ namespace ReallifeGamemode.Server.Core.Commands Log = LogManager.GetLogger(this.GetType()); } - protected DatabaseContext GetDbContext(bool useLoggerFactory = true) => Main.GetDbContext(useLoggerFactory); + protected DatabaseContext GetDbContext(bool useLoggerFactory = false) => Main.GetDbContext(useLoggerFactory); } } diff --git a/ReallifeGamemode.Server.Core/Main.cs b/ReallifeGamemode.Server.Core/Main.cs index 128b4d58..bceec473 100644 --- a/ReallifeGamemode.Server.Core/Main.cs +++ b/ReallifeGamemode.Server.Core/Main.cs @@ -64,7 +64,7 @@ namespace ReallifeGamemode.Server.Core } } - public static DatabaseContext GetDbContext(bool useLoggerFactory = true) + public static DatabaseContext GetDbContext(bool useLoggerFactory = false) { return new DatabaseContext(useLoggerFactory); } diff --git a/ReallifeGamemode.Server.Core/Script.cs b/ReallifeGamemode.Server.Core/Script.cs index 5d87f5d2..c3474a38 100644 --- a/ReallifeGamemode.Server.Core/Script.cs +++ b/ReallifeGamemode.Server.Core/Script.cs @@ -21,6 +21,6 @@ namespace ReallifeGamemode.Server.Core Log = LogManager.GetLogger(GetType()); } - protected DatabaseContext GetDbContext(bool useLoggerFactory = true) => Main.GetDbContext(useLoggerFactory); + protected DatabaseContext GetDbContext(bool useLoggerFactory = false) => Main.GetDbContext(useLoggerFactory); } } From e30f8710d6bf692db86c28c907fb7a6a4866eff8 Mon Sep 17 00:00:00 2001 From: hydrant Date: Mon, 5 Apr 2021 00:37:45 +0200 Subject: [PATCH 7/7] nametags range 40 --- ReallifeGamemode.Client/Gui/nametags.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReallifeGamemode.Client/Gui/nametags.ts b/ReallifeGamemode.Client/Gui/nametags.ts index 30ab2b05..9f434607 100644 --- a/ReallifeGamemode.Client/Gui/nametags.ts +++ b/ReallifeGamemode.Client/Gui/nametags.ts @@ -2,7 +2,7 @@ import game from ".."; -const maxDistance = 25 * 25; +const maxDistance = 40 * 40; const width = 0.03; const height = 0.0065; const border = 0.001;