io.github.kory33.s2mctest.core.client

Type members

Classlikes

case
class ClientIdentity(name: String, uuid: UUID)

Identity of a Minecraft client which is normally notified by the server upon login.

Identity of a Minecraft client which is normally notified by the server upon login.

trait PacketAbstraction[Packet, WorldView, +Cmd]

An abstraction of packet data within a SightedClient. This is a functional interface of the form Packet => Option[WorldView => (WorldView, Cmd)].

An abstraction of packet data within a SightedClient. This is a functional interface of the form Packet => Option[WorldView => (WorldView, Cmd)].

Packet is the (super-)type of packets to abstract away, WorldView is SightedClient's view of the world corresponding to an abstraction and Cmd is a datatype that describes an effect to cause whenever a view modification takes place.

A "view modification" is a function of the form WorldView => (WorldView, Cmd). It arises as a result of receiving packets, and is a function from the old WorldView to a pair of new WorldView and an effect Cmd.

This functional object receives a packet and judges if the packet should invoke a view modification. If so, it returns a Some[WorldView => (WorldView, Cmd)] and None otherwise.

Companion
object
Companion
class
trait ProtocolPacketAbstraction[F[_], SBPackets <: Tuple, CBPackets <: Tuple, Packet, WorldView]()

A specialized PacketAbstraction which keeps track of protocol details.

A specialized PacketAbstraction which keeps track of protocol details.

These objects are better suited for composing packet abstractions compared to dealing with PacketAbstraction directly.

Companion
object
class SightedClient[F[_], ServerBoundPackets <: Tuple, ClientBoundPackets <: Tuple, WorldView](val writeTransport: ProtocolBasedWriteTransport[F, ServerBoundPackets], readTransport: ProtocolBasedReadTransport[F, ClientBoundPackets], val identity: ClientIdentity, viewRef: Ref[F, WorldView], abstraction: PacketAbstraction[Union[ClientBoundPackets], WorldView, F[List[WritablePacketIn[ServerBoundPackets]]]])(implicit evidence$1: Concurrent[F])

The class of Minecraft clients that associate incoming packets to updates of state of the connected world. The name "Sighted" is from an analogy between the animals receiving light rays to their eyes and Minecraft clients receiving client-bound packets - they both shape the assumptions (view) about the external environment using those incoming data.

The class of Minecraft clients that associate incoming packets to updates of state of the connected world. The name "Sighted" is from an analogy between the animals receiving light rays to their eyes and Minecraft clients receiving client-bound packets - they both shape the assumptions (view) about the external environment using those incoming data.

These clients make a distinction between hidden "internal" packets and "visible" packets within ClientBoundPackets. Internal packets are packets that are abstracted away by abstraction, and cannot be observed by users of this class; they contribute to the automatic update of the clients' view of the world. Visible packets are those that are not filtered by the abstraction.

Value Params
abstraction

the object abstracting packets from writeTransport.

identity

the identity of this client

viewRef

reference to a WorldView that this client keeps updating

writeTransport

INTERNAL, the transport that this client uses. Users should use nextPacketOrViewUpdate or writePacket wherever possible.

Companion
object
Companion
class