* discriminating unhandled server error from 'bad client' behavior. also addding Heartbeat
This commit is contained in:
parent
2961564fbe
commit
559e95ab76
|
|
@ -16,8 +16,10 @@ message ClientMessage {
|
|||
USER_JOINED_JAM_SESSION = 104;
|
||||
LEAVE_JAM_SESSION = 105;
|
||||
LEAVE_JAM_SESSION_ACK = 106;
|
||||
HEARTBEAT = 107;
|
||||
|
||||
SERVER_GENERIC_ERROR = 1000;
|
||||
SERVER_REJECTION_ERROR = 1001;
|
||||
}
|
||||
|
||||
// Identifies which inner message is filled in
|
||||
|
|
@ -26,19 +28,21 @@ message ClientMessage {
|
|||
|
||||
// One of the following messages can be populated
|
||||
// Client-Server messages (to/from)
|
||||
optional Login login = 100; // to server
|
||||
optional LoginAck login_ack = 101; // from server
|
||||
optional LoginJamSession login_jam_session = 102; // to server
|
||||
optional LoginJamSessionAck login_jam_session_ack = 103; // from server
|
||||
optional UserJoinedJamSession user_joined_jam_session = 104; // from server to all members
|
||||
optional LeaveJamSession leave_jam_session = 105;
|
||||
optional LeaveJamSessionAck leave_jam_session_ack = 106;
|
||||
optional Login login = 100; // to server
|
||||
optional LoginAck login_ack = 101; // from server
|
||||
optional LoginJamSession login_jam_session = 102; // to server
|
||||
optional LoginJamSessionAck login_jam_session_ack = 103; // from server
|
||||
optional UserJoinedJamSession user_joined_jam_session = 104; // from server to all members
|
||||
optional LeaveJamSession leave_jam_session = 105;
|
||||
optional LeaveJamSessionAck leave_jam_session_ack = 106;
|
||||
optional Heartbeat heartbeat = 107;
|
||||
|
||||
// Client-Session messages (to/from)
|
||||
|
||||
|
||||
// Server-to-Client errors
|
||||
// Server-to-Client errors
|
||||
optional ServerGenericError server_generic_error = 1000;
|
||||
optional ServerRejectionError server_rejection_error = 1001;
|
||||
}
|
||||
|
||||
// target: server
|
||||
|
|
@ -97,9 +101,24 @@ message UserJoinedJamSession {
|
|||
optional string username = 2; // meant to be a display name
|
||||
}
|
||||
|
||||
// target: server
|
||||
// send from client to server periodically to know if session is gone
|
||||
message Heartbeat {
|
||||
|
||||
}
|
||||
|
||||
// target: client
|
||||
// this indicates unhandled error on server
|
||||
// if you receive this, your connection will close after.
|
||||
// but gives the client a chance to know why.
|
||||
message ServerGenericError {
|
||||
optional string error_msg = 1;
|
||||
}
|
||||
|
||||
// target: client
|
||||
// this indicates the client did something wrong, and the server is mad enough to close connection.
|
||||
// if you receive this, your connection will close after.
|
||||
// but gives the client a chance to know why.
|
||||
message ServerRejectionError {
|
||||
optional string error_msg = 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue