-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#37] refactor: modify socket.io server
- validate event arguments with pydantic base model - rename the field `room` to game ID in `init` , `deinit` events - add the field `nickname` to the event data `init` and `deinit` - move constants , configurable parameters in appropriate modules Signed-off-by: T.H. <[email protected]>
- Loading branch information
1 parent
f0fcb9c
commit a7dea19
Showing
6 changed files
with
134 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
REST_HOST = "localhost" | ||
REST_PORT = 8081 | ||
|
||
RTC_HOST = "localhost" | ||
RTC_PORT = 8082 | ||
|
||
LOG_FILE_PATH = {"REST": "./log/dev/rest-server.log", "RTC": "./log/dev/rtc-server.log"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from enum import Enum | ||
|
||
|
||
class GameRtcEvent(Enum): | ||
""" | ||
events which synchronize game state in real-time communication | ||
""" | ||
|
||
INIT = "init" | ||
DEINIT = "deinit" | ||
CHAT = "chat" | ||
|
||
|
||
class RealTimeCommConst: | ||
EVENTS = GameRtcEvent | ||
NAMESPACE = "/game" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters