• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Generated GRPC code for FlatBuffers TS *** DO NOT EDIT ***
2import * as flatbuffers from 'flatbuffers';
3import { Stat as MyGame_Example_Stat } from './my-game/example/stat';
4import { Monster as MyGame_Example_Monster } from './my-game/example/monster';
5
6var grpc = require('grpc');
7
8function serialize_MyGame_Example_Stat(buffer_args) {
9  if (!(buffer_args instanceof MyGame_Example_Stat)) {
10    throw new Error('Expected argument of type Stat');
11  }
12  return buffer_args.serialize();
13}
14
15function deserialize_MyGame_Example_Stat(buffer) {
16  return MyGame_Example_Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer))
17}
18
19
20function serialize_MyGame_Example_Monster(buffer_args) {
21  if (!(buffer_args instanceof MyGame_Example_Monster)) {
22    throw new Error('Expected argument of type Monster');
23  }
24  return buffer_args.serialize();
25}
26
27function deserialize_MyGame_Example_Monster(buffer) {
28  return MyGame_Example_Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
29}
30
31
32
33
34var MonsterStorageService = exports.MonsterStorageService = {
35  Store: {
36    path: '/MyGame.Example.MonsterStorage/Store',
37    requestStream: false,
38    responseStream: false,
39    requestType: flatbuffers.ByteBuffer,
40    responseType: MyGame_Example_Stat,
41    requestSerialize: serialize_MyGame_Example_Monster,
42    requestDeserialize: deserialize_MyGame_Example_Monster,
43    responseSerialize: serialize_MyGame_Example_Stat,
44    responseDeserialize: deserialize_MyGame_Example_Stat,
45  },
46  Retrieve: {
47    path: '/MyGame.Example.MonsterStorage/Retrieve',
48    requestStream: false,
49    responseStream: true,
50    requestType: flatbuffers.ByteBuffer,
51    responseType: MyGame_Example_Monster,
52    requestSerialize: serialize_MyGame_Example_Stat,
53    requestDeserialize: deserialize_MyGame_Example_Stat,
54    responseSerialize: serialize_MyGame_Example_Monster,
55    responseDeserialize: deserialize_MyGame_Example_Monster,
56  },
57  GetMaxHitPoint: {
58    path: '/MyGame.Example.MonsterStorage/GetMaxHitPoint',
59    requestStream: true,
60    responseStream: false,
61    requestType: flatbuffers.ByteBuffer,
62    responseType: MyGame_Example_Stat,
63    requestSerialize: serialize_MyGame_Example_Monster,
64    requestDeserialize: deserialize_MyGame_Example_Monster,
65    responseSerialize: serialize_MyGame_Example_Stat,
66    responseDeserialize: deserialize_MyGame_Example_Stat,
67  },
68  GetMinMaxHitPoints: {
69    path: '/MyGame.Example.MonsterStorage/GetMinMaxHitPoints',
70    requestStream: true,
71    responseStream: true,
72    requestType: flatbuffers.ByteBuffer,
73    responseType: MyGame_Example_Stat,
74    requestSerialize: serialize_MyGame_Example_Monster,
75    requestDeserialize: deserialize_MyGame_Example_Monster,
76    responseSerialize: serialize_MyGame_Example_Stat,
77    responseDeserialize: deserialize_MyGame_Example_Stat,
78  },
79};
80exports.MonsterStorageClient = grpc.makeGenericClientConstructor(MonsterStorageService);
81