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