Skip to content

Commit

Permalink
Added hooks for p2p and c2s
Browse files Browse the repository at this point in the history
  • Loading branch information
Raduc4 committed Jan 20, 2024
1 parent 49215cf commit 3f11025
Show file tree
Hide file tree
Showing 73 changed files with 823 additions and 1,503 deletions.
26 changes: 0 additions & 26 deletions common/index.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions common/types/api.ts

This file was deleted.

26 changes: 0 additions & 26 deletions common/types/c2s.ts

This file was deleted.

21 changes: 21 additions & 0 deletions framework/common/types/c2s.ts → common/types/c2sResponses.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type Payload = GetSessions | ListAllPeers;

export type ServiceTCPConnectionAccepted = {
ServiceConnectionAccepted: {
id: string;
Expand All @@ -24,3 +26,22 @@ export type ServiceDisconnect = {
request_id: string;
};
};

export type ListAllPeers = {
cid: number;
online_status: { [key: number]: boolean };
request_id: string;
};
export type PeerSessionInformation = {
cid: number;
peer_cid: number;
peer_username: string;
};

export type GetSessions = {
sessions: Array<{
cid: string;
peer_connections: { [key: number]: PeerSessionInformation };
}>;
request_id: string;
};
6 changes: 6 additions & 0 deletions common/types/errors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface ConnectionFailure {
ConnectionFailure: {
message: string;
request_id: string;
};
}
1 change: 0 additions & 1 deletion common/types/hooks.ts

This file was deleted.

16 changes: 16 additions & 0 deletions common/types/p2pResponses.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export type PeerConnectSuccess = {
cid: number;
request_id: string;
};

export type PeerDisconnectSuccess = {
cid: number;
request_id: string;
};

export type PeerRegisterSuccess = {
cid: number;
peer_cid: number;
peer_username: string;
request_id: string;
};
13 changes: 0 additions & 13 deletions common/types/user.ts

This file was deleted.

Loading

0 comments on commit 3f11025

Please sign in to comment.