跳到主要内容
版本:Next

Interface INetworkedEvents

Namespace: ReadyM.SDK.Events
Assembly: ReadyM.SDK.dll

Allows raising networked events.

public interface INetworkedEvents

Methods​

Raise<T>(T)​

Raises the event. The origin is this client, or the server.

INetworkedEventRaise Raise<T>(T networkEvent) where T : struct, INetworkedEvent

Parameters​

networkEvent T

Returns​

INetworkedEventRaise

A handle a client may use to provide prediction and rollback logic while it waits for the answer.

Type Parameters​

T

RaiseAs<T>(PlayerId, T)​

Server only: raises it as though origin did, so handlers cannot tell it from that player's own event. The policy check is skipped, because the server vouched for it.

void RaiseAs<T>(PlayerId origin, T networkEvent) where T : struct, INetworkedEvent

Parameters​

origin PlayerId

networkEvent T

Type Parameters​

T

Remarks​

Useful for implementing server-side bots or AI that act on behalf of a player, or for a server-side mod that wants to raise an event as though it came from a player.

  • Methods
    • Raise<T>(T)
    • RaiseAs<T>(PlayerId, T)