示例#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);
            }
        }
示例#2
0
 // ABSTRACT::
 public abstract void OnReceiveFromClient(SocketDistributionModel data, SocketObject socket);