indexing description: "[ Event that requests a join of a client to a server. This is used in the Client/Server implementation of the multiplayer framework. This is a secured two phase commit event. ]" date: "$Date$" revision: "$Revision$" class EM_NET_JOIN_REQUEST inherit EM_NET_2PC_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 (a_type_id) nick_name := "" end feature -- Serialization serialize (a_serializer: EM_NET_SERIALIZER) is -- Serialize to the given stream using `a_serializer'. require else a_serializer_not_void: a_serializer /= Void id_set: id > 0 nick_name_not_void: nick_name /= Void do a_serializer.put_integer (id) a_serializer.put_integer (nick_name.count) a_serializer.put_string (nick_name) end serialization_byte_count: INTEGER is -- Count of bytes needed for a successful serialization require else nick_name_not_void: nick_name /= Void do Result:=nick_name.count + 8 end unserialize (an_unserializer: EM_NET_UNSERIALIZER) is -- Unserialize from a given stream using `an_unserializer'. local count: INTEGER do an_unserializer.read_integer id := an_unserializer.last_integer an_unserializer.read_integer count := an_unserializer.last_integer if count = 0 then nick_name := "" else an_unserializer.read_string (count) nick_name := an_unserializer.last_string end end feature -- Element change set_nick_name(a_nick_name: STRING) is -- Set `nick_name' to `a_nick_name'. require a_nick_name_not_void: a_nick_name /= Void do nick_name := a_nick_name ensure nick_name_set: nick_name = a_nick_name end feature -- Information nick_name: STRING -- Nick name feature {NONE} -- Implementation invariant invariant_clause: True -- Your invariant here end