Namespace Network

Working with client and server packets in multiplayer and also determine stuff.

Functions

  • Event that is called when a client receives a packet with given name.

    Type Parameters

    • T extends object

    Parameters

    • name: string

      name of the packet

    • func: ((packetData: T) => void)
        • (packetData): void
        • Parameters

          • packetData: T

          Returns void

    Returns void

  • Event that is called when server receives a packet with the specified name from client.

    Type Parameters

    • T extends object

    Parameters

    • name: string

      name of the packet

    • func: ((client: NetworkClient, data: T) => void)
        • (client, data): void
        • Parameters

          Returns void

    Returns void

  • Returns native.Array<number>

    Array containing connected players UIDs.

  • Returns boolean

    true if player connected to remote world.

    2.1.0b57

  • Converts item or block ID from local to server value.

    Parameters

    • id: string | number

    Returns number

  • Sends message to all players.

    Parameters

    • message: string

      text of the message

    Returns void

  • Sends packet object with specified name to all clients.

    Parameters

    • name: string
    • packetData: object

    Returns void

  • Sends packet object with the specified name from client to server.

    Parameters

    • name: string
    • packetData: object

    Returns void

  • Converts item or block ID from server to local value.

    Parameters

    • id: string | number

    Returns number

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.