-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49a3844
commit ec92f45
Showing
5 changed files
with
104 additions
and
5 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
98 changes: 98 additions & 0 deletions
98
src/DrawTogether.Actors/Serialization/Proto/DrawingProtocol.proto
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,98 @@ | ||
syntax = "proto3"; | ||
|
||
package DrawTogether.Actors.Serialization.Proto; | ||
|
||
import "google/protobuf/timestamp.proto"; | ||
|
||
/* Primitives */ | ||
message UserId { | ||
string id = 1; | ||
} | ||
|
||
message DrawingSessionId { | ||
string id = 1; | ||
} | ||
|
||
message StrokeId { | ||
int32 id = 1; | ||
} | ||
|
||
message Point { | ||
double x = 1; | ||
double y = 2; | ||
} | ||
|
||
message ConnectedStroke { | ||
StrokeId id = 1; | ||
repeated Point points = 2; | ||
int32 strokeWidth = 3; | ||
string strokeColor = 4; | ||
} | ||
|
||
/* Commands and events */ | ||
message AddUser { | ||
DrawingSessionId drawingSessionId = 1; | ||
UserId userId = 2; | ||
} | ||
|
||
message RemoveUser { | ||
DrawingSessionId drawingSessionId = 1; | ||
UserId userId = 2; | ||
|
||
} | ||
|
||
message AddStroke { | ||
DrawingSessionId drawingSessionId = 2; | ||
ConnectedStroke connectedStroke = 3; | ||
} | ||
|
||
message RemoveStroke { | ||
DrawingSessionId drawingSessionId = 1; | ||
StrokeId strokeId = 2; | ||
} | ||
|
||
message ClearStrokes { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message SessionClosed { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
/* State */ | ||
|
||
message DrawingSessionState{ | ||
DrawingSessionId drawingSessionId = 1; | ||
repeated ConnectedStroke connectedStrokes = 2; | ||
repeated UserId connectedUsers = 3; | ||
google.protobuf.Timestamp lastUpdated = 4; | ||
} | ||
|
||
/* Queries */ | ||
|
||
message GetDrawingSessionState { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message SubscribeToDrawingSessionState { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message SubscribeAcknowledged { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message UnsuscribeFromDrawingSessionState { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message UnsuscribeAcknowledged { | ||
DrawingSessionId drawingSessionId = 1; | ||
} | ||
|
||
message DrawingActivityUpdated { | ||
DrawingSessionId drawingSessionId = 1; | ||
google.protobuf.Timestamp lastUpdated = 2; | ||
int32 activeUsers = 3; | ||
bool isRemoved = 4; | ||
} |
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
4 changes: 1 addition & 3 deletions
4
src/DrawTogether.Entities/Drawings/Messages/IWithDrawingSessionId.cs
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