Skip to content

Commit

Permalink
add : .proto파일 작업
Browse files Browse the repository at this point in the history
1. proto파일 추가
2. 프리티어 추가
  • Loading branch information
purebver committed Nov 15, 2024
1 parent eccd898 commit b61013a
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"singleQuote": true,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"arrowParens": "always",
"orderedImports": true,
"bracketSpacing": true,
"jsxBracketSameLine": false
}
Empty file added ai/server.js
Empty file.
15 changes: 15 additions & 0 deletions game/src/protobuf/auth/auth.packet.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package auth;

message C2S_ConnectGameRequest {
uint32 playerId = 1;
}

message S2C_ConnectGameNotification {
uint32 gameId = 1;
InitGameData initGameData = 2;
string status = 3;
string message = 4;
}

12 changes: 12 additions & 0 deletions game/src/protobuf/common/common.packet.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
syntax = "proto3";

package common;

message GamePacket {
oneof payload {
C2S_MoveRequest moveRequest = 1;
S2C_MoveNotification moveNotification = 2;
C2S_ConnectGameRequest connectGameRequest = 3;
S2C_ConnectGameNotification connectGameNotification = 4;
}
}
49 changes: 49 additions & 0 deletions game/src/protobuf/game/game.packet.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
syntax = "proto3";

package gameData;

message Position {
float x = 1;
float y = 2;
float z = 3;
}

message Player {
uint32 playerId = 1;
Position position = 2;
}

message Ghost {
uint32 ghostId = 1;
Position position = 2;
}

message LocationUpdate {
repeated GhostLocationData ghostLocations = 1;
repeated PlayerLocationData playerLocations = 2;
}

message GhostLocationData {
uint32 ghostId = 1;
Position position = 2;
}

message PlayerLocationData {
uint32 playerId = 1;
Position position = 2;
}

message InitGameData {
repeated Ghost ghosts = 1;
repeated Player players = 2;
Map mapId = 3;
}

message C2S_MoveRequest {
uint32 playerId = 1;
Position position = 2;
}

message S2C_MoveNotification {
LocationUpdate locationUpdate = 2;
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "index.js",
"type": "module",
"scripts": {
"start": "node src/server.js",
"dev": "nodemon src/server.js"
"start": "node game/src/server.js",
"dev": "nodemon game/src/server.js"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit b61013a

Please sign in to comment.