Skip to content

Commit

Permalink
feat: support health packet
Browse files Browse the repository at this point in the history
  • Loading branch information
Sceat committed May 5, 2024
1 parent d02cd75 commit 3f710b5
Show file tree
Hide file tree
Showing 3 changed files with 179 additions and 111 deletions.
266 changes: 160 additions & 106 deletions generated/ares_pb.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.4.2 with parameter "target=js"
// @generated by protoc-gen-es v1.9.0 with parameter "target=js"
// @generated from file ares.proto (package ares, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand All @@ -8,98 +8,121 @@ import { proto3 } from '@bufbuild/protobuf'
/**
* @generated from enum ares.EntityType
*/
export const EntityType = proto3.makeEnum('ares.EntityType', [
export const EntityType = /*@__PURE__*/ proto3.makeEnum('ares.EntityType', [
{ no: 0, name: 'MOB' },
{ no: 1, name: 'NPC' },
])

/**
* @generated from enum ares.Classe
*/
export const Classe = proto3.makeEnum('ares.Classe', [
export const Classe = /*@__PURE__*/ proto3.makeEnum('ares.Classe', [
{ no: 0, name: 'IOP' },
{ no: 1, name: 'SRAM' },
])

/**
* @generated from enum ares.ErrorCode
*/
export const ErrorCode = proto3.makeEnum('ares.ErrorCode', [
export const ErrorCode = /*@__PURE__*/ proto3.makeEnum('ares.ErrorCode', [
{ no: 0, name: 'NO_BETA_ACCESS' },
])

/**
* @generated from enum ares.Action
*/
export const Action = proto3.makeEnum('ares.Action', [
{ no: 0, name: 'JUMP' },
{ no: 1, name: 'DANCE' },
{ no: 2, name: 'WALK' },
{ no: 3, name: 'RUN' },
{ no: 4, name: 'SIT' },
export const Action = /*@__PURE__*/ proto3.makeEnum('ares.Action', [
{ no: 0, name: 'IDLE' },
{ no: 1, name: 'RUN' },
{ no: 2, name: 'JUMP' },
{ no: 3, name: 'JUMP_RUN' },
{ no: 4, name: 'FALL' },
{ no: 5, name: 'DEATH' },
{ no: 6, name: 'ATTACK_CAC' },
{ no: 7, name: 'SPELL_BUFF' },
{ no: 8, name: 'SPELL_TARGET' },
{ no: 9, name: 'DANCE' },
{ no: 10, name: 'SIT' },
{ no: 11, name: 'WALK' },
])

/**
* @generated from message ares.Packet
*/
export const Packet = proto3.makeMessageType('ares.Packet', () => [
{
no: 1,
name: 'signatureRequest',
kind: 'message',
T: SignatureRequest,
oneof: 'type',
},
{ no: 2, name: 'error', kind: 'message', T: Error, oneof: 'type' },
{
no: 3,
name: 'signatureResponse',
kind: 'message',
T: SignatureResponse,
oneof: 'type',
},
{
no: 4,
name: 'characterAction',
kind: 'message',
T: CharacterAction,
oneof: 'type',
},
{
no: 5,
name: 'characterPosition',
kind: 'message',
T: CharacterPosition,
oneof: 'type',
},
{
no: 6,
name: 'entitySpawn',
kind: 'message',
T: EntitySpawn,
oneof: 'type',
},
{
no: 7,
name: 'entityDespawn',
kind: 'message',
T: EntityDespawn,
oneof: 'type',
},
{ no: 8, name: 'serverInfo', kind: 'message', T: ServerInfo, oneof: 'type' },
{
no: 9,
name: 'chatMessage',
kind: 'message',
T: ChatMessage,
oneof: 'type',
},
])
export const Packet = /*@__PURE__*/ proto3.makeMessageType(
'ares.Packet',
() => [
{
no: 1,
name: 'signatureRequest',
kind: 'message',
T: SignatureRequest,
oneof: 'type',
},
{ no: 2, name: 'error', kind: 'message', T: Error, oneof: 'type' },
{
no: 3,
name: 'signatureResponse',
kind: 'message',
T: SignatureResponse,
oneof: 'type',
},
{
no: 4,
name: 'characterAction',
kind: 'message',
T: CharacterAction,
oneof: 'type',
},
{
no: 5,
name: 'characterPosition',
kind: 'message',
T: CharacterPosition,
oneof: 'type',
},
{
no: 6,
name: 'entitySpawn',
kind: 'message',
T: EntitySpawn,
oneof: 'type',
},
{
no: 7,
name: 'entityDespawn',
kind: 'message',
T: EntityDespawn,
oneof: 'type',
},
{
no: 8,
name: 'serverInfo',
kind: 'message',
T: ServerInfo,
oneof: 'type',
},
{
no: 9,
name: 'chatMessage',
kind: 'message',
T: ChatMessage,
oneof: 'type',
},
{
no: 10,
name: 'characterHealth',
kind: 'message',
T: CharacterHealth,
oneof: 'type',
},
],
)

/**
* @generated from message ares.SignatureRequest
*/
export const SignatureRequest = proto3.makeMessageType(
export const SignatureRequest = /*@__PURE__*/ proto3.makeMessageType(
'ares.SignatureRequest',
() => [
{ no: 1, name: 'payload', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
Expand All @@ -109,21 +132,24 @@ export const SignatureRequest = proto3.makeMessageType(
/**
* @generated from message ares.Error
*/
export const Error = proto3.makeMessageType('ares.Error', () => [
export const Error = /*@__PURE__*/ proto3.makeMessageType('ares.Error', () => [
{ no: 1, name: 'code', kind: 'enum', T: proto3.getEnumType(ErrorCode) },
])

/**
* @generated from message ares.EntitySpawn
*/
export const EntitySpawn = proto3.makeMessageType('ares.EntitySpawn', () => [
{ no: 1, name: 'entities', kind: 'message', T: Entity, repeated: true },
])
export const EntitySpawn = /*@__PURE__*/ proto3.makeMessageType(
'ares.EntitySpawn',
() => [
{ no: 1, name: 'entities', kind: 'message', T: Entity, repeated: true },
],
)

/**
* @generated from message ares.EntityDespawn
*/
export const EntityDespawn = proto3.makeMessageType(
export const EntityDespawn = /*@__PURE__*/ proto3.makeMessageType(
'ares.EntityDespawn',
() => [
{
Expand All @@ -139,20 +165,39 @@ export const EntityDespawn = proto3.makeMessageType(
/**
* @generated from message ares.ServerInfo
*/
export const ServerInfo = proto3.makeMessageType('ares.ServerInfo', () => [
{
no: 1,
name: 'player_count',
kind: 'scalar',
T: 13 /* ScalarType.UINT32 */,
},
{ no: 2, name: 'max_players', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
])
export const ServerInfo = /*@__PURE__*/ proto3.makeMessageType(
'ares.ServerInfo',
() => [
{
no: 1,
name: 'player_count',
kind: 'scalar',
T: 13 /* ScalarType.UINT32 */,
},
{
no: 2,
name: 'max_players',
kind: 'scalar',
T: 13 /* ScalarType.UINT32 */,
},
],
)

/**
* @generated from message ares.CharacterHealth
*/
export const CharacterHealth = /*@__PURE__*/ proto3.makeMessageType(
'ares.CharacterHealth',
() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'health', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
],
)

/**
* @generated from message ares.SignatureResponse
*/
export const SignatureResponse = proto3.makeMessageType(
export const SignatureResponse = /*@__PURE__*/ proto3.makeMessageType(
'ares.SignatureResponse',
() => [
{ no: 1, name: 'bytes', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
Expand All @@ -163,7 +208,7 @@ export const SignatureResponse = proto3.makeMessageType(
/**
* @generated from message ares.CharacterAction
*/
export const CharacterAction = proto3.makeMessageType(
export const CharacterAction = /*@__PURE__*/ proto3.makeMessageType(
'ares.CharacterAction',
() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
Expand All @@ -174,7 +219,7 @@ export const CharacterAction = proto3.makeMessageType(
/**
* @generated from message ares.CharacterPosition
*/
export const CharacterPosition = proto3.makeMessageType(
export const CharacterPosition = /*@__PURE__*/ proto3.makeMessageType(
'ares.CharacterPosition',
() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
Expand All @@ -185,25 +230,31 @@ export const CharacterPosition = proto3.makeMessageType(
/**
* @generated from message ares.ChatMessage
*/
export const ChatMessage = proto3.makeMessageType('ares.ChatMessage', () => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'message', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 3, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
])
export const ChatMessage = /*@__PURE__*/ proto3.makeMessageType(
'ares.ChatMessage',
() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'message', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 3, name: 'address', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
],
)

/**
* @generated from message ares.Position
*/
export const Position = proto3.makeMessageType('ares.Position', () => [
{ no: 1, name: 'x', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
{ no: 2, name: 'y', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
{ no: 3, name: 'z', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
])
export const Position = /*@__PURE__*/ proto3.makeMessageType(
'ares.Position',
() => [
{ no: 1, name: 'x', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
{ no: 2, name: 'y', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
{ no: 3, name: 'z', kind: 'scalar', T: 2 /* ScalarType.FLOAT */ },
],
)

/**
* @generated from message ares.SiblingEntity
*/
export const SiblingEntity = proto3.makeMessageType(
export const SiblingEntity = /*@__PURE__*/ proto3.makeMessageType(
'ares.SiblingEntity',
() => [
{ no: 1, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
Expand All @@ -214,17 +265,20 @@ export const SiblingEntity = proto3.makeMessageType(
/**
* @generated from message ares.Entity
*/
export const Entity = proto3.makeMessageType('ares.Entity', () => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 3, name: 'position', kind: 'message', T: Position },
{ no: 4, name: 'type', kind: 'enum', T: proto3.getEnumType(EntityType) },
{ no: 5, name: 'level', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
{
no: 8,
name: 'siblings',
kind: 'message',
T: SiblingEntity,
repeated: true,
},
])
export const Entity = /*@__PURE__*/ proto3.makeMessageType(
'ares.Entity',
() => [
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 2, name: 'name', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
{ no: 3, name: 'position', kind: 'message', T: Position },
{ no: 4, name: 'type', kind: 'enum', T: proto3.getEnumType(EntityType) },
{ no: 5, name: 'level', kind: 'scalar', T: 13 /* ScalarType.UINT32 */ },
{
no: 8,
name: 'siblings',
kind: 'message',
T: SiblingEntity,
repeated: true,
},
],
)
Loading

0 comments on commit 3f710b5

Please sign in to comment.