/
sessions.go
39 lines (32 loc) · 1.08 KB
/
sessions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package echovr
import "encoding/binary"
type LoginSession struct {
AccountID uint64 `json:"accountid"`
Session uint64 `json:"session"`
}
func (m *LoginSession) Stream(s *EasyStream) error {
return RunErrorFunctions([]func() error{
func() error { return s.StreamNumber(binary.LittleEndian, &m.AccountID) },
func() error { return s.StreamNumber(binary.LittleEndian, &m.Session) },
})
}
type MatchingSession struct {
AccountID uint64 `json:"accountid"`
Session uint64 `json:"session"`
}
func (m *MatchingSession) Stream(s *EasyStream) error {
return RunErrorFunctions([]func() error{
func() error { return s.StreamNumber(binary.LittleEndian, &m.AccountID) },
func() error { return s.StreamNumber(binary.LittleEndian, &m.Session) },
})
}
type SessionUUID struct {
ServerID uint64 `json:"serverid"`
Session uint64 `json:"session"`
}
func (m *SessionUUID) Stream(s *EasyStream) error {
return RunErrorFunctions([]func() error{
func() error { return s.StreamNumber(binary.LittleEndian, &m.ServerID) },
func() error { return s.StreamNumber(binary.LittleEndian, &m.Session) },
})
}