small cleanup
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
import { Server, ServerUnaryCall, sendUnaryData } from '@grpc/grpc-js'
|
||||
|
||||
import {
|
||||
UnimplementedCharacterManagerService,
|
||||
Character,
|
||||
GetCharacterRequest,
|
||||
CreateCharacterRequest,
|
||||
} from './proto/character'
|
||||
|
||||
import { characterManagerDefinition } from "./proto/character.grpc-server"
|
||||
|
||||
export function initCharacterService(server: Server) {
|
||||
server.addService(UnimplementedCharacterManagerService.definition, {
|
||||
server.addService(characterManagerDefinition, {
|
||||
createCharacter: createCharacter_Call,
|
||||
getCharacter: getCharacter_Call,
|
||||
})
|
||||
@@ -19,7 +20,11 @@ function createCharacter_Call(call: ServerUnaryCall<CreateCharacterRequest, Char
|
||||
}
|
||||
|
||||
function createCharacter(request: CreateCharacterRequest): Character {
|
||||
return new Character()
|
||||
return {
|
||||
playerName: "test player",
|
||||
characterName: "test character",
|
||||
characterAlias: ["test alias"]
|
||||
}
|
||||
}
|
||||
|
||||
function getCharacter_Call(call: ServerUnaryCall<GetCharacterRequest, Character>, callback: sendUnaryData<Character>) {
|
||||
@@ -27,5 +32,9 @@ function getCharacter_Call(call: ServerUnaryCall<GetCharacterRequest, Character>
|
||||
}
|
||||
|
||||
function getCharacter(request: GetCharacterRequest): Character {
|
||||
return new Character()
|
||||
return {
|
||||
playerName: "test player",
|
||||
characterName: "test character",
|
||||
characterAlias: ["test alias"]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user