mirror of
https://github.com/originalmk/archat-server.git
synced 2025-01-18 16:29:17 +00:00
Added new requests for chat init
This commit is contained in:
parent
9c0e3e607f
commit
b9fe4a7094
@ -7,12 +7,16 @@ import (
|
|||||||
// Constants
|
// Constants
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EchoReqID = 1
|
EchoReqID = 1
|
||||||
EchoResID = 128 + EchoReqID
|
EchoResID = 128 + EchoReqID
|
||||||
ListPeersReqID = 2
|
ListPeersReqID = 2
|
||||||
ListPeersResID = 128 + ListPeersReqID
|
ListPeersResID = 128 + ListPeersReqID
|
||||||
AuthReqID = 3
|
AuthReqID = 3
|
||||||
AuthResID = 128 + AuthReqID
|
AuthResID = 128 + AuthReqID
|
||||||
|
StartChatAReqID = 4
|
||||||
|
StartChatBReqID = 5
|
||||||
|
StartChatCReqID = 6
|
||||||
|
StartChatDReqID = 7
|
||||||
)
|
)
|
||||||
|
|
||||||
// Requests & responses subtypes
|
// Requests & responses subtypes
|
||||||
@ -134,3 +138,39 @@ type AuthResponse struct {
|
|||||||
func (AuthResponse) ID() int {
|
func (AuthResponse) ID() int {
|
||||||
return AuthResID
|
return AuthResID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "Stateful" requests like these need to have some information identifying what operation they are linked to
|
||||||
|
// There may be some errors if two requests are sent by one host to the same other host... may they?
|
||||||
|
|
||||||
|
type StartChatARequest struct {
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (StartChatARequest) ID() int {
|
||||||
|
return StartChatAReqID
|
||||||
|
}
|
||||||
|
|
||||||
|
type StartChatBRequest struct {
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (StartChatBRequest) ID() int {
|
||||||
|
return StartChatBReqID
|
||||||
|
}
|
||||||
|
|
||||||
|
type StartChatCRequest struct {
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (StartChatCRequest) ID() int {
|
||||||
|
return StartChatCReqID
|
||||||
|
}
|
||||||
|
|
||||||
|
type StartChatDRequest struct {
|
||||||
|
Nickname string `json:"nickname"`
|
||||||
|
Accept bool `json:"accept"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (StartChatDRequest) ID() int {
|
||||||
|
return StartChatDReqID
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user