indexing description: "[ Event that is used to detect servers over a LAN broadcast. Normally you send this event to the broadcast address (255.255.255.255). ]" date: "$Date$" revision: "$Revision$" class EM_NET_SERVER_DISCOVERY inherit EM_NET_EVENT_OBJECT redefine make_set_type end create {EM_NET_OBJECT_TYPES} make_set_type feature {NONE} -- Initialisation make_set_type (a_type_id: INTEGER) is -- Set `create_type_id' to `a_type_id'. do Precursor {EM_NET_EVENT_OBJECT} (a_type_id) game_name := "" end feature -- Serialization serialize (a_serializer: EM_NET_SERIALIZER) is -- Serialize to the given stream using `a_serializer'. require else game_name_not_void: game_name /= Void do a_serializer.put_integer(game_name.count) a_serializer.put_string(game_name) end serialization_byte_count: INTEGER is -- Count of bytes needed for a successful serialization require else game_name_not_void: game_name /= Void do Result := game_name.count + 4 end unserialize (an_unserializer: EM_NET_UNSERIALIZER) is -- Unserialize from a given stream using `an_unserializer'. local count: INTEGER do an_unserializer.read_integer count := an_unserializer.last_integer if count = 0 then game_name := "" else an_unserializer.read_string(count) game_name := an_unserializer.last_string end end feature -- Element change set_game_name(a_game_name: STRING) is -- Set `game_name' to `a_game_name'. require a_game_name_not_void: a_game_name /= Void do game_name := a_game_name ensure game_name_set: game_name = a_game_name end feature -- Information game_name: STRING -- Game name -- Used to idenftiy other servers. feature {NONE} -- Implementation invariant invariant_clause: True -- Your invariant here end