node-insim
Version:
An InSim library for NodeJS with TypeScript support
57 lines (55 loc) • 2.21 kB
TypeScript
import { SendablePacket } from './base';
import { PacketType } from './enums';
import { ObjectInfo } from './structs';
import type { PacketData } from './types';
/**
* Join Request Reply - send one of these back to LFS in response to a join request
*
* Set the {@link ISF_REQ_JOIN} flag in the {@link IS_ISI} to receive join requests
* A join request is seen as an {@link IS_NPL} packet with ZERO in the NumP field
* An immediate response (e.g. within 1 second) is required using an {@link IS_JRR} packet
*
* In this case, PLID must be zero and {@link JRRAction} must be {@link JRR_REJECT} or
* {@link JRR_SPAWN}.
* If you allow the join and it is successful you will then get a normal {@link IS_NPL} with
* NumP set.
* You can also specify the start position of the car using the StartPos structure.
*
* {@link IS_JRR} can also be used to move an existing car to a different location.
* In this case, {@link PLID} must be set, {@link JRRAction} must be {@link JRR_RESET} or
* higher and StartPos must be set.
*/
export declare class IS_JRR extends SendablePacket {
readonly Size = 16;
readonly Type = PacketType.ISP_JRR;
readonly ReqI = 0;
/** ZERO when this is a reply to a join request - SET to move a car */
PLID: number;
/** Set when this is a reply to a join request - ignored when moving a car */
UCID: number;
/** 1 - allow / 0 - reject (should send message to user) */
JRRAction: JRRAction;
Sp2: number;
Sp3: number;
/**
* 0: use default start point / Flags = 0x80: set start point
*
* To use default start point, StartPos should be filled with zero values.
*
* To specify a start point, StartPos X, Y, Zbyte and Heading should be filled like
* an autocross start position, Flags should be 0x80 and Index should be zero
*/
StartPos: ObjectInfo;
constructor(data?: IS_JRR_Data);
}
export type IS_JRR_Data = PacketData<IS_JRR>;
export declare enum JRRAction {
/** Reject new player */
JRR_REJECT = 0,
/** Allow new player */
JRR_SPAWN = 1,
/** Reset player's car */
JRR_RESET = 4,
/** Reset player's car without repairing damage */
JRR_RESET_NO_REPAIR = 5
}