From a14e88ff4d0d87841a44254e2bff1784da6e8b48 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 15 Dec 2024 14:23:25 +0100 Subject: next commit --- network/map_server.gd | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'network/map_server.gd') diff --git a/network/map_server.gd b/network/map_server.gd index cf6f2ad..24f0181 100644 --- a/network/map_server.gd +++ b/network/map_server.gd @@ -3,11 +3,24 @@ extends Server signal logged_in(packet: MapServerLoginSuccessPacket) +signal received_server_message(packet: ServerMessagePacket) +signal received_broadcast_formatted_message(packet: BroadcastFormattedMessagePacket) @warning_ignore("shadowed_variable") func _init(host: String, port: int = 5121) -> void: super._init(host, port) + _setup_signals() + + +func _setup_signals(): + received_packet.connect(func(packet: Packet): + if packet is ServerMessagePacket: + received_server_message.emit(packet) + + if packet is BroadcastFormattedMessagePacket: + received_broadcast_formatted_message.emit(packet) + ) func login(account_id: int, character_id: int, login_id1: int, gender: Constants.Gender): -- cgit v1.2.3