Exemplo n.º 1
0
        protected override void OnReceive(SocketDistributionModel data, Socket socket)
        {
            if (data.Type == SocketDistributionModelType.LOGIN)
            {
                this[socket].Identifier = data.Convert <SocketRegistrationModel>().Username;
                Console.WriteLine($"User '{this[socket].Identifier}' connected!");
                return;
            }

            SocketObject socketObj = this[socket];

            if (socketObj != null && data.Type == SocketDistributionModelType.DEFAULT)
            {
                OnReceiveFromClient(data, socketObj);
            }
        }
Exemplo n.º 2
0
 // ABSTRACT::
 public abstract void OnReceiveFromClient(SocketDistributionModel data, SocketObject socket);