fix spawns oops

This commit is contained in:
Lucia Ceionia 2024-11-02 23:59:50 -06:00
parent 1ac84a76c5
commit 8bac7851c7
3 changed files with 20 additions and 15 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ Godot/export_presets.cfg
Godot/icon.png Godot/icon.png
Godot/icon.png.import Godot/icon.png.import
build/LucysTools.pck build/LucysTools.pck
build

View File

@ -77,9 +77,11 @@ func send_server_sync_actor(to = "peers"):
}} }}
Network._send_P2P_Packet({"type": "instance_actor", "params": dict}, to, 2) Network._send_P2P_Packet({"type": "instance_actor", "params": dict}, to, 2)
func _instance_actor(dict, sender_id): func _instance_actor(dict):
if dict["actor_type"] != "lucy_fake_actor": return if dict["actor_type"] != "lucy_fake_actor": return
if sender_id != Network.KNOWN_GAME_MASTER or Network.GAME_MASTER: return var sender = Network.LUCY_INSTANCE_SENDER
Network.LUCY_INSTANCE_SENDER = 0
if sender != Network.KNOWN_GAME_MASTER or Network.GAME_MASTER: return
var data = dict["data"] var data = dict["data"]
self.srv_allow_bbcode = data["allow_bbcode"] self.srv_allow_bbcode = data["allow_bbcode"]

View File

@ -171,7 +171,7 @@ public class LucysChatChanges : IScriptMod
// C# is too rusty // C# is too rusty
foreach (var token in tokens) { foreach (var token in tokens) {
var had_change = false; var had_change = false;
foreach ((var change, var waiter) in pending_changes) { foreach (var (change, waiter) in pending_changes) {
if (waiter.Check(token)) { if (waiter.Check(token)) {
Mod.ModInterface.Logger.Information($"Adding Lucy Chat mod {change.name}"); Mod.ModInterface.Logger.Information($"Adding Lucy Chat mod {change.name}");
@ -218,24 +218,19 @@ public class LucysNetFixes : IScriptMod {
new CodeChange { new CodeChange {
name = "instance_actor", name = "instance_actor",
// "instance_actor": // "instance_actor":
// emit_signal("_instance_actor", DATA["params"] END // END
multitoken_prefix = new Func<Token, bool>[] { multitoken_prefix = new Func<Token, bool>[] {
t => t is ConstantToken {Value:StringVariant{Value: "instance_actor"}}, t => t is ConstantToken {Value:StringVariant{Value: "instance_actor"}},
t => t.Type == TokenType.Colon, t => t.Type == TokenType.Colon,
t => t.Type == TokenType.Newline, t => t.Type == TokenType.Newline,
t => t is IdentifierToken {Name: "emit_signal"},
t => t.Type == TokenType.ParenthesisOpen,
t => t.Type == TokenType.Constant,
t => t.Type == TokenType.Comma,
t => t.Type == TokenType.Identifier,
t => t.Type == TokenType.BracketOpen,
t => t.Type == TokenType.Constant,
t => t.Type == TokenType.BracketClose,
}, },
// , packet_sender END // LUCY_INSTANCE_SENDER = packet_sender
// END
code_to_add = new Token[] { code_to_add = new Token[] {
new Token(TokenType.Comma), new IdentifierToken("LUCY_INSTANCE_SENDER"),
new Token(TokenType.OpAssign),
new IdentifierToken("packet_sender"), new IdentifierToken("packet_sender"),
new Token(TokenType.Newline, 4),
} }
}, },
@ -691,6 +686,7 @@ public class LucysNetFixes : IScriptMod {
// var LUCY_CHAT_BBCODE = false // var LUCY_CHAT_BBCODE = false
// var LUCY_SRV_NAME = "" // var LUCY_SRV_NAME = ""
// var LUCY_PUNCHED_ME = 0 // var LUCY_PUNCHED_ME = 0
// var LUCY_INSTANCE_SENDER = 0
// END // END
code_to_add = new Token[] { code_to_add = new Token[] {
new Token(TokenType.PrVar), new Token(TokenType.PrVar),
@ -746,6 +742,12 @@ public class LucysNetFixes : IScriptMod {
new Token(TokenType.OpAssign), new Token(TokenType.OpAssign),
new ConstantToken(new IntVariant(0)), new ConstantToken(new IntVariant(0)),
new Token(TokenType.Newline, 0), new Token(TokenType.Newline, 0),
new Token(TokenType.PrVar),
new IdentifierToken("LUCY_INSTANCE_SENDER"),
new Token(TokenType.OpAssign),
new ConstantToken(new IntVariant(0)),
new Token(TokenType.Newline, 0),
} }
}, },
@ -820,7 +822,7 @@ public class LucysNetFixes : IScriptMod {
// C# is too rusty // C# is too rusty
foreach (var token in tokens) { foreach (var token in tokens) {
var had_change = false; var had_change = false;
foreach ((var change, var waiter) in pending_changes) { foreach (var (change, waiter) in pending_changes) {
if (waiter.Check(token)) { if (waiter.Check(token)) {
Mod.ModInterface.Logger.Information($"Adding Lucy Network mod {change.name}"); Mod.ModInterface.Logger.Information($"Adding Lucy Network mod {change.name}");