diff options
author | Elizabeth (Lizzy) Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-26 17:57:05 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-26 17:57:05 -0600 |
commit | 8a4ab8d79b5ce1dabb431168398b5d5111fe326c (patch) | |
tree | e60767dc5295edf379cf421e20171dc418e548b7 /server/src/network/index.ts | |
parent | c6e9baa0009f7cce0f6ff156a3957ef04a8cb684 (diff) | |
parent | 6ce6946a4401d2ee6fa5cb747fab7d4c658a63c8 (diff) | |
download | jumpstorm-8a4ab8d79b5ce1dabb431168398b5d5111fe326c.tar.gz jumpstorm-8a4ab8d79b5ce1dabb431168398b5d5111fe326c.zip |
Merge pull request #1 from Simponic/network
Network
Diffstat (limited to 'server/src/network/index.ts')
-rw-r--r-- | server/src/network/index.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/server/src/network/index.ts b/server/src/network/index.ts new file mode 100644 index 0000000..3cbf0ac --- /dev/null +++ b/server/src/network/index.ts @@ -0,0 +1,29 @@ +import { Message } from '@engine/network'; +import { Input } from '@engine/systems'; + +export * from './MessageProcessor'; +export * from './MessagePublisher'; +export * from './MessageReceiver'; +export * from './SessionManager'; +export * from './SessionInputSystem'; + +export type SessionData = { sessionId: string }; + +export type Session = { + sessionId: string; + controllableEntities: Set<string>; + inputSystem: Input; +}; + +export interface ServerMessage extends Message { + sessionData: SessionData; +} + +export interface SessionManager { + uniqueSessionId(): string; + getSession(id: string): Session | undefined; + getSessions(): string[]; + putSession(id: string, session: Session): void; + removeSession(id: string): void; + numSessions(): number; +} |