Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.network.multiplayer.net_system_events

Class EM_NET_SERVER_DISCOVERY_RESPONSE


Direct ancestors

EM_NET_EVENT_OBJECT

Creation

Features

Invariants

indexing

description

Event that is sent back in response to a EM_NET_SERVER_DISCOVERY from a detected server to the client.

date

$Date: 2005/10/23 14:15:19 $

revision

$Revision: 1.16 $

class

EM_NET_SERVER_DISCOVERY_RESPONSE

inherit

EM_NET_EVENT_OBJECT

create {EM_NET_OBJECT_TYPES}

make_set_type (a_type_id: INTEGER)

-- Set create_type_id to a_type_id.

-- (From EM_NET_OBJECT)

feature -- Initialization

init_serialization_byte_count: INTEGER

-- Count of bytes needed for a successful serialization of initialization data.
-- The default behaviour uses the serialize_byte_count feature.
-- If you redefine serialize_init_data, you'll also to redefine this feature.
-- This might be a constant and *could* be a dynamic value.
-- {EM_NET_WORK_CONSTANTS}.max_serialization_byte_count is the limit!

-- (From EM_NET_OBJECT)

make_from_stream (an_unserializer: EM_NET_UNSERIALIZER)

-- Initialize object with data from an_unserializer.
-- The default behaviour uses the unserialize feature.
-- If you have other/extended initialization data you need to redefine this feature.
-- Note: There is no need to serialize the type ID, this is done automatically.
-- This function will usually be called by the EM_NET_OBJECT_GENERATOR class.

-- (From EM_NET_OBJECT)

serialize_init_data (a_serializer: EM_NET_SERIALIZER)

-- Serialize initialization data to the given stream using a_serializer.
-- The default behaviour uses the serialize feature.
-- If you redefine make_from_stream, you'll also have to redefine this feature.
-- Note: There is no need to serialize the type ID, this is done automatically.

-- (From EM_NET_OBJECT)

feature -- Element change

set_game_name (a_game_name: STRING)

-- Set game_name to a_game_name.

require
a_game_name_not_void: a_game_name /= Void
ensure
game_name_set: game_name = a_game_name
set_id (an_id: INTEGER)

-- Set id to an_id.

-- (From EM_NET_OBJECT)

ensure
id_correct_set: an_id = id
set_ip (an_ip: INTEGER)

-- Set ip to an_ip.

ensure
ip_set: ip = an_ip
set_ping (a_ping: INTEGER)

-- Set ping to a_ping.

require
a_positive_ping: a_ping >=0
ensure
ping_set: ping = a_ping
set_port (a_port:INTEGER)

-- Set port to a_port.

require
a_correct_port: 0 < a_port and then a_port < 65536
ensure
port_set: port = a_port
set_server_name (a_server_name: STRING)

-- Set server_name to a_server_name.

require
a_server_name_not_void: a_server_name /= Void
ensure
server_name_set: server_name = a_server_name
set_time_offset (a_time: INTEGER)

-- Set last_update to a_time.

-- (From EM_NET_OBJECT)

ensure
last_update_set: time_offset = a_time
set_updating_connection (a_connection: EM_NET_CONNECTION)

-- Set updating_connection to a_connection.

-- (From EM_NET_OBJECT)

require
a_connection_not_void: a_connection /= Void
ensure
updating_connection_set: updating_connection = a_connection

feature -- Serialization

serialization_byte_count: INTEGER

-- Count of bytes needed for a successful serialization

-- (From EM_NET_OBJECT)

require else
server_name_not_void: server_name /= Void
game_name_not_void: game_name /= Void
ensure
Result_in_max_serialization_byte_count_range: Result <= max_serialization_byte_count.item
serialize (a_serializer: EM_NET_SERIALIZER)

-- Serialize to the given stream using a_serializer.

-- (From EM_NET_OBJECT)

require
a_serializer_not_void: a_serializer /= Void
require else
server_name_not_void: server_name /= Void
game_name_not_void: game_name /= Void
unserialize (an_unserializer: EM_NET_UNSERIALIZER)

-- Unserialize from a given stream using an_unserializer.

-- (From EM_NET_OBJECT)

require
a_unserializer_not_void: an_unserializer /= Void

feature -- Event handling

publish

-- Publish an event to the clients that belong to group.

-- (From EM_NET_EVENT_OBJECT)

require
group_set: group /= Void

feature -- Group handling.

set_group (a_group: EM_NET_GROUP)

-- Set group to a_group.
-- This is the group to which this event will be published.

-- (From EM_NET_OBJECT)

require
not_already_added_to_a_group: not a_group.has_object (Current)
ensure
group_set: group = a_group

feature -- Information

game_name: STRING

-- Game name

group: EM_NET_GROUP

-- Group that contains the current object
-- The object will be synchronized with all clients that are in
-- the same group.

-- (From EM_NET_OBJECT)

id: INTEGER

-- Unique ID that indentifies a single instance of an object

-- (From EM_NET_OBJECT)

ip: INTEGER

-- IP

is_make_set_type_called: BOOLEAN

-- Has make_set_type been called?

-- (From EM_NET_OBJECT)

is_synchronized: BOOLEAN

-- Is this object currently synchronized over network?
-- True if this object is added to a server or client list for synchronisation.

-- (From EM_NET_OBJECT)

next_sync_frame: INTEGER

-- Next time when object synchronisation occurs

-- (From EM_NET_OBJECT)

out: STRING

-- Textual output of the disconvery response

-- (From ANY)

ping: INTEGER

-- Ping
-- not serialized

port: INTEGER

-- Port

server_name: STRING

-- Server name

time_offset: INTEGER

-- Time in miliseconds of the lastupdate

-- (From EM_NET_OBJECT)

type_id: INTEGER

-- ID that identifies the type of of an on object

-- (From EM_NET_OBJECT)

updating_connection: EM_NET_CONNECTION

-- Connection which sent the last update

-- (From EM_NET_OBJECT)

invariant

invariant_clause: True

type_id_set_by_factory: type_id > 0 and is_make_set_type_called

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end