Skip to content

Commit

Permalink
feature(proto): Password authentication
Browse files Browse the repository at this point in the history
relates to #57
  • Loading branch information
Mario Reder committed Jan 7, 2019
1 parent 45d43a1 commit 6869d6e
Show file tree
Hide file tree
Showing 8 changed files with 771 additions and 8 deletions.
99 changes: 98 additions & 1 deletion proto/ClientServerMessage.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export interface IClientServer {
/** ClientServer player */
player?: (IPlayer|null);

/** ClientServer authentication */
authentication?: (IAuthentication|null);

/** ClientServer playerData */
playerData?: (IPlayerData|null);

Expand Down Expand Up @@ -157,6 +160,9 @@ export class ClientServer implements IClientServer {
/** ClientServer player. */
public player?: (IPlayer|null);

/** ClientServer authentication. */
public authentication?: (IAuthentication|null);

/** ClientServer playerData. */
public playerData?: (IPlayerData|null);

Expand All @@ -167,7 +173,7 @@ export class ClientServer implements IClientServer {
public chat?: (IChat|null);

/** ClientServer message. */
public message?: ("handshake"|"ping"|"player"|"playerData"|"metaData"|"chat");
public message?: ("handshake"|"ping"|"player"|"authentication"|"playerData"|"metaData"|"chat");

/**
* Creates a new ClientServer instance using the specified properties.
Expand Down Expand Up @@ -248,6 +254,7 @@ export namespace ClientServer {
HANDSHAKE = 2,
PING = 3,
PLAYER_UPDATE = 6,
AUTHENTICATION = 7,
PLAYER_DATA = 128,
META_DATA = 129,
CHAT = 130
Expand Down Expand Up @@ -542,6 +549,96 @@ export class Player implements IPlayer {
public toJSON(): { [k: string]: any };
}

/** Properties of an Authentication. */
export interface IAuthentication {

/** Authentication password */
password?: (string|null);
}

/** Represents an Authentication. */
export class Authentication implements IAuthentication {

/**
* Constructs a new Authentication.
* @param [properties] Properties to set
*/
constructor(properties?: IAuthentication);

/** Authentication password. */
public password: string;

/**
* Creates a new Authentication instance using the specified properties.
* @param [properties] Properties to set
* @returns Authentication instance
*/
public static create(properties?: IAuthentication): Authentication;

/**
* Encodes the specified Authentication message. Does not implicitly {@link Authentication.verify|verify} messages.
* @param message Authentication message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encode(message: IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Encodes the specified Authentication message, length delimited. Does not implicitly {@link Authentication.verify|verify} messages.
* @param message Authentication message or plain object to encode
* @param [writer] Writer to encode to
* @returns Writer
*/
public static encodeDelimited(message: IAuthentication, writer?: $protobuf.Writer): $protobuf.Writer;

/**
* Decodes an Authentication message from the specified reader or buffer.
* @param reader Reader or buffer to decode from
* @param [length] Message length if known beforehand
* @returns Authentication
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Authentication;

/**
* Decodes an Authentication message from the specified reader or buffer, length delimited.
* @param reader Reader or buffer to decode from
* @returns Authentication
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Authentication;

/**
* Verifies an Authentication message.
* @param message Plain object to verify
* @returns `null` if valid, otherwise the reason why it is not
*/
public static verify(message: { [k: string]: any }): (string|null);

/**
* Creates an Authentication message from a plain object. Also converts values to their respective internal types.
* @param object Plain object
* @returns Authentication
*/
public static fromObject(object: { [k: string]: any }): Authentication;

/**
* Creates a plain object from an Authentication message. Also converts values to other types if specified.
* @param message Authentication
* @param [options] Conversion options
* @returns Plain object
*/
public static toObject(message: Authentication, options?: $protobuf.IConversionOptions): { [k: string]: any };

/**
* Converts this Authentication to JSON.
* @returns JSON object
*/
public toJSON(): { [k: string]: any };
}

/** Properties of a PlayerData. */
export interface IPlayerData {

Expand Down
Loading

0 comments on commit 6869d6e

Please sign in to comment.