Global Positioning System Reference
In-Depth Information
Now what are
RemotePlayerInfo
is Technically speaking, a real object is
running on its private host, can identify, enter, and exit one server, enter
another one, etc. In addition, the object can choose to publish itself on its
host:
rmi://ROHost:port/myRealObject
This is not used in the game scenario for a simple reason: imagine one of
the chasers having a direct reference and access to a runner's API. The
chaser would skip the third party to validate and propagate game info, and
the runner could not be hidden by the application|which is vital to play
the game according to its rules. Nevertheless, you might create a team of
players, who have direct access to each other to coordinate their moves and
motion. The server wouldn't know.
Recall that the
LCPlayer
, being a
RealObject
, implements the
Player
Client
to realize the
RemotePlayer
API as required to play on the game
server. On the server side, the
ServerPlayer
, also being a
RealObject
com-
municates with the
RemotePlayer
during the game, while its
RemoteClient
is not being used yet.
The server (developer) can use the
ServerObject.RemoteClient
to publish
a remote object reecting the client's behavior. Any client can look up the
remote object by its URL and frequently sample it with
getGPSinfo()
.
This is exactly what each
LCPlayer
does to get information about the other
players. The server can now focus on controlling the game, while each
client can actively retrieve the current status as needed.
On the other hand, the server can not steer this additional object, since
the server object can only propagate its client's actions; also the server does
not have access to the client implementation. In the context of
LondonChase
,
the
PlayerInfoClient
is used to provide relevant game information via the
RemotePlayerInfo
API; for example, the game role of each player.
Generally, a ROServer with the address
rmi://ROServerHost:<port>/ROAppName
can also choose to publish its
ServerObject
s, for example,
rmi://ROServerHost:<port>/ROAppName/ROName123
to indicate where the ROs come from, belong to, and are validated by.
The server accounts for his published clients. In
LondonChase
, all server (!)
players of a game are published and are looked up by its
LCPlayer
s|
including their own reflection! This way the player can easily compare the
behavior propagated by the server to its actual behavior, and the player
becomes the controller of its server player!
If the player gets the current
GPSinfo
via its reflection, the server should
immediately
4
invoke
getGPSin
fo()
via the
ROClient
(pass through).
The
4
Almost immediately, depending on the network latency.
Search WWH ::
Custom Search