Esempio n. 1
0
 public FakeGangMember(
     string id,
     GangSession session = null)
 {
     Id               = id.GangToBytes();
     Session          = session ?? GangSession.Default;
     MessagesReceived = new List <Message>();
 }
Esempio n. 2
0
 public WebSocketGangMember(
     byte[] id,
     GangSession session,
     WebSocket webSocket)
 {
     Id         = id;
     Session    = session;
     _webSocket = webSocket;
     _sendQueue = new TaskQueue();
     _buffer    = new ArraySegment <byte>(new byte[1024 * 4]);
 }
Esempio n. 3
0
 static async Task <IGangMember> GetGangMemberAsync(
     GangSession session,
     HttpContext context
     )
 {
     return(new WebSocketGangMember(
                $"{Guid.NewGuid():N}".GangToBytes(),
                session,
                await context.WebSockets.AcceptWebSocketAsync()
                ));
 }